Add a savegame system using slots and a main menu, allow player to move RigidBody2Ds using apply_impulse(), increased physics tick, enabled FXAA, and more.
This commit is contained in:
parent
35ebe26340
commit
5a67d46d6f
13 changed files with 291 additions and 25 deletions
21
menu/slot/slot.gd
Normal file
21
menu/slot/slot.gd
Normal file
|
@ -0,0 +1,21 @@
|
|||
extends Node2D
|
||||
|
||||
@export var slot_idx: int
|
||||
@export var slot_label: String = ""
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$Label.text = str(slot_label)
|
||||
|
||||
func _on_area_2d_load_body_entered(body: Node2D) -> void:
|
||||
# load slot & start game
|
||||
if body == NodeRegistry.player:
|
||||
Gamestate.current_slot = slot_idx
|
||||
Gamestate.load_slot()
|
||||
Levels.load_entrypoint(Gamestate.last_entrypoint)
|
||||
|
||||
func _on_area_2d_delete_body_entered(body: Node2D) -> void:
|
||||
# reset slot on disk
|
||||
if body == NodeRegistry.player:
|
||||
Gamestate.reset_slot(slot_idx)
|
||||
NodeRegistry.player.position = Levels.mainmenu_player_pos
|
Reference in a new issue