G
Gary Alexander Stott
Guest
Hey guys,
I'm working on a battle mode for my Pong game, and I'm trying to achieve this:
When a paddle fires its laser and the laser hits or misses the other paddle (despawning on contact or despawning upon leaving the room),the ball (which, all this time, is outside the room, waiting to come back in after the laser hits/misses) moves back to its starting position with the correct hspeed and vspeed values.
Making the laser despawn after hitting or missing is easy enough, of course, and I've achieved that already, but how do I affect the position & speed of another object (the ball) in relation to the laser's status? I'm not even entirely sure in which object to write this code.
Thank you.
I'm working on a battle mode for my Pong game, and I'm trying to achieve this:
When a paddle fires its laser and the laser hits or misses the other paddle (despawning on contact or despawning upon leaving the room),the ball (which, all this time, is outside the room, waiting to come back in after the laser hits/misses) moves back to its starting position with the correct hspeed and vspeed values.
Making the laser despawn after hitting or missing is easy enough, of course, and I've achieved that already, but how do I affect the position & speed of another object (the ball) in relation to the laser's status? I'm not even entirely sure in which object to write this code.
Thank you.