Game Engine Help

Hello, I wonder if you can help...

I am developing a small game but not quite sure how to implement the game engine. The engine, so far, consists of a 'game loop' -- each iteration through this loop represents one frame. This loop will poll any input and process this before rendering the generated frame to the screen. However, when the user clicks on certain sprites no input should be polled allowing the sprites animation to complete. My question is how to implement this... Is it usual to have the following code for example, or is there another technique involved?

/**

* This method is called once for every iteration through

* game loop and will poll any input and act accordingly.

*/

publicvoid update(){

if (GAME_STATE == PROCESSING){// Continue to animating (no polling).

generateNextFrameInAnimation();

}else{// We are in a state ready to accept user input.

pollMouse();

if (mouseDown){

doSomething();

}

}

}

So can you give me any advice or point me in the right direction?

Thank you in advance.

[1617 byte] By [marek.j] at [2007-9-30 4:44:56]
# 1
I think you should just continue polling in the game loop as usual, and the function that processes the input should know how to handle the PROCESSING state.shmoove
shmoove at 2007-7-1 14:41:28 > top of Java-index,Other Topics,Java Game Development...