Skip to main content

Questions tagged [game-loop]

The central code loop responsible for handling the running gameplay. At its most basic state, it accepts input, resolves the actions of entities, and renders the scene.

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

Moving object with preset timelapse

I am a newbie game developer. I have one problem. Consider the following case. I have a simple game with only one object - a ball. A ball can move only up and down from one side to another. A User ...
solderingiron's user avatar
0 votes
1 answer
482 views

How can I make the Player animation appear smooth?

I'm using GLFW for my window and input related work. I'm calculating delta time and multiplying it with my player speed and then finally adding it to the current position of the player. The thing is ...
Jitendra Tiwari's user avatar
0 votes
1 answer
714 views

Function call time

I'm making a game and I want an update method to be called every 120th of a second. I've looked up timers but they start the timer after the function has returned, but I want the timer to start when ...
William Thompson's user avatar
0 votes
2 answers
347 views

Do I still need limit FPS when I have a variable timestep?

Lets say I have a simple game loop (variable timestep - but it applies also for other timesteps): ...
Pins's user avatar
  • 569
0 votes
1 answer
892 views

Where do I handle my input in a basic game loop?

I recently had the occasion to work on a game, during a game jam at my college, and it really got me into it, so I've decided to start something more polished with a friend of mine. During the game ...
aslad's user avatar
  • 3
0 votes
1 answer
377 views

Turn Based Game- Determining turns

I am developing a Checkers game and need to implement players' turn, particularly after "Capturing". Changing turns after single steps work properly but not correctly after capturing. In the drag ...
Aaron99's user avatar
  • 11
0 votes
1 answer
343 views

Reference sf::RenderWindow from another source file in SFML

In SFML, How would you be able to reference a window in your main.cpp file to another source file? I want to be able to reference the window made in ...
Gman0064's user avatar
0 votes
1 answer
400 views

Unity 2D: Change one instanced prefab then make all the others on the scene like it

I want to get this thing working: I have a prefab with coins, some obstacles and enemies, and i want it to be instantiated each time the player got to the right or left on the stage, to make the stage ...
assisrMatheus's user avatar
0 votes
1 answer
140 views

What is the better way to speed up gameplay as the level rises?

I started with game programming couple of weeks back. For the starters I tried to develop ZigZag (link takes you to 2 min gameplay). I am done with the logic of gameplay by now. It runs well and ...
Ravi Ojha's user avatar
  • 103
0 votes
0 answers
548 views

Cocos2d pause game freezes the screen

I am trying to create pause screen for my game. The game is developed upon continuous scrolling background (top to bottom) with obstacles which are moving independently (left to right). Below is the ...
Paresh Thakor's user avatar
0 votes
1 answer
397 views

Can someone provide a practical example of decoupling game world updates from frame redraws in iOS?

Please bear with me as I've been spending some time lately trying to get a better grasp of some game dev fundamentals. My specific issue is a direct result of trying to apply what I've read about here:...
Manny's user avatar
  • 101
0 votes
1 answer
472 views

Trying to understand the XNA fixed time step game loop logic

I came across the blog post Understanding GameTime, and after lots of reading on fixed time steps in game loops this is the approach I would like to take. In summary, this is the logic from the post: ...
user avatar
0 votes
1 answer
483 views

How does this game loop actually work?

I read this playfulJS post, about ray-casting: http://www.playfuljs.com/a-first-person-engine-in-265-lines/ It looks really interested, so I decided to look at his javascript. I am no expert in ...
Nicolai's user avatar
  • 103
0 votes
0 answers
410 views

Limiting Rendering in my game loop (Not Game Updates)

My Gameloop (code below), limits the game updates to 60 ticks per second. However, it renders as fast as the device on which it is being run can handle. I'm using a fixed time step in my game and I ...
BungleBonce's user avatar
  • 1,927
0 votes
1 answer
2k views

Removing drawn Allegro texts and primitives

I'm working on a game with Allegro 5 that has a loop. I'd like to make the program write onto the screen, how much time the loop has ended. These are the rounds of a turn-based game, obviously. I use ...
Zoltán Schmidt's user avatar
0 votes
0 answers
214 views

Free glut game loop [duplicate]

I'm trying to make a game with freeglut, but im still learning it and I don't fully understand what the looping does or whether I have to call it myself, I've already read this article A good way to ...
Jim Jones's user avatar
  • 153
0 votes
1 answer
893 views

Is this paint method okay?

I dont know why i need to call super.paintComponent() and super.repaint() to make the player's movements update, if i just put paintComponent the game seems like to always be stopped. However I think ...
Smuk's user avatar
  • 9
-1 votes
1 answer
428 views

Server fixed timestep not running at 30Hz but way way too fast [closed]

I'm trying to make my game's server thread run at a fixed 30Hz but can't figure out how. Basically, before I just had a stupid while(1) { //do everything as fast as you can} which means that for my ...
user148459's user avatar
-1 votes
1 answer
213 views

2D Game Help In XNA

I'm making a game in XNA called The Adventure Of The Very Hairy Princess Fairy. The game is a "Sidescroller/Platformer" like mario but there is a problem. How do I attach a weapon to the player ...
user22715's user avatar
-1 votes
1 answer
382 views

Java game loop delta not working

Hello I have game loop where I can change framerate. But when I change framerate to other, delta time not working fine. For example when framerate is lower everything is faster. Here is game loop: <...
Suak's user avatar
  • 21
-1 votes
1 answer
211 views

How to increase player Lifes count

I am new in Unity Game Development. I am designing infinite game using C# scripting. There are many cubes in my game scene. if single cube is hit by player, He gets 100 points. if same color, two ...
user avatar
-1 votes
1 answer
531 views

Get distance between the edge of screen and a moving sprite

How to get the distance between the edge of the screen and a vector moving sprite? I want to get the distance between my moving sprite and the edge of the screen so that when my sprite touches the ...
hey's user avatar
  • 11
-1 votes
1 answer
219 views

Is my frame rate being calculated correctly?

I'm having a long headache (which may not be that complicated) with this frame rate thing. I already tested several frame rate algorithms, lastly I tested this here and they all gave something strange ...
Dormin's user avatar
  • 34
-1 votes
3 answers
1k views

A method to create and assign a name to a GameObject (Unity)

I'm trying to create a function that takes in a name of an object in the editor and assigns this accordingly as well as the name of a sprite, rigidbody, etc. Basically what I have so far is- ...
novasniff's user avatar
-1 votes
1 answer
599 views

why are there draw rate and update rate in fixed time step game loop?

http://www.gameprogblog.com/generic-game-loop/ Java ...
user734861's user avatar
-1 votes
1 answer
951 views

simple win32 window wont show [closed]

The program compiles and runs successfully but does not show a window, it simply ends immediately. ...
MomentumGaming's user avatar
-1 votes
1 answer
752 views

Drawing multiple sprites with clear screen for every frame

I googled with best of my skills, but I cannot find any relevant answer to my problem. I'm making a game with an isometric view. I need to draw multiple sprites on the screen and before switching to ...
dineshswamyp's user avatar
-2 votes
1 answer
252 views

Issues with networking in my Java game, Client crashes when I try and read from the server input

A buddy and I have been programming a code game over the last 2 weeks, it is intended to be a multiplayer game with the ability to have 2 players play against each other. I am running into an issue ...
Latency's user avatar
  • 350
-2 votes
1 answer
306 views

Why is my delta time constantly under 1 millisecond?

I have a game loop that looks like this: while (Sync()) { DoStuff(); } The sync function computes my delta time like this: ...
Captain Picard's user avatar
-2 votes
1 answer
1k views

How to add difficulty levels to a Guess The Number game using rand()? [closed]

User guesses a random number (between 1 and 100 or 5000 and 25,000 depending on difficulty) that the computer picks. User selects difficulty from list, difficulty (1, 2, 3, 4) is assigned to ...
FyrePlanet's user avatar
-2 votes
1 answer
460 views

how to restart in java japplet? [closed]

how to restart a game? problem with my code is that when it restarts it double the enemy. so there are 10 enemies and lets say player dies than user restart and now there are 20 enemies and so on..... ...
catpills's user avatar
-2 votes
1 answer
462 views

Options available to a programmer on the Main Game Loop [closed]

Could someone please give me some insight into each one of the four topics listed below. I have a good idea about what passive and active rendering are, and that the use of active rendering is more ...
Sean's user avatar
  • 11
-3 votes
1 answer
3k views

What can be the cause of sudden lag spikes in my Android game?

My Android game has sudden lag spikes sometimes. I know this is due to something going wrong. My phone has a 1GHz processor so there shouldn't be a problem. Basically I use the ...
chrypthic's user avatar
  • 111
-7 votes
1 answer
375 views

Generic Class Name for RTS [closed]

Hopefully this will be a nice easy question :- I am building an RTS as a way of learning OOP techniques. Currently the code has the following classes ...
Graham's user avatar
  • 101

1
6 7 8 9
10