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)

3
votes
1answer
221 views

iPhone 3GS - can't ever seem to hold 60fps with CADisplayLink

So I've switched from NSTimer to CADisplayLink and I'm still seeing unexpected variation in my frame counter - it fluctuates between 59-60fps, even when I'm not rendering much. Has anyone else seen ...
20
votes
2answers
13k views

A good way to build a game loop in OpenGL

I'm currently beginning to learn OpenGL at school, and I've started making a simple game the other day (on my own, not for school). I'm using freeglut, and am building it in C, so for my game loop I ...
1
vote
1answer
593 views

Tetris Movement - Implementation

I'm developing a Tetris clone and working on the input at the moment. When I was prototyping, movement was triggered by releasing a directional key. However, in most Tetris games I've played the ...
16
votes
5answers
970 views

Game actions that take multiple frames to complete

I've never really done much game programming before, pretty straightforward question. Imagine I'm building a Tetris game, with the main loop looking something like this. for every frame handle ...
12
votes
2answers
2k views

“Optimal” game loop for 2D side-scroller

Is it possible to describe an "optimal" (in terms of performance) layout for a 2D side-scroller's game loop? In this context the "game loop" takes user input, updates the states of game objects and ...
3
votes
2answers
477 views

WinAPI window taking 50% of CPU when idle

I'm currently working on a game that creates a window using WindowsAPI. However, at the moment the process is taking up 50% of my CPU. All I am doing is creating the window and looping using the ...
3
votes
2answers
653 views

Designing the Update system (read very basic game engine) for an XNA game

I am trying to determine the best way to implement the "update" system or engine for a simple XNA game. Description of situation I have a few classes, lets call them Player [will be an ...
5
votes
2answers
3k views

How should I structure my menu / game loop?

I'm trying to decide on how to structure my main game loop - every example I've seen of the game loop looks a bit like this: while (true) { UpdateGame(); DrawGame(); } i.e. it ignores the ...
3
votes
1answer
2k views

Handling game states for Android

Currently developing a game for Android. I went through a tutorial to get sprites, loop, etc. up and running, and it all works fine. The way it is currently set up is that Main creates a canvas, the ...
4
votes
3answers
976 views

Deal with mini states in game

Hi :) I want to ask what is the best way to deal with "mini-states" in game? For example I making game like Simcity, i can build buildings, roads, rails, or I can change something in economy. I am ...