Computer Science Canada If there a better way to make a fighting Game moves for characters besides a ton of processes? |
Author: | isaiahk9 [ Sun May 11, 2008 11:18 am ] |
Post subject: | If there a better way to make a fighting Game moves for characters besides a ton of processes? |
I am making a fighting game for Turing, and I have to make some moves for characters. The best way to do that (of what I can think of is to use a ton of processes. For example : There are two processes for the characters In those is the input key for the moves. Each move has its own process In a move process, there is a process for the animation, a process for the sound and a process for the effect on the enemy If I have to do that for every move, it will mean a . . . lot of processes. Does anyone know a better way? |
Author: | Saad [ Sun May 11, 2008 11:24 am ] | ||||
Post subject: | Re: If there a better way to make a fighting Game moves for characters besides a ton of processes? | ||||
Yes, there is a much better way. Basically what you want to do is put them all together into 1 main loop
For example
|
Author: | isaiahk9 [ Sun May 11, 2008 11:50 am ] |
Post subject: | RE:If there a better way to make a fighting Game moves for characters besides a ton of processes? |
Yeah, Saad that's what I'm doing right now with one character. So I need a process per each character, and then my main question was whether there was a better way to do moves (animation, sound, effect on enemy) than a ton of processes. |
Author: | Expirant [ Sun May 11, 2008 12:11 pm ] | ||
Post subject: | Re: If there a better way to make a fighting Game moves for characters besides a ton of processes? | ||
You should be doing what Saad has shown. To do it with multiple characters, you should have an array of the characters, and instead of just running the one character in that main loop, run the whole array. Here's an example with what Saad did:
So all animations should be done in this main loop. Sound is the only thing that should be done using a process. |
Author: | CodeMonkey2000 [ Sun May 11, 2008 12:19 pm ] |
Post subject: | RE:If there a better way to make a fighting Game moves for characters besides a ton of processes? |
For sound you have to use a process. But for animation, you need to remember what frame you are on at each iteration, and draw that frame. Effects is the same deal, remember what frame of the effects you are on. What I would do is make a player class that remembers its own effects and states, and has a single method that draws and computes that character. From here you can do what Expirant did, but in the for loop call the method that computes and draws. |
Author: | isaiahk9 [ Sun May 11, 2008 12:21 pm ] |
Post subject: | RE:If there a better way to make a fighting Game moves for characters besides a ton of processes? |
thanx everyone, that's exactly what i needed. |