Join Steven Moser for an in-depth discussion in this video Control logic: Rotation and animation, part of Building a Physics-Based Platformer in GameMaker Studio Using GML.
- [Instructor] Let's take a look at what's happening…to our player object when we jump.…I'll run the game.…And when we jump, you'll notice…that the player object is rotating.…We don't want that to happen…so let's see how to get it fixed.…I'll open up the player object,…head to the create event,…and open up our initialization code.…The physics engine in GameMaker has a flag…that we can use to keep an object from rotating…even when we apply forces to it.…The flag is phy_fixed_rotation.…
If we set this to true,…it'll keep our object from rotating when we jump.…Let's take a look.…Close out the player object, and run our game.…Now, if we jump, we can see that our player…stands straight up the whole time.…That's perfect, that's what we want.…We can also see though that the animation was repeating…over and over again.…Let's see how we can fix that.…If we take a look at the player jumping sprite,…we can see that the zero frame is the player crouching…before they jump and head up in the air.…
So really what we wanna do is just play…
- Setting up basic game components
- Creating the player object
- Using Finite State Machines
- Making the player duck
- Creating physics fixtures in code
- Creating physics obstacles
- Box2D liquid physics
- Creating particles that behave like water
- Creating a floating blocks obstacle
- Creating a swinging chain obstacle and a rope bridge
- Adding the finishing touches
Skill Level Beginner
1. Set Up Basic Game Components
2. The Player Object
3. Create Physics Obstacles
4. Liquid Physics
5. Decorate the Level
6. Finishing Touches
Next steps1m 2s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.