Now that your player can move let's setup the animations for the various movement states.
- [Instructor] Now let's set up the jump state.…I'll open up the player object, go to the create event,…and head back to our initialization code.…Let's set up a couple more variables that we'll need.…We'll need an impulse value that will apply…to the player object to make them jump.…I'll set up a variable for that called jump_impulse,…and I'll set that equal to -100.…Keep in mind that it's negative because the Y values…increase as we go from the top of the screen to the bottom…of the screen, so if we need a vector pointing upwards,…it has to be negative in the Y direction.…
I'll also set a flag that we'll use to test…for whether we've jumped or not,…we'll talk about this more in a little bit.…For now, I'll just set it equal to false.…That's all we need, so let's close our our initialization…code, head to the step event, and open up our state machine.…If you recall our state flow diagram, we're going to be able…to enter the jump state when we're running and ducking,…so let's first head to the run state.…We'll create a script here that will hold our jump code.…
- 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.