June 2018
Beginner to intermediate
298 pages
7h 38m
English
Make a new scene with an Area2D named Door and save it in the items folder. Add a Sprite and use the res://assets/environment/layers/props.png sprite sheet along with the Region setting to select the door image, then attach a rectangular CollisionShape2D. This scene doesn't need a script, because you're just going to use the area's body_entered signal.
Put the door on the collectibles layer and set its mask to only scan the player layer.
Instance this door scene in your first level and put it somewhere that the player can reach. Click on the Door node and connect the body_entered signal to the Level.gd script where you can add this code:
func _on_Door_body_entered(body): GameState.next_level()
Run the game and try running into ...
Read now
Unlock full access