Join Steven Moser for an in-depth discussion in this video Create physics fixtures in code, part of Building a Physics-Based Platformer in GameMaker Studio Using GML.
- [Instructor] In order to change our physics fixture…associated with the ducking action,…we're going to need to create some physics fixtures…in code and swap them out when we duck.…Let's open up our player object and set that up.…We'll create our two physics fixtures in the create event.…I'm gonna drag in some code, do three slashes,…and let's comment this as create fixtures.…I'm gonna create a variable called fix r,…to hold a reference to our new fixture.…
Fix r stands for running fixture.…And then I'll use the variable physics_fixture_create.…Doesn't require any arguments.…This creates the fixture and passes…the reference to our Fix r variable.…Next, let's set the fixture shape.…I'll use the function, physics_fixture_set and box shape.…
This takes three arguments.…The first is the reference to the fixture…that we wanna set the shape for.…So we'll set that to Fix r,…our new fixture that we just created.…Then we need to find the half-width…and half-height of our fixture.…We use the half-width and half-height…because that's how the physics…
- 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.