Use the physics functions in Game Maker to allow your player to run, jump and duck. You can do this within the framework of a FSM
- [Instructor] The first thing we want to do…in our state machine is allow our player…to transition from the idle state into the run state.…So let's open up the Player object,…select the Create Event,…and drag a new code block into the Actions area.…We use this to initialize some variables that we'll need,…so I'll call it INIT.…And let's create a variable called run_speed.…And we'll set it to seven.…We'll use this variable to tell the physics engine…how much of a force to apply…to our character to make them run.…
That's all we need to do in here,…so let's close it out.…Go to the Step event,…and open up our state machine.…Let's head into the idle state,…and we want to check here for the release…of the space bar.…When that happens, we'll transition to the run state.…Let's add an if statement,…and we'll use the function keyboard_check_released.…And for the argument, we'll pass it vk_space.…
This is GameMaker's way of referencing…the virtual key that is the space bar.…So basically, when the space bar is released,…this event will trigger,…
- 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.