Join Steven Moser for an in-depth discussion in this video Control logic: Idle and run animations, part of Building a Physics-Based Platformer in GameMaker Studio Using GML.
- [Instructor] Clearly, our idle and running animations…are working correctly, so let's go in and fix those up.…I'll open up the player object, go to the create event,…and let's go back to our initialization code.…Since the initial sprite…for our player object is the idle sprite,…let's go ahead and set the image speed here.…We'll use the function image underscore speed,…and I'll set this to something small like 0.12.…I've tested this and it looks like it'll work pretty well.…Usually I just set these by trial and error, though.…
Let's close this out, and go to our state machine.…I'll go to the step event, click on the state machine,…and let's go into the idle event.…We've already set up the image speed in the create event,…but we want to set it up here as well…in case we transition into the idle state…from another state in our state machine.…So let's do a check.…Let's see if our current sprite index,…with sprite underscore index,…is not equal to our idle sprite,…S underscore player underscore idle.…
If it isn't equal to that, we'll set the current sprite…
- 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?
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.