Collision detection, stop gravity

Posted by Scott Beeson on Game Development See other posts from Game Development or by Scott Beeson
Published on 2012-10-16T03:57:52Z Indexed on 2012/10/16 5:30 UTC
Read the original article Hit count: 284

I just started using Gamemaker Studio and so far it seems fairly intuitive. However, I set a room to "Room is Physics World" and set gravity to 10. I then enabled physics on my player object and created a block object to match a platform on my background sprite.

I set up a Collision Detection event for the player and the block objects that sets the gravity to 0 (and even sets the vspeed to 0). I also put a notification in the collision event and I don't get that either. I have my key down and key up events working well, moving the player left and right and changing the sprites appropriately, so I think I understand the event system.

I must just be missing something simple with the physics. I've tried making both and neither of the objects "solid". Pretty frustrating since it looks so easy.

The player starting point is directly above the block object in the grid and the player does fall through the block. I even made the block sprite solid red so I could see it (initially it was invisible, obviously).

© Game Development or respective owner

Related posts about collision-detection

Related posts about game-maker