Questions tagged [logic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
44 views

Pygame Traffic signal logic

I am currently working on a traffic simulator with Pygame, however i am struggling with implementing the logic of the traffic signals. Any help is welcome. My traffic simulation is grid based. The ...
user avatar
1 vote
2 answers
422 views

Reorientation when rotating Transforms around another Transform without parenting

The functionality I am trying to implement, consists of rotating one Transform and appling this rotation to other relevant Transforms in the scene. To make it a bit more clear: I have several objects ...
user avatar
1 vote
1 answer
46 views

Translating conditions ("If A has B, then true") into objects that satisfy them ("A has B")

I have a system where I'm sifting through a large number and variety of objects in my game, looking for objects that match an arbitrary search criteria that can be simple or complex. For example, ...
user avatar
  • 330
0 votes
0 answers
56 views

Texas hold'em game logic loop

Ok, so I was thinking of making a Texas Hold'em game, and I wanted to write down the game logic loop before starting. Here's what I have. Tell me if I missed anything or if anything is wrong. Game ...
user avatar
  • 1
0 votes
1 answer
61 views

How to disable pause() in game_loop() once game_over() function is called?

How can I disable pause() in game_loop() once game_over() function is called? game loop ...
user avatar
1 vote
1 answer
85 views

How to correctly solve a procedurally generated puzzle?

I'm creating a puzzle game where the player must remove all colored blocks from a grid. When the player selects a block, all adjacent blocks of the same color are removed. Any blocks that have empty ...
user avatar
  • 13
0 votes
0 answers
42 views

AI for 1v1 snake

I've got a task for job application to create a snake AI that can defeat their basic AI. Searching in this topic I've found that it's very similar to Tron and it's solved mostly by minimax algorithm. ...
user avatar
  • 1
0 votes
1 answer
201 views

Multiplayer network architecture - why do we need to verify local movements?

I'm messing around with a 2D game using UDP. I've read some books and articles on the logic of a dedicated server to clients multiplayer game and I can't wrap my head around one thing: What I've read:...
user avatar
1 vote
1 answer
86 views

How do I initialise levels sequentially?

I have been learning opengl and I have made good progress over past few months. However I still struggle to understand game logic in C++, I am new to C++ too. Say I have this program. ...
user avatar
1 vote
1 answer
186 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 ...
user avatar
  • 59
1 vote
1 answer
88 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 ...
user avatar
  • 11
0 votes
2 answers
92 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 ...
user avatar
  • 1
0 votes
1 answer
76 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 ...
user avatar
  • 113
0 votes
0 answers
51 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 ...
user avatar
2 votes
1 answer
2k 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 ...
user avatar
-1 votes
1 answer
246 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, ...
user avatar
2 votes
1 answer
144 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 ...
user avatar
  • 21
69 votes
6 answers
17k 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 ...
user avatar
  • 743
3 votes
2 answers
174 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: ...
user avatar
1 vote
1 answer
1k 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. ...
user avatar
2 votes
1 answer
160 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 ...
user avatar
0 votes
1 answer
686 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 ...
user avatar
2 votes
1 answer
195 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 ...
user avatar
2 votes
3 answers
283 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 ...
user avatar
1 vote
1 answer
85 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 ...
user avatar
  • 135
0 votes
1 answer
312 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 ...
user avatar
2 votes
2 answers
198 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, ...
user avatar
  • 308
1 vote
1 answer
1k 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 ...
user avatar
  • 19
8 votes
5 answers
777 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 ...
user avatar
  • 407
1 vote
2 answers
223 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 ...
user avatar
-1 votes
1 answer
2k 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. ...
user avatar
4 votes
1 answer
119 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 ...
user avatar
  • 63
0 votes
1 answer
222 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 ...
user avatar
1 vote
1 answer
113 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: ...
user avatar
2 votes
1 answer
121 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 ...
user avatar
5 votes
1 answer
1k 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: ...
user avatar
  • 159
4 votes
2 answers
432 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 ...
user avatar
0 votes
1 answer
67 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 ...
user avatar
  • 130
7 votes
1 answer
312 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 ...
user avatar
  • 224
-1 votes
1 answer
113 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 - ...
user avatar
  • 21
3 votes
1 answer
97 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....
user avatar
  • 132
3 votes
2 answers
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 ...
user avatar
  • 33
2 votes
1 answer
293 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 ...
user avatar
  • 197
3 votes
2 answers
364 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-...
user avatar
  • 51
5 votes
3 answers
1k 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 ...
user avatar
  • 319
0 votes
1 answer
75 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, ...
user avatar
1 vote
2 answers
957 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 ...
user avatar
  • 1,863
0 votes
1 answer
54 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 ...
user avatar
  • 3
2 votes
1 answer
410 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 ...
user avatar
  • 530
11 votes
3 answers
6k 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 ...
user avatar
  • 113