Stay Alive - Game Help - Disregard the other topic
Author |
Message |
altdas
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
isaiahk9
![](http://compsci.ca/v3/uploads/user_avatars/1465120414488e669e1f83a.jpg)
|
Posted: 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.
|
|
|
|
|
![](images/spacer.gif) |
|
|