We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [logic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
29 views

Should fields in components in an ECS use polymorphism?

I've just started to try and learn how to use ECS (Entity component systems), but I'm having trouble understanding the concepts behind components. Should adding more types of components, or trying to ...
1
vote
1answer
67 views

Using logic gates for Sprite Collision Detection - humor an old fart please

Im an old coder who came back so to speak, learning Java I know what I want but I cannot find anyone asking it anywhere so here goes... Im writing a basic tank game to code for practice but as is ...
0
votes
2answers
43 views

How can I calculate all the tiles visible to a camera in 2D?

I am creating a basic tile-based 2D game ~mostly from scratch in Java, however all I need is pseudo-code for how this could be achieved.  My problem lies in the fact that my world (stored in ...
0
votes
1answer
56 views

Way to look up a chain of touching objects (power connections)

I'm having a bit of a logic problem. I have blocks that connect together for power and so when a block comes into contact with a block that is powered, it also becomes powered. It also keeps a list of ...
0
votes
0answers
38 views

How to program rules for card game [duplicate]

Hi I want to program a card game, in my game each card can do multiple actions, depend on the situation in which the player is facing. For example There is an "Attack" card which can attack another ...
1
vote
1answer
502 views

Should components in Entity Component System pattern have logic?

Is often read that in entity component system pattern we should treat components just as a passive data structure with no logic at all, this way we follow to a data oriented design approach with ...
-1
votes
1answer
125 views

Why does this implementation of aabb-sphere collision ghost collide and how can I fix it

I am trying to make a collision detection system and the aabb-sphere collision isn't working. Here is my code. This method checks to see which whether I should collide with AABB-AABB, Sphere-Sphere, ...
2
votes
1answer
136 views

How to structure a game that continue even when closed?

I'm developing a Unity based game purely for fun but I'm stuck with a problem. How can I implement a system that keep my game running even when is closed? I don't want to HAVE IT running when it's ...
68
votes
6answers
16k views

How can I know if my puzzle game is always possible?

I've made a sort of a puzzle game where the goal is to get rid of all of the white tiles. You can try it at the end of the question. Each time, the board is randomly generated with white tiles in ...
2
votes
1answer
158 views

whats the difference between the two switches in rpg maker mv?

I dont understand what the difference between the top and bottom set of switches in rpg maker mv, can someone please explain.
-3
votes
2answers
231 views

Would an unbeatable opponent ethical for a game?

Would it be unethical to create an A.I. bot that has full advantage of ALL of the game mechanics? Would it be better if it was optional and gave full disclosure before it let you face this opponent?
3
votes
2answers
143 views

Collison detection trouble. (c++ SDL2)

I have a small trouble with my collsion detection system, ill show it on images. im checking the detection by using that logic with example when moving to the right: ...
1
vote
1answer
703 views

Game logic in mvc: model or controller?

Sorry if the title is too broad, I'll try to explain this in a more specific way down here. We need to create a board-game in Java for an University project and we have to use the mvc pattern for it. ...
2
votes
1answer
129 views

Logic only GUI library

I'm not sure whether this place is the correct for asking this. If it's the wrong place I'm sorry, please tell me if so! I'm making a small game for fun which would uses an own engine with OpenGL and ...
0
votes
1answer
449 views

Unity 5.5 - Modify image of a button from an array of images via script - Logic Help

Right now i have this: Is a placeholder for what i want to do. This blue circles are images in different buttons, i have a blue image circle for every letter. I have to display the correct letter ...
2
votes
1answer
151 views

3d puzzle game generating levels

I want to create a puzzle game for my first year in college. I will use OpeGL and C++. The point of the game is to create a path between squares that have the same color, without making the paths ...
3
votes
3answers
211 views

Best way to store map?

I am trying to make a simple game that simulates ants inside a colony, in the Java language. They can move around the paths randomly, go outside to eat leaves, etc. The game is meant to be more of an ...
1
vote
1answer
76 views

C++: Strange arithmetic error in adjacent tile checking code

I have a tilesheet from which I draw wall tiles. Each wall tile on the sheet is enumerated from XXXX to ULRD, where each place corresponds to whether there is an adjacent wall above, to the left, to ...
0
votes
1answer
113 views

Unity3D, How do I press one key and then cant press another key while the one is pressed?

I am making a horror game, and I want to press a key to look up while I am idle, that i've done but if I press the W key it stands in idle but floating forward. How can I disable the W key while I ...
2
votes
2answers
189 views

Moving a continue condition into the for loop produced something NOT logically equivalent?

I'm setting up a hex grid. The column/row system I use puts 0, 0 as the top left corner, and increasing columns (x) moves to the right but also vertically upwards. So columns run straight up and down, ...
1
vote
1answer
766 views

Why is the code in this if statement being run when the condition for it is not met?

I have a feeling I'm overlooking something stupid here... By default all of my enemy objects start without a target assigned to them. As in - "target = noone;" However, despite target being ...
8
votes
5answers
576 views

Choose your own adventure - choices stack

I'm currently building a choose your own adventure game. Now it's easy enough to have one outcome to every choice and create a linear flow, but is there a good algorithm for having all previous ...
1
vote
2answers
191 views

C++ MMO: Best approach to store creatures in a multi-level world map for the purpose to find spectators

I'm developing a game which is a multi-level game, my game can have a maximum of 15 floors, and a fixed amount of tiles width/height. Each tile in the map can have a creature. All fine until here; I ...
-1
votes
1answer
753 views

How to make game like Gals Panic [closed]

Any one have a idea how to build game like Gals Panic. I want to know the basic idea how can i start building the game. Note : im a flash game developer.So anything related to flash would be helpful. ...
3
votes
0answers
75 views

How are Spot It cards generated?

Spot It is a card game 55 cards. Each card has exactly 8 symbols on it (though the total number of different symbols used in the 55 card set is 57). For any two cards in the deck, they share exactly ...
4
votes
1answer
107 views

Optimizing black and white matrix block drawing

Disclaimer: I am uncertain if this is the best place to post this question, so please advise me of how I can best find the answer if I am doing something wrong. I am asking this question because I am ...
0
votes
1answer
187 views

How to move 2D objects based on mouse movement with pointer locking?

I'm using pointer locking for a 2D game (where you perform calculations based on the delta in mouse positions from frame to frame). I'm having some basic math/logic issues with accomplishing what I ...
1
vote
1answer
95 views

Programatically placing musical notes on a stave

I'm trying to program a musical stave and have come against the problem of where to place a note, given its index. The index of a note is defined from a model created from the table in the following: ...
2
votes
1answer
113 views

Resolving A counters B, who is countered by C, who could be… in an ATB

There are 4 player character slots and 8 enemy slots. I'm using a combat system that's similar to ATB from FF4; You select a move, there's a waiting period depending upon the move, during which other ...
5
votes
1answer
719 views

Creating a Roguelike game in C

I'm trying to create a simple rogue-like game in ncurses in a C program. The idea here is that, I'd parse a file like this: ...
4
votes
2answers
254 views

Restricting Maximum Velocity in Space

I'm making a top-down 2D space ship game in which you rotate and thrust. I'd like to impose a maximum velocity for different engine types, meaning that a certain engine can only get you going up to a ...
0
votes
1answer
46 views

Portal 2 Authoring Tools: func_instance_io_proxy not working?

I have a func_instance (which I made myself) of a door in my map. It is supposed to open when a cube is fizzled. I also put a checkmark indicator to make sure I had the cube's logic correct. When the ...
7
votes
1answer
273 views

How to execute game logic every 100ms but render as fast as possible?

I have created a simple snake clone and would like to execute game logic every 100ms while rendering as fast as possible. How can I achieve this when the program might run with very different frame ...
-1
votes
1answer
100 views

Manager Game Logic [closed]

I'm currently trying to figure out a way where I can achieve the following; Pre-Calculate the game - This will predetermine any event / interaction between the players. Simulate the calculation - ...
3
votes
1answer
83 views

How to decide the direction of movement, when navigating a fixed path in a 2d overworld?

Suppose, I have a 2D overworld like in Super Mario Brothers 3, but without junctions or intermediate nodes. Only a single, contiguous path of level nodes, which should be navigated with the arrow keys....
3
votes
2answers
1k views

How to handle angles in an isometric game?

I am working on my first isometric game, and I am not sure how to go about angles and rotation. Basically, I want the player's forward movement and rotation to coincide with the isometric angles. I ...
2
votes
1answer
214 views

Looking for good comunication schema in turn-based game with multiple players

based coop game that will need to communicate to the server to handle the game process. Basically I need to be able to invite to the game, progress through turns (one player at a time) and finish in ...
3
votes
2answers
321 views

How to compare different states of my game? (rpg)

I'm working on a rpg, the battle system. I want to compare different scenario with each other. For example, what if I play move A then move B ? or two times move A ? or ...? I'm using a tree-...
5
votes
3answers
709 views

How to test for adjacency?

I need to come up with a better way to test for adjacency in a grid environment. Imagine that the blue is water, the green is land, and the red dot is a character. What I need to do is efficiently ...
0
votes
1answer
69 views

Card/Tile Game, loops dont update element0 of playerHand properly

The Problem I am dealing from another class and into a player's Tray(A class with a List of Tiles and an array of bools to show that a slot in the tray is full). When dealing into the player's tray, ...
1
vote
2answers
726 views

Daily quest system

I am creating a game for Android/iOS. The game has a server that communicates with my appengine database. I want to implement daily quests as motivation for the players to return every day, but I need ...
0
votes
1answer
53 views

Logical Dependencie Problem [closed]

I am working with Unity and C#, but my Problem is a more general programming problem. I am trying to keep things easy, but still make them global access able and easy to modify. So I have a ...
2
votes
1answer
347 views

Kart Racing Attack AI

I am developing a kart racing game. In it, the players fight with each other while racing. There were several ways I tried to add attack AI to the enemies and the player. When the user clicks on ...
11
votes
3answers
5k views

UPS and FPS - What should I limit and why?

I'm currently writing a game using C++ and SDL2 and there's one thing that I'm wondering about - does it make sense to limit my frames per second (FPS) and/or my updates per second (UPS)? I get the ...
0
votes
1answer
123 views

Can someone explain to me the difference between 2 XNA methods?

I was recently trying to make a boucing ball off the environment walls. I apparently had everything correct, except for one thing, that I corrected stupidly, which made my code work, but I don't ...
0
votes
1answer
1k views

Organizing a Transform class to internally use quaternions

So, I'm interested in building a Transform class similar to the one used in Unity Engine, but in C++. My intent is for it to be user-friendly to change the position, rotation, and scale of a variable ...
0
votes
0answers
285 views

How can I make several 2D objects move in complex pre-defined patterns?

I will be making my mobile 2D game in Unity and the objects in the game will have complicated movement. For example, there will be lots of squares (around 10-15 tiny squares) in the middle of the ...
1
vote
3answers
644 views

Should cooldown be time or tick based?

In the past I've done cooldowns as a specific time in ms, but I was thinking isn't having tick based cooldowns better. This would be more accurate and efficent(not sure). The bad side I can think ...
0
votes
1answer
868 views

How to check a value from the last frame, while using events in Unity

What I am trying to do is check if a value has changed from the last frame, while using events. Typically I could use threading to my advantage and have a check at the bottom of Update() to see if a ...
2
votes
2answers
275 views

Where does game logic belong? [closed]

I've always had a hard time wrapping my head around the 'high levels' of game logic and where/how large components, such as collision detection/physics, rendering, and user input, interact with one ...