Questions tagged [logic]

The tag has no usage guidance.

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

Moving Multiple Objects With Vector2.MoveTowards Not Consistent

Good Afternoon, I'm trying to move three objects from their current position to a shared target position based on speed. Once they reach the target position, they move to a shared respawn location and ...
PayasoPrince's user avatar
1 vote
1 answer
124 views

How to implement NPC that reads player input and counters it?

input reading = NPC reads the input of the player and instantly reacts to counter everything the player does. So, is it like : ...
Cei's user avatar
  • 863
1 vote
0 answers
241 views

grid(tetris) inventory system

I'm trying to adapt my current inventory so that the items can occupy more than one slots (cells) like in this image: Any idea that might help me? My inventory is an Image that has grid layout and ...
Jamelaumn's user avatar
1 vote
0 answers
33 views

Polling Behaviors with Geometry Based Collision System

This one's going to be interesting to explain. Let's say I'm making a geometry based collision system for a platformer, where polygons exist based on the lines that form them. I'm using some basic ...
GabbyCube's user avatar
0 votes
1 answer
111 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 ...
Maurice's user avatar
1 vote
2 answers
1k 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 ...
stupidbutseeking's user avatar
1 vote
1 answer
48 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, ...
GarrickW's user avatar
  • 330
0 votes
0 answers
126 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 ...
Sayaman's user avatar
  • 200
0 votes
1 answer
71 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 ...
Gayatri Rout's user avatar
1 vote
1 answer
112 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 ...
Robert's user avatar
  • 13
0 votes
0 answers
71 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. ...
Dinter's user avatar
  • 1
0 votes
1 answer
351 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:...
user2578216's user avatar
1 vote
1 answer
109 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
247 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 ...
Sarah's user avatar
  • 59
1 vote
1 answer
96 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 ...
JackDaw's user avatar
  • 11
0 votes
2 answers
135 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 ...
Zoe's user avatar
  • 1
0 votes
1 answer
121 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 ...
Tyler C's user avatar
  • 113
0 votes
0 answers
55 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 ...
Yedidya kfir's user avatar
3 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 ...
Alejandro's user avatar
-1 votes
1 answer
370 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, ...
Macky ben Jonah's user avatar
2 votes
1 answer
168 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 ...
pava'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 ...
Qwerty's user avatar
  • 743
3 votes
2 answers
193 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: ...
terrio no's 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. ...
EsotericVoid's user avatar
2 votes
1 answer
175 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 ...
realvictorprm's user avatar
0 votes
1 answer
715 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 ...
NachoMiguel's user avatar
2 votes
1 answer
233 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 ...
robertooverflow97's user avatar
2 votes
3 answers
339 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 ...
Quinton Ships's user avatar
1 vote
1 answer
93 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 ...
Itolet's user avatar
  • 135
0 votes
1 answer
427 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 ...
NewmakerCompany's user avatar
2 votes
2 answers
202 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, ...
DrZ214's user avatar
  • 338
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 ...
Kol's user avatar
  • 19
8 votes
5 answers
849 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 ...
TommyBs's user avatar
  • 417
1 vote
2 answers
239 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 ...
Raúl Sanpedro's 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. ...
moin khan's user avatar
4 votes
1 answer
130 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 ...
MrNoise's user avatar
  • 73
0 votes
1 answer
229 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 ...
Mythics Winter's user avatar
1 vote
1 answer
117 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: ...
koolbanana's user avatar
2 votes
1 answer
126 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 ...
Nogusielkt's 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: ...
TTEd's user avatar
  • 159
4 votes
2 answers
545 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 ...
Hammer Bro.'s user avatar
0 votes
1 answer
82 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 ...
Code Cube's user avatar
  • 130
7 votes
1 answer
349 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 ...
ooxi's user avatar
  • 224
-1 votes
1 answer
119 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 - ...
Daniel's user avatar
  • 21
3 votes
1 answer
106 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....
QBrute's user avatar
  • 132
3 votes
2 answers
2k 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 ...
Stouty's user avatar
  • 33
3 votes
1 answer
316 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 ...
serge's user avatar
  • 207
3 votes
2 answers
377 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-...
mydi's 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 ...
GeoJohn's user avatar
  • 339
0 votes
1 answer
83 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, ...
user14687's user avatar