Skip to content

Commit

Permalink
feat(brackeys13): adding the exhaust and heat management, but for som…
Browse files Browse the repository at this point in the history
…e reason the heat management is not working.
  • Loading branch information
h0lybyte committed Feb 21, 2025
1 parent dd3c668 commit 366d1b2
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 4 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://buvmwoh578i7v"
path="res://.godot/imported/battlecruiser_exhaust.png-912cadbd57de55ee3ed43f6cbbf4e83c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/frostwindz/battlecruiser_exhaust.png"
dest_files=["res://.godot/imported/battlecruiser_exhaust.png-912cadbd57de55ee3ed43f6cbbf4e83c.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
3 changes: 3 additions & 0 deletions apps/gamejam/brackeys/13/scenes/game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ layout_mode = 2
[node name="Label" type="Label" parent="CanvasLayer/UI/HUD/Panel/Menu/Nav"]
layout_mode = 2

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

[node name="HSplitContainer" type="HSplitContainer" parent="CanvasLayer/UI/HUD/Panel/Menu"]
layout_mode = 2
split_offset = 10
Expand Down
227 changes: 225 additions & 2 deletions apps/gamejam/brackeys/13/scenes/spaceship.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=36 format=3 uid="uid://1s5v0llrjq3"]
[gd_scene load_steps=67 format=3 uid="uid://1s5v0llrjq3"]

[ext_resource type="Script" path="res://scripts/spaceship.gd" id="1_uejed"]
[ext_resource type="Texture2D" uid="uid://b5a5g0gqvormg" path="res://assets/frostwindz/battlecruiser.png" id="2_kvtre"]
[ext_resource type="Texture2D" uid="uid://cj16mbdine6mk" path="res://assets/frostwindz/battlecruiser_engine.png" id="3_mwphh"]
[ext_resource type="Texture2D" uid="uid://buvmwoh578i7v" path="res://assets/frostwindz/battlecruiser_exhaust.png" id="4_e0b8n"]
[ext_resource type="Texture2D" uid="uid://84n6013yietv" path="res://assets/frostwindz/battlecruiser_shield.png" id="4_yxx3w"]

[sub_resource type="CircleShape2D" id="CircleShape2D_s734v"]
Expand Down Expand Up @@ -100,6 +101,126 @@ animations = [{
"speed": 5.0
}]

