Prototyping


First, I created the project structure and tweaked the settings (starting display resolution, stretch mode etc...)

The project main scene tree looks like this for now:

  • Game
    • Level
    • Player
    • PlayTimer
    • SpawnTimer
    • UI
    • MainMenu

The Game scene contains every other scenes that makes the game. That includes the level, the player, the general game UI, the main menu that will be displayed at the start of the application and also two timers.

The PlayTimer define the time before the game ends.

The SpawnTimer is used to spawn new instances of presents in the game, so that the player has always new presents to gather.

And for each nodes of the Game scene:

  • Level
    • Map

The Level scene (Node2D) only contains a TileMap node called Map for now.

The Map is using a tileset that I created with GraphicsGale. There are currently 3 different tiles.

  : ground tile - this is considered a "free" tile where the presents can spawn

: obstacle tile - it contains a StaticBody that has a hitbox (CollisionShape2D) - the player cannot go through them

: wall tile - same as the obstacle tile

  • Player
    • Sprite
    • CollisionShape2D
    • AnimationPlayer

The base node of the Player scene is a KinematicBody2D.

The Player scene contains a Sprite to represent the character, a CollisionShape2D as the hitbox, and an AnimationPlayer to play animations.

The player can move in all four directions (eight directions in fact).

The Game scene script game.gd also spawns new presents, some presents are spawned at the start of the game, and then others are spawned depending on the SpawnTimer. The presents are also a separate scene: Present.

  • Present
    • Sprite
    • CollisionShape2D

The base node of the Present scene is an Area2D. It is used to simply detect what enters the area.

The scene also contains a Sprite and a CollisionShape2D as usual.

The Present detects when the Player enters its hitbox and send the information back to the game scene that take care of what should happen.

Get Presents Overload

Leave a comment

Log in with itch.io to leave a comment.