Skip to content

quiver-dev/tower-defense-godot4

Repository files navigation

⚠️This repository has now been superceded by the newOutpost Assault repothat accompanies theOutpost Assault course.Please use that codebase instead of this one. We're still preserving this codebase because it has one or two features not present in the other one, such as hit states. Note, however, that this version is missing explosions, sound effects, and will be less up-to-date overall.

Outpost Assault: Tower Defense Game Template

An open source 2D tile-based tower defense game template built for Godot 4.0, created byQuiver.

Prerequisites

Godot 4.0 RC 6 or later.

Trailer

Outpost Assault Trailer

(click to watch the full trailer!)

Features

  • Tower placement
  • Different tower/weapon types
  • Various projectile types
  • Different enemy types
  • Enemy pathfinding
  • Basic enemy AI
  • UI and HUD
  • Player-controlled camera

Topics covered

  • Godot 4's new features:
    • GDScript's annotations
    • The massively-upgradedTileMapsystem
    • The Navigation Server API
    • Physics bodies, including the newCharacterBody2D
  • Signals
  • Class inheritance
  • Scene composition (oraggregation)
  • Character movement
  • Character animation
  • Collision detection
  • AI implementing the Finite State Machine (FSM) pattern and states
  • Following Godot'sbest practices
  • Creating UI and HUD usingthemeswith the built-in Theme Editor
  • Scene switching/reloading

Code style and guidelines

The code will be written using static typing whenever possible and following the official GDScriptstyle guide.

Every asset will be named usingsnake_casefor usability. snake_casemeans the first letter of each word is written in lowercase and spaces are replaced by underscores_.

The following convention will be used:entity_animation_xxwhereentityis the entity itself (e.g.turret,player,muzzle_flashetc.), animationrefers to the type of animation andxxare numbers indicating the sprite's order in the animation (starting from 00). Examples:infantry_idle_00.png,infantry_idle_01.png,explosion_13.png,infantry_move_00.png,etc. Optionally,entitycan be omitted if its sprites are in a folder named after the entity itself. For example, if we have tanks and infantry, we could have the following folder structure:

tank/idle_00.png
tank/idle_01.png
tank/move_00.png
tank/move_01.png
...
infantry/idle_00.png
...
infantry/move_00.png
...

animationcan also be omitted in case an entity only has one animation (e.g. a bullet flash or an explosion).

Installation Instructions

  • This project usesGit Large File Storage(LFS) to store asset binaries. To initialize it make sure you have LFS installed, then simply rungit lfs install
  • Clone this repository from Github
  • Open the project file with Godot 4 and run it to play theOutpost Assaultdemo!

Questions/Bugs/Suggestions

For bugs and feature requests, feel free to file an issue here or comment on this template'sproject page.

Share with the community!

If you manage to incorporate this template into your next project, please share with theQuiver community!