From the course: Building a Physics-Based Platformer in GameMaker Studio Using GML

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Player death

Player death

- [Instructor] The last thing we need to do for our game is take care of our player when they die. We can have some fun with this. So let's create a sword object that will launch out from player when they get killed. I'm gonna go to the Player Objects folder, create an object, and we'll cal it o_sword. Let's set our sprite to the Player folder and sword. We wanted to use physics, so we'll check that box. Let's set the Collision Shape to Box, and modify that. Set the Horizontal and Vertical to eight, and we'll just line this up with the center of our sword. That'll work just fine. Click OK. Our sword isn't too heavy. So let's change the Density to .3, and it would be fun it bounced around the room a little bit when it runs into things. So let's set the Restitution to .25. We can always adjust those later if we want to. We wanna make sure it collides with things in the room, so let's change the Parent to parent dynamic. And we wanna be able to see it when it goes flying around so let's…

Contents