Computer Science Canada How can i make objects disapear on event |
Author: | Woodbridge [ Tue May 27, 2003 8:43 am ] |
Post subject: | How can i make objects disapear on event |
I am making a pong game and i cannot figure out how to make the blocks disapear when they are hit by the ball. Can somone help me out. |
Author: | Delta [ Tue May 27, 2003 9:05 am ] |
Post subject: | |
First off your game is called blast out or something like that not pong, but sure. Make a procedure that is called when the [x,y] of the ball is beside or in the [x1,y1,x2,y2] of the box. Then have the procedure draw over the box and set the [x1,y1,x2,y2] values off the screen so that the ball can't hit them anymore. |
Author: | Tony [ Tue May 27, 2003 10:55 am ] |
Post subject: | |
i sujest keeping all block positions in an array and once the block is hit (rectangle collision detection) you set that array item as 0 |
Author: | Homer_simpson [ Tue May 27, 2003 1:08 pm ] | ||
Post subject: | |||
ok here's how objects work(at least for me)
the ball1 is an object with these specifications x,y,visibility... |