Archived

This topic is now archived and is closed to further replies.

Multi-Input

This topic is 5117 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m a new programmer and am trying to figure out how to get input from one player while the other player''s move animation is still incomplete. I am making a multiplayer one screen game. a fighting game. I want to know how it is possible to get more than one input on the screen at once. how to get the computer to be able to move either player in real time. PS.I''m using visual C++ 6.0, directx9.0 Thanks

Share this post


Link to post
Share on other sites
It's all in your main loop for your game. Basically it should look like this:

int MainLoop()
{
while(stillRunning)
{
/* some code here */

UpdatePlayerInput();
UpdatePlayerAnimations();

/* some more code here */
}
}


In UpdatePlayerInput() you would check to see if there's any input that you need to take care of. In UpdatePlayerAnimations() you would check to see if there are any player animations that are incomplete, and if so update them.

[edited by - porthios on December 14, 2003 8:11:31 PM]

Share this post


Link to post
Share on other sites
Thanks. But what if you need to update both players at the same time. how can you have two animations at the smae time. but not in sync, real time movement.

thanks again

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Instead of having a single function call run through the whole animation, your animation function should advance a frame or a certain amount of time. That way the function takes a very short time and returns, so you can show the next frame of the second player''s animation.

Then, just like porthios said, constantly check for input and update the animations in the main game loop.

Share this post


Link to post
Share on other sites
So basically thew secret is to actually make it turn based, but so fast that the player won''t notice? got it. I think? is there another way to do this? one where it actually renders 2 functions at once? how do the professionals do this?

thanks

Share this post


Link to post
Share on other sites