You can use your new triggers to make a falling spike ball. The ball will be set in motion when the player contacts an associated trigger.
- [Instructor] A simple way to use our new trigger…is to use it to destroy a floor object.…This way we can drop things on our player.…Let's get that set up.…I'll open up our floor object,…add an event, and add a create event.…I'll drag in the code block,…title it initialize,…and all I need to do here is create…the flag called triggered.…This is the generic flag we'll use…for all of our objects that are able to be triggered.…
We wanna set this up to false initially.…This flag will be set to true by our trigger object…when the player collides with it.…Now every step in our game,…we need to check to see if our floor has been triggered.…So let's add in a step event and step,…and drag in a code block.…I'll give it a title of destroy floor,…and all we wanna do here is check for the trigger event.…So we'll say if triggered,…then we'll destroy the floor with instance destroy.…
That's all we'd need to do to set up our floor object.…So let's close that out.…The last thing we need to do…is associate a trigger with the floor object…
- 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.