Skip to content

Commit

Permalink
Merge pull request #4030 from KBVE/patch-atomic-asteroid-breakage-02-…
Browse files Browse the repository at this point in the history
…20-2025-1740047697

[CI] Merge patch-atomic-asteroid-breakage-02-20-2025-1740047697 into dev
  • Loading branch information
h0lybyte authored Feb 20, 2025
2 parents 5f80bb9 + 5adf87f commit e4ccc68
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 12 deletions.
74 changes: 66 additions & 8 deletions apps/gamejam/brackeys/13/scenes/game.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://cbrda40vq26pj"]
[gd_scene load_steps=14 format=3 uid="uid://cbrda40vq26pj"]

[ext_resource type="Script" path="res://scripts/game.gd" id="1_oyaqx"]
[ext_resource type="PackedScene" uid="uid://1s5v0llrjq3" path="res://scenes/spaceship.tscn" id="1_rlyye"]
Expand All @@ -10,10 +10,75 @@
[ext_resource type="Script" path="res://scripts/environment_layer.gd" id="8_rakg7"]
[ext_resource type="Script" path="res://scripts/toast_manager.gd" id="9_tiuga"]
[ext_resource type="Script" path="res://scripts/entity.gd" id="10_1liq3"]
[ext_resource type="Script" path="res://scripts/hud.gd" id="11_e1u8f"]
[ext_resource type="Theme" uid="uid://bkt3waoihtb6j" path="res://theme/Theme.tres" id="11_je1f8"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4vpul"]
bg_color = Color(0.6, 0.6, 0.6, 0.5)
expand_margin_left = 20.0
expand_margin_right = 20.0

[node name="Game" type="Node2D"]
script = ExtResource("1_oyaqx")

[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="UI" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="HUD" type="Control" parent="CanvasLayer/UI"]
custom_minimum_size = Vector2(0, 80)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
theme = ExtResource("11_je1f8")
script = ExtResource("11_e1u8f")

[node name="Panel" type="PanelContainer" parent="CanvasLayer/UI/HUD"]
custom_minimum_size = Vector2(0, 80)
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 23.0
grow_horizontal = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_4vpul")

[node name="Menu" type="HBoxContainer" parent="CanvasLayer/UI/HUD/Panel"]
layout_mode = 2
alignment = 1

[node name="Label" type="Label" parent="CanvasLayer/UI/HUD/Panel/Menu"]
layout_mode = 2

[node name="Bottom" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 0

[node name="ToastManager" type="Control" parent="CanvasLayer/Bottom"]
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -80.0
offset_right = 40.0
offset_bottom = -40.0
grow_vertical = 0
script = ExtResource("9_tiuga")

[node name="Spaceship" parent="." instance=ExtResource("1_rlyye")]
position = Vector2(500, 300)

Expand All @@ -39,12 +104,5 @@ script = ExtResource("7_hvh2v")
[node name="EnvironmentLayer" type="Node2D" parent="Background"]
script = ExtResource("8_rakg7")

[node name="ToastManager" type="Control" parent="."]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
script = ExtResource("9_tiuga")

[node name="Entity" type="Node2D" parent="."]
script = ExtResource("10_1liq3")
7 changes: 6 additions & 1 deletion apps/gamejam/brackeys/13/scenes/ui/toast.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@

[node name="Toast" type="Control"]
layout_mode = 3
anchors_preset = 0
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 0
script = ExtResource("1_jpci1")

[node name="Panel" type="Panel" parent="."]
Expand Down
6 changes: 3 additions & 3 deletions apps/gamejam/brackeys/13/scripts/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ extends Node2D
@onready var spaceship = $Spaceship
@onready var projectiles = $Projectiles
@onready var background = $Background
@onready var tm = $ToastManager
#@onready var tm = $ToastManager

const LASER_POOL_SIZE = 25
const LASER_POOL_SIZE = 10

func _ready():
spaceship.connect("laser_shot", _on_spaceship_laser_shot)
projectiles.initialize_pool(LASER_POOL_SIZE)
tm.show_toast("game_start", "Game Started! Ready for launch.", "info")
Global.emit_signal("notification_received", "game_start", "Game Started! Ready for launch.", "info")

func _on_spaceship_laser_shot(scope_position: Vector2, rotation: float):
projectiles.shoot_laser(scope_position, rotation)
11 changes: 11 additions & 0 deletions apps/gamejam/brackeys/13/scripts/hud.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
extends Control


# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
1 change: 1 addition & 0 deletions apps/gamejam/brackeys/13/scripts/laser.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func _on_area_entered(area):
if area is Asteroid:
var asteroid = area
asteroid.destroy()
Global.emit_signal("notification_received", "asteroid_hit", "Asteroid was destoried!", "success")
visible = false
if get_parent():
get_parent()._on_laser_exited(self)

0 comments on commit e4ccc68

Please sign in to comment.