mirror of
https://codeberg.org/Melon-Bread/Comets.gd.git
synced 2025-07-06 22:54:36 -04:00
Made a basic game UI and started fleshing out game states
This commit is contained in:
34
scripts/game.gd
Normal file
34
scripts/game.gd
Normal file
@ -0,0 +1,34 @@
|
||||
extends Node2D
|
||||
|
||||
# TODO: Display a game over screen when the ship is hit by a comet with abilty to restart
|
||||
# TODO: Detect when all comets are gone and increase the level (& maybe speed?)
|
||||
# TODO: Make a space like background, maybe some scrolling, maybe randomly generated
|
||||
# TODO: Make a small title screen that starts before the game scene
|
||||
# TODO: MAYBE track high score in a file & show it on HUD
|
||||
|
||||
@export var level : int = 1
|
||||
var score : int = 0
|
||||
|
||||
var points_per_comet := 300
|
||||
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
update_ui()
|
||||
|
||||
func new_level(current_level : int) -> void:
|
||||
pass
|
||||
|
||||
func game_over() -> void:
|
||||
pass
|
||||
|
||||
func increase_score(comet_size : int) -> void:
|
||||
# We add one since comet_size starts count at 0
|
||||
comet_size += 1
|
||||
score += points_per_comet / comet_size
|
||||
|
||||
func update_ui()-> void:
|
||||
# Label strings must be all caps for font to render proper
|
||||
$UI/Score.text = "SCORE: " + str(score)
|
||||
$UI/Level.text = "LEVEL: " + str(level)
|
Reference in New Issue
Block a user