mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 04:12:03 +00:00
refactor(*): Restructure game into reusable Arena/GameMode architecture with controller-driven ships, adding Free Play and Match modes
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
extends GameMode
|
||||
|
||||
# Free Play: one player ship, one ball, no timer, no score — practice like
|
||||
# Rocket League's free play. R resets the ball, Esc returns to the menu.
|
||||
|
||||
|
||||
func _start() -> void:
|
||||
spawn_ball()
|
||||
var player_ship := spawn_ship(0, 0, PlayerShipController.new())
|
||||
spawn_camera_rig(player_ship)
|
||||
|
||||
|
||||
func _on_goal_scored(conceding_team: int) -> void:
|
||||
print("Goal! (into team %d's goal)" % conceding_team)
|
||||
reset_ball()
|
||||
|
||||
|
||||
func _unhandled_input(event):
|
||||
if event.is_action_pressed("reset_ball"):
|
||||
reset_ball()
|
||||
else:
|
||||
super(event)
|
||||
Reference in New Issue
Block a user