mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 16:33:43 +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,21 @@
|
||||
class_name Goal
|
||||
extends Area3D
|
||||
|
||||
# A goal is a dumb sensor: it detects the ball crossing its plane and emits
|
||||
# goal_scored. The game mode owns all consequences (score, resets). Two of
|
||||
# these live in each arena, one per team.
|
||||
|
||||
# The team that concedes when the ball enters this goal.
|
||||
@export var team: int = 0
|
||||
|
||||
signal goal_scored(team: int)
|
||||
|
||||
|
||||
func _ready():
|
||||
# Group lets AI controllers and game modes discover goals
|
||||
add_to_group("goal")
|
||||
|
||||
|
||||
func _on_body_entered(body):
|
||||
if body.is_in_group("ball"):
|
||||
goal_scored.emit(team)
|
||||
Reference in New Issue
Block a user