Week 8
25: Winning the game
You Win screen
- Same as Game Over, except trigger on a new collectable object, or when a particular quest is completed
- Collectable object:

- Or when quest completes:

26: Doors
Doors
- Place door in items layer, use arrow keys to nudge
- Place doorway sides in tilemap
- New layer “above” for doorway top arch
- Add non-solid script to arch
- Add script to door
- When level starts immovable
- When touched by player
- Broadcast display chat with “The door creaks open…”
- Play animation “open”
- Play test, see it’s too tight
- One doorway side/wall side of door should go on a non-solid tilemap so you can walk through it like so

- Play test
27: Teleporters
Teleporters/stairways
- Place stairs somewhere
- Add script
- When level starts, set immovable true
- When touched by player,
- New global variable (explain global vars) player starting x position and player starting y position
- New property variable (explain property vars) “send player to this x position” “send player to this y position”
- Go to level,
- New property variable “send player to this level”

- Script properties, tick public on these three

- Close and save teleporter script
- Find the coordinates in the level
- Find the coordinates where you want to send the player
- Type those in the Object Behaviour
Make the player go to that position
- Edit player script, add to when the level starts…
- Set x position of myself to (global var) player starting x position
- Same for y position

- Play game to test it… oh no what happens if the global var hasn’t got a value yet??
- Better add something to check if it has a value or not
- Wrap those blocks in “If number player starting x position does not = null” (explain null as valueless)

28: Publish and share your game
How to Publish
- Click Publish
- Share the link
- When you change your game, you’ll need to Publish again
⚡ Bonus Activities ⚡
Bonus 7.1: Keys and locked doors