Hi, I managed to get three parts out of four of this brick game uploaded on my very very slow and unreliable mobile phone internet out here in the countryside. I thought I would post it here since this is probably still useful even with the last part missing (which is putting bricks in, doing rebounds off them and deleting them when colliding with them). I probably won’t get any more tutorials uploaded for two weeks due to this slow internet.
Hi, I made a ping-pong game too, a bit different than in your tutorial. I would like to check it for any errors and if it is OK I can also make a tutorial about it.
Here is the project: pong_test.zip (4.86 KB)
The bat is moved by mouse.
Used “Move away” action to separate objects after collision.
The ball re-bounces from the bat at a random angle between 190 and 350 degrees.
Use a ball sprite with a transparent background.
Move the ball away using a +x/+y/-x/-y position thing like I did so that the ball doesn’t end up partly inside walls/the paddle when it collides (it just looks a bit neater).
Make the ball start a bit higher up OR don’t start the ball moving until the player clicks the left mouse or something - The ball falls quite fast from not very high and can easily give you an instant game over.
Nice work though. There don’t seem to be any bugs/problems.
It shows that in GD you can’t select transparent background for a sprite. (I just draw it in Windows Paint and couldn’t make it’s background transparent. Next time will use PaintNet instead.)
Used “Move away” action instead of it. It should do the trick, I thought. Need to adjust collision points, I think.
OK.
Thanks for your feedback!
Still not sure if my way of doing the bouncing part is right, because of the ball stucking in the corners if I not using hidden markers for them…
Would like to have bouncing automatism instead.
Actually… I found the Action: Sprite-Effects-“Make a color of the object transparent” which solves this problem.
Just add it at the beginning of the scene and the background of the ball gets transparent. Sorry, my mistake.
Tried to use physics automatism in the game. It get the ball bounce and the program shorter, but I get a problem with bricks - they don’t dissapear always when hit by the ball. Why? pong_physics.zip (4.02 KB)
(Press “Space” to start the game.)
My guess is that the physics engine is updating faster than your event is. I actually can’t think immediately of a way to fix it.
I’ll have a think while I eat my lunch.