Skip to main content

Questions tagged [logic]

Filter by
Sorted by
Tagged with
1 vote
2 answers
153 views

Recently I decided to start optimizing code in the game development field. I found this pacman project on github a good starting point: https://github.com/LucaFeggi/PacMan_SDL/tree/main I found a lot ...
X Y's user avatar
  • 111
0 votes
1 answer
180 views

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
239 views

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
  • 873
1 vote
0 answers
801 views

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
38 views

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
170 views

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

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
95 views

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
260 views

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
0 votes
1 answer
107 views

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
168 views

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
108 views

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
479 views

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
155 views

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
339 views

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
129 views

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
189 views

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
197 views

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
61 views

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
3k views

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
478 views

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
219 views

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
66 votes
6 answers
18k views

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
  • 723
3 votes
2 answers
230 views

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
2k views

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
248 views

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
755 views

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
273 views

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
452 views

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
113 views

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
470 views

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
239 views

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
  • 348
1 vote
1 answer
2k views

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
9 votes
5 answers
1k views

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
  • 427
1 vote
2 answers
297 views

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
3k views

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
179 views

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
259 views

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
143 views

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
157 views

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

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
665 views

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
105 views

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
388 views

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
134 views

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
141 views

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

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
369 views

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
  • 227
3 votes
2 answers
438 views

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

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