[sub_resource type="AtlasTexture" id="AtlasTexture_f32dw"]
atlas = ExtResource("4_e0b8n")
region = Rect2(0, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_drtwp"]
atlas = ExtResource("4_e0b8n")
region = Rect2(128, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_11n8e"]
atlas = ExtResource("4_e0b8n")
region = Rect2(256, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_33tmt"]
atlas = ExtResource("4_e0b8n")
region = Rect2(384, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_3c10b"]
atlas = ExtResource("4_e0b8n")
region = Rect2(512, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_03oc6"]
atlas = ExtResource("4_e0b8n")
region = Rect2(640, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_qycyb"]
atlas = ExtResource("4_e0b8n")
region = Rect2(768, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_2j20y"]
atlas = ExtResource("4_e0b8n")
region = Rect2(896, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_6er2f"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1024, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_lrbnf"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1152, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_mk2ku"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1280, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_8clph"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1408, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_jguhh"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1536, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_2eblt"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1664, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_5ljpj"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1792, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_sinc8"]
atlas = ExtResource("4_e0b8n")
region = Rect2(1920, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_in3rs"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2048, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_5warc"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2176, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_d3nke"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2304, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_iga1v"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2432, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_ax0db"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2560, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_owh65"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2688, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_8njy1"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2816, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_klpgg"]
atlas = ExtResource("4_e0b8n")
region = Rect2(2944, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_iq0e6"]
atlas = ExtResource("4_e0b8n")
region = Rect2(3072, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_8mpjt"]
atlas = ExtResource("4_e0b8n")
region = Rect2(3200, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_4wuqy"]
atlas = ExtResource("4_e0b8n")
region = Rect2(3328, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_u5pjl"]
atlas = ExtResource("4_e0b8n")
region = Rect2(3456, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_lvinn"]
atlas = ExtResource("4_e0b8n")
region = Rect2(3584, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_i6iig"]
atlas = ExtResource("4_e0b8n")
region = Rect2(3712, 0, 128, 128)

[sub_resource type="AtlasTexture" id="AtlasTexture_srl8d"]
atlas = ExtResource("4_yxx3w")
region = Rect2(0, 0, 128, 128)
Expand Down Expand Up @@ -166,6 +287,106 @@ region = Rect2(1920, 0, 128, 128)

[sub_resource type="SpriteFrames" id="SpriteFrames_wdipm"]
animations = [{
"frames": [],
"loop": true,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_f32dw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_drtwp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_11n8e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_33tmt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3c10b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_03oc6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qycyb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2j20y")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6er2f")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lrbnf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mk2ku")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8clph")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jguhh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2eblt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5ljpj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sinc8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_in3rs")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_5warc")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d3nke")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_iga1v")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ax0db")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_owh65")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8njy1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_klpgg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_iq0e6")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8mpjt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4wuqy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_u5pjl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lvinn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_i6iig")
}],
"loop": false,
"name": &"exhaust",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_srl8d")
Expand Down Expand Up @@ -247,7 +468,9 @@ animation = &"engine"
position = Vector2(-8.34465e-07, 1.75)
scale = Vector2(0.84375, 0.832031)
sprite_frames = SubResource("SpriteFrames_wdipm")
animation = &"shield"
animation = &"exhaust"
frame = 29
frame_progress = 1.0

[node name="Camera2D" type="Camera2D" parent="."]
position_smoothing_enabled = true
Expand Down
4 changes: 3 additions & 1 deletion apps/gamejam/brackeys/13/scripts/global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ var starship_data := {
"name": "Explorer-X",
"emergency_rockets_used": false,
"shield_active": false,
"coordinates": Vector2.ZERO
"coordinates": Vector2.ZERO,
"heat": 0.0
}

func earn_random_resource(resource_name: String, min_value: int = 3, max_value: int = 15):
Expand Down Expand Up @@ -115,6 +116,7 @@ func get_starship_data(data_name: String):

func set_starship_data(data_name: String, new_value):
starship_data[data_name] = new_value
print("Set", data_name, "to", new_value, "- Current stored value:", starship_data[data_name])
emit_signal("starship_data_changed", data_name, new_value)

func get_environment_data(data_name: String):
Expand Down
8 changes: 8 additions & 0 deletions apps/gamejam/brackeys/13/scripts/hud.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extends Control

@onready var coordinates_label = $Panel/Menu/Nav/Label
@onready var name_label = $Panel/Menu/Nav/StarshipName
@onready var heat_label = $Panel/Menu/Nav/StarshipHeat

# Resources

Expand Down Expand Up @@ -41,6 +42,11 @@ func _ready():
Global.connect("starship_data_changed", Callable(self, "_update_starship_data"))
update_coordinates(Global.get_starship_coordinates())


func update_heat(heat: int):
if heat_label:
heat_label.text = "%d C" % [heat]

func update_coordinates(coords: Vector2):
if coordinates_label:
coordinates_label.text = "Coords X: %d, Y: %d" % [coords.x, coords.y]
Expand All @@ -50,6 +56,8 @@ func update_coordinates(coords: Vector2):
func _update_starship_data(data_name: String, value):
if data_name == "coordinates":
update_coordinates(value)
if data_name == "heat":
update_heat(value)

# func _update_starship_resources():
# for resource in Global.resources_list:
Expand Down
15 changes: 14 additions & 1 deletion apps/gamejam/brackeys/13/scripts/spaceship.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,26 @@ func _ready():
position = get_viewport_rect().size / 2

func _process(delta):
call_deferred("defer_set_starship_coordinates")
if Input.is_action_pressed("shoot"):
shield.visible = false
shoot_laser()
call_deferred("defer_set_starship_coordinates")


func _physics_process(delta):
var acceleration = Global.get_starship_stat("acceleration")
var max_speed = Global.get_starship_stat("max_speed")
var rotation_speed = Global.get_starship_stat("rotation_speed")
var input_vector := Vector2(0, Input.get_axis("thrust", "reverse"))
var heat = int(Global.get_starship_data("heat") or 0)
if input_vector.y != 0:
Global.set_starship_data("heat", heat + 1)
print("Heat increased:", heat + 1)

if heat >= 100:
Global.emit_signal("notification_received", "heat_error", "Ship is Overheating!", "error")
input_vector = Vector2.ZERO

velocity += input_vector.rotated(rotation) * acceleration
velocity = velocity.limit_length(max_speed)

Expand Down Expand Up @@ -69,6 +79,9 @@ func shoot_laser():
emit_signal("laser_shot", scope.global_position, rotation)


func exhaust():
shield.play("exhaust")

func activate_shield():
Global.emit_signal("notification_received", "shield_active", "Shield was deployed", "warning")
shield.visible = true
Expand Down

0 comments on commit 366d1b2

Please sign in to comment.