Drag And Drop Beginner looking for help (If collision shape, etc.)

S

selfhighfive

Guest
Yesterday I decided to download GMS2 after learning that I could program by dragging and dropping symbols instead of writing code. I've never really been able to wrap my head around things like C# and as a visual-based artist the DnD features feel really intuitive in comparison. I've watched the only two Youtube tutorials I could find for DnD GMS2, and for my first game I'm starting out with a really simple Pong clone. Ideally though I'd like to complicate it a bit with things like power ups and better ball physics/weight but I'm running into some problems.

My first issue is a really simple one. I think I know how to fix it but I need some advice because my understanding of programming is nil.
The tutorial I used to create my game has the ball reverse horizontally when it collides with the paddle. But that means when the ball collides with the top or bottom of the paddle it becomes stuck because the direction would need to reverse vertically.
Looking through the toolbox it seems like "If collision shape" is probably the answer to this. This is my best guess as to how I would set it up.

ifcollision.jpg

But I'm not entirely sure what I would put for X and Y, if it's relative, what target and temp is in reference to, etc. And I assume I would then make two more "if collision shape"s for the top and bottom of the sprite telling it to reverse vertically.
Ideally I would like to set up the collision so that the ball reacted like this. Would this be something I could do with "if collision shape"?

paddle collision.jpg

Am I on the right track to a solution or am I completely lost?
Thanks in advance for the help!
 
Last edited by a moderator:
Top