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.

learn more… | top users | synonyms (1)

1
vote
0answers
58 views

How Many Particles at a Time?

How many particles should a particle system be able to process in a single step/game loop? I designed a system and it can run up to 5000 particles with my 2GB RAM PC (I only run the particle system ...
-1
votes
0answers
17 views

deterministic game loop with fixed and variable rendering

reading this article I worked out a game loop that has deterministic time steps but I am having some trouble finishing up the renderer to use interpolated data. article: ...
2
votes
1answer
66 views

A deterministic game loop

I want to make a game loop that is deterministic sort of like a physics engine but it's for game update and rendering. I've done a lot of reading and I still was a bit confused. I've read these ...
0
votes
2answers
55 views

How to create a Update function in Java

I have recently started using Java, but have been programming in javascript, and actionscript 3 for a while. I am used to the language giving me the ability to simply do something like: private ...
8
votes
3answers
783 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 ...
1
vote
1answer
55 views

In the game loop, apply dt before the loop starts, or after it finishes?

Say I have a Game class with an update loop that receives a time increment dt by parameter. I was wondering if it's better or customary to apply this dt before the loop starts or after the loop ...
3
votes
1answer
74 views

Endless Running Game - Changing Lane Function in JAVA

I am developing a kind of vertical endless running game, where the character has 4 possible lanes to be in. I am using libGDX and want the character to change lanes by adding a horizontal velocity to ...
16
votes
2answers
3k views

Why does my sprite player move faster when I move the mouse?

I'm trying to develop a simple game made with Pygame (Python library). I have a sprite object which's the player and I move it using arrow keys. If I don't move the mouse, the sprite moves normally, ...
0
votes
1answer
60 views

is this approach correct to make my game framerate indipendent in javascript?

this is what i did my game loop is run every REFRESH milliseconds loop = setInterval(tick,REFRESH); in the loop i calculate how much time is passed since last tick and subdivide that for how much ...
1
vote
2answers
101 views

Questions About Game Loops

I've been reading up how to lay out a game loop that'll work optimally in both great and not so great conditions but I think I've confused a few techniques together... so I have some questions... ...
3
votes
1answer
161 views

Should UI be part of the game-loop?

I can't really find a good answer to this anywhere, I have never worked on games in a proffessional environment and I am wondering; Do these games render their UI in the main game-loop? That is, do ...
0
votes
1answer
49 views

Smooth animation using delta times - big delays ocurring … [closed]

I'm writing a game on Android using OpenGL ES 2.0 for fun. I'm developing on Samsung Galaxy Note 3. I want to try to master smooth animation, i.e. correct frame transition and movement. I am focusing ...
0
votes
1answer
85 views

How to use multiplication operation in game render delta time?

We are using delta time like this: private static final float SPEED = 200f; // Moving pixels in one second @Override public void render(float delta) { myObject.vx += SPEED * delta; ...
11
votes
2answers
1k views

Pausing the game inside the game loop

Inside the game loop, the game is paused by pressing P, meaning that the game loop does not run anymore. Problem is that after this loop is halted, P cannot be pressed again to resume the loop, since ...
1
vote
1answer
190 views

Simple Tanks game - Client-Server communication approach doubts [closed]

I want to create simple a multiplayer 2D game with tanks ( cooperative ) in C# with .NET. I also want to keep it simple, because it is only a semester project, and unfortunately i don't have time to ...
1
vote
2answers
122 views

Movement in gameloop

I wonder what the best way is to move the player. Is it best to always check for movement like I do in the first example of is it better to only access the movement function via the input function ...
0
votes
1answer
120 views

How BufferStrategy works

I've used this piece of code a lot in my games, but I still don't know exactly how it works. // Main loop while (!done) { // Prepare for rendering the next frame // ... // Render ...
0
votes
1answer
93 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 ...
1
vote
3answers
115 views

render/draw or input first?

When creating the main game loop, what order should things generally happen? IE, should i be getting input, doing logic and then rendering, or something else? does this even matter? when i was coding ...
0
votes
0answers
43 views

Directx 9 Obj Model

There's is a error with my obj load/render that I can't solve I'm a newbie in directx 9, I'm trying to do this in the best way The model is not displayed properly, do not know if this correct model ...
1
vote
1answer
105 views

How do I implement a fixed delta time step with a SDL_Delay(15ms) precision

So I am using SDL2.0 for making a Game Engine. Where I am having a problem is using SDL_Delay(). SDL_Delay's minimum delay time is 15ms, I've tried everything, and my FPS is Stuck at 64 because of ...
0
votes
1answer
56 views

What type of loop code on game engines? [duplicate]

Recently I worked on a game on Spritekit Engine. My question is not about spritekit, but generaly about game engines. When I write a loop code and run it (eg while i< 100000) my CPU usage goes to ...
2
votes
1answer
70 views

What is the relationship between FPS and a game loop?

What is the relationship between FPS - Frames Per Second and a game loop? I'm confused how my book is using theses terms.
0
votes
1answer
74 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 ...
0
votes
0answers
52 views

Game loop not functioning correctly

I'm working on a game loop in C++ using OpenGL and GLFW and it works like expected (I think), except when I'm focused in the window the FPS drops to 1fps (or 1000ms per frame) but when I'm not focused ...
0
votes
1answer
86 views

Basic Monster Movement

I'm new to game development. Specifically server side. Currently I am trying to implement movement of monsters. From point A to point B. I have used an a* pathfinding library to calculate the path to ...
-1
votes
1answer
49 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: ...
0
votes
0answers
38 views

Game Loop Thread for different activities

First of all, sorry for my mistakes of language. I'm a noob of game programming in Android but I'm trying to make one using canvas and bitmaps. My game have two screens, the Title Menu and the Game ...
0
votes
0answers
138 views

Scrolling background loop however produces little gaps

I have myself a parallaxing background, i'm using SFML to render my background, I have myself 3 sf::Sprites, each sprite has the width of 576, I create myself 3 sprites with x positions 0, 576 and ...
0
votes
4answers
160 views

Designing a multi-level game

I want to know to code structure of a game that has different levels to choose from on the main screen. More precisely, I want to know how does the main loop hands off the rendering to another loop ...
0
votes
1answer
210 views

Multiplying by delta not giving smooth movement

I started working on my first proper game but reached a problem straight away. In short I have a game that runs most of the time at 60 fps. ( I am using Libgdx a popular Java framework) but my game ...
5
votes
4answers
340 views

How can I implement a real-time game loop in a text-based game?

I am trying to make a short text game with c++ to help me learn the language. I have made a version that basically displays texts, waits for an input, once the input is received it displays text, and ...
0
votes
0answers
147 views

Implementing a game loop with interpolation

I am trying to implement the Game Loop interpolated found in this website http://www.gameprogblog.com/generic-game-loop/. Here is my implementation: long frameRate = 50000000; int maxUpdates = 3; ...
0
votes
1answer
156 views

android game development: why is my screen black?

so, im strarting an android game from scratch, and every time I try i stumble uppon the same problem, my screen is not displaying what i want it to. I've read various tutorials but they are either ...
0
votes
0answers
152 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 ...
0
votes
2answers
128 views

Do I really need a render() method in the game loop if the view subscribes to the models?

For a game that I'm working on, we've followed the MVC paradigm. However, in classic MVC, the view subscribes to the model and when the model updates it informs the view. We've implemented this as an ...
0
votes
1answer
294 views

Android Game-Loop (rendering & logic removed, but still 'skipping frames')

Overview Guys really hopeing for some help here. My game loop is based on code from Fix Your Timestep!. I've read the article more than a few times, but I can't quite work out what exactly is ...
0
votes
1answer
206 views

Capping framerate independently of logic updates in single-threaded Android Gameloop

My game is currently using the below game loop (this is an OpenGL ES 2.0 game, therefore the loop-work takes place on the rendering thread in the provided onDrawFrame method). Currently my loop ...
1
vote
1answer
58 views

Checking whether moving object has reached target position

So I have a fast-moving object in my game, let's say a bullet. At each iteration of the main loop I update the object's position based on the delta time value dt and draw it at the new position. I ...
1
vote
1answer
97 views

Using GetTickCount (to shoot missiles) [closed]

I have some difficulties to understand how to correctly use GetTickCount() as I have some problems in my little game. I have to place on a case a space ship. This one will shoot with a certain ...
1
vote
1answer
131 views

Delta time not accurate enough

In my game i have a delta timer based almost exactly on the page from here http://wiki.lwjgl.org/index.php?title=LWJGL_Basics_4_%28Timing%29 But if the the main loop is fast enough, my delta time ...
0
votes
1answer
129 views

NodeJS setTimeOut - How to run callback before delay time exceeded

I'm developing a card game server. I want to do this : While server process a turn for players, players have 20 seconds to do something. If players send a request to server within 20 secs, timer will ...
-1
votes
1answer
74 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 ...
0
votes
1answer
150 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 ...
0
votes
3answers
180 views

how to handle interactive choice in the middle of the game loop?

I am programming a turn-based game, 2D tile-based, overhead view. I have an update function and a render function running in separate threads. When it's the player's turn, the player can e.g. ...
1
vote
2answers
218 views

Should FPS exceed ticks/second?

I was once told that you should never re-draw a frame if the game logic has not changed since the last draw. Assuming game logic is updated once every tick, and assuming a game runs at 40 FPS @ 20 ...
0
votes
1answer
66 views

Skipping a loop in foreach? [closed]

I'm trying to get Unity to filter through a list of nodes, but I am unsure on how to do so. This is what I have derived. foreach (TileNode z in map.nodes) { int num = TileNode z; ...
1
vote
1answer
124 views

Input processing performance

I'm building a game using SDL in Linux platform. Now I want to read user input with SDL_GetKeyboardState, but my doubt is wich is the best way using a thread or a timer. I tried both and I think ...
0
votes
2answers
183 views

How to detect collision between two directed object?

I'm currently writing a game which is like Battle City game. But right now I'm facing a trouble involved to checking collision between two objects. This is the code that I wrote: ...
0
votes
0answers
210 views

Need some guidance implementing event based game loop in JavaFX card game

i tried to make the title as much informative as possible. Anyhow, i'll try to be brief - I'm fairly new to java programming and programming altogether, after learning the basics and some advanced ...