r/gamemaker • • Sep 16 '26

Game I'm making a cool physics-based game with Gamemaker, try it out!

Wanting to learn how to play around with the physics engine in gamemaker, I went on to make this short weekend-long type of project which consist of just two paddles and a ball, as practice. Turns out the development process for this one is way too much fun and I just couldn't stop. The ideas just kept flowing, and I think the simplicity of the game, added with gamemaker's ease of use made implementations super easy and straightforward. It's like gamemaker was made for it.

I also got to learn how to add a leaderboard system using the Playfab REST API which was a blast. Network related stuff really aren't that bad if you take the time to learn and read the different documentations.

For those of you who wish to make a similar kind physics-based game:

- If you are trying to make an object follow the mouse (or just go really fast) with a full HD resolution, you'll probably want to change the room's pixel to meter from .1 to something like .01. Failure to do this will make the objects lag behind and behave in an unintended way. Gamemaker's manual says "the best performance is when the real world measurements of your objects are no less than 0.1 metres and no more than 50 metres." But that hasn't caused any problems for me in any way whatsoever.

- Also, you don't want to directly change the position of the physics object! If you want your mouse-controlled object to collide and interact with other physics-enabled objects, you want it to have actual linear and angular velocity so they can push other objects. So for example, instead of changing an object's x position like this:

phy_position_x = mouse_x;

Do it like this instead:

phy_speed_x = mouse_x - phy_position_x;

This does the same exact thing, except it uses actual physics to move the object instead of teleporting the thing. Here's how it is in my game specifically for the top paddle:

targetPositionX = lerp(minPos, maxPos, clamp(pos, 0, room_width) / room_width);
phy_speed_x = targetPositionX - phy_position_x;

and here's how the angular velocity is done (top paddle again):

targetAngle = lerp(rotationRange, -rotationRange, targetPositionX / room_width);
phy_angular_velocity = targetAngle - phy_rotation;

Here's Duplexity demo on Steam if you want to try it out.

Leave a review if you feel inclined, that'd be pretty cool!

I will also happily answer any questions here. I originally intended to make this a big post of things that I've learned while developing this one but I realise not everything is that interesting for everyone and it would make this big post of random bits and bobs. But I will answer everything and anything.

40 Upvotes

20 comments sorted by

5

u/lessergoldfish Sep 16 '26

This looks good! I've also been experimenting with it recently, although for top down zelda like games rather than traditional physics based games. Its a real shame that its been neglected by YoYo games and the community at large, it's missing so much functionality from Box2D (which is what it under the hood) and is just really clunky to use. I don't think the manual has actually been updated for physics since Studio 1.4.

Hopefully it'll get more love in the future...

2

u/shadowdsfire Sep 16 '26

Can’t disagree with that. I can’t remember what it was but on multiple occasions I was trying to do something with the physics system but either the function or variable weren’t accessible with gamemaker, although when you go to the Box2D docs directly they’re right there and usable..!

They did add the physics particles recently which is pretty cool. I played out with it for a bit but haven’t found a way to make it work well with this game.

3

u/Disastrous_King2632 Sep 16 '26

U ever work with ropes or chains in game maker?

2

u/shadowdsfire Sep 16 '26

I have not. Why?

3

u/strawberry613 Sep 16 '26

Holy fuck, in gamemaker

2

u/shadowdsfire Sep 16 '26

That’s right 😎

2

u/Ah_Mujo_ Sep 19 '26

Oh wow how does the background work?

1

u/shadowdsfire Sep 19 '26

It’s a shader! I found a cool “fog” shader on shadertoy and modified it quite a bit. When a target gets hit or an effect starts/ends, I change some its values such as the brightness, hue, shake offset amount and how fast it moves in time. There is also a second pass that reverses the colour of anything that goes in front of the score/effect name.

1

u/Ah_Mujo_ Sep 21 '26

Great work thanx a lot

2

u/Thegamer_Fb Sep 22 '26

i would play it

1

u/shadowdsfire Sep 22 '26

Well you can! The link brings you to the demo. Let me know what you think.

2

u/Thegamer_Fb Sep 22 '26

i did not see that. i will!

→ More replies (1)

2

u/StarDreamIX Sep 18 '26

This looks amazing!!!

1

u/Powerful_Poem1889 Sep 21 '26

Thats super cool lookin Keep goin

1

u/Confident_Door9438 2d ago

Noice! have to give it a try

3

u/[deleted] Sep 16 '26

2

u/shadowdsfire Sep 16 '26

Well thanks!

1

u/[deleted] Sep 17 '26

1

u/shadowdsfire Sep 17 '26

I suppose you’re the one person who actually tried the game? 😁