Need HELP with collision array and scoring.
Author |
Message |
Waylon777
|
Posted: Sun Jan 11, 2009 6:10 pm Post subject: Need HELP with collision array and scoring. |
|
|
Hi, I'm making a spaceship shooting game, and I don't know how to do a collision array and scoring for this. For the collision, when the shots collides with either players, the player who got hit explose with the explosion picture. For the scoring, it displays the number of kills up 3. If one of the player kills the other for 3 times, the game will display "Congradulations! Player !@#!@# Wins!!!" with the sound spplause.au. Also, it's a Ready To Program file.
Description: |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
MyShootingSpaceship.zip |
Filesize: |
582.24 KB |
Downloaded: |
104 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
TheHobbit
|
Posted: Thu Jan 15, 2009 10:48 pm Post subject: Re: Need HELP with collision array and scoring. |
|
|
Hey man- sorry , i didnt get time to look at your code, but i can help you out in theory.
For collision, if you're trying to shoot something, think of a range.
if you want ball1 to hit square1 , make a range for the ball's x position to hit at. (dont worry about y right now, just think 1 dimension for simplicity sake )
if you think about it, for the collision to work, the ball must hit anywhere between the origin and the far end of the square's X pos, try to think of a way to implement that.
meanwhile i'll send you link to a thread where something similar is done ( i gotta go look for it )
as for scoring, you can do that really easily once you get the collision working.
so as soon as your ball hits the square, make the scoreCounter go up by 1 point.
use simple over riding technique > scoreCounter = scoreCounter +1;
|
|
|
|
|
![](images/spacer.gif) |
TheHobbit
|
Posted: Thu Jan 15, 2009 11:26 pm Post subject: Re: Need HELP with collision array and scoring. |
|
|
collsion post here
theres the link to the thread where i figured out collision, see if it helps.
|
|
|
|
|
![](images/spacer.gif) |
|
|