Computer Science Canada

Stay Alive - Game Help - Disregard the other topic

Author:  altdas [ Mon Jan 21, 2008 11:47 pm ]
Post subject:  Stay Alive - Game Help - Disregard the other topic

Alright, I'm trying to have my character be able to walk around, while the shots shoot down as they are.
It seems to be only working one way or the other.

I'm also trying to find way of detecting that the character has touched the bullet, so I can have the lose penalty. Razz
All help is very much appreciated. Laughing

Author:  isaiahk9 [ Tue May 06, 2008 5:12 pm ]
Post subject:  Re: Stay Alive - Game Help - Disregard the other topic

For the problem of shots being fired down and a character moving not both working at the same time, I believe you could put the code for the shots in one process, and then the inputting of keys for the avatar moving in another process. You could then fork both the processes. A lot of people have spread the word of how processes are evil, but I haven't run into any issues with them. And, if the processes are truly evil then you can go to Turing Help, and on page one click on the sticky for "Why to avoid processes" and that should tell you how to change your processes into something superior-ally efficient.
As for collision detection, I came up with something just last week on that. Set an x and y variable for the coordinates of the bullet. Instead of changing the area where the picture of the bullet is displayed, just change the coordinates and make the program draw the bullet on those coordinates. Then, you could just say that if the bullet's coordinates are equal to the avatar's coordinates, then the score will decrease.


: