Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Merge patch-atomic-unlock-camera-02-21-2025-1740137051 into dev #4049

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://dbx7yu6wgjtfs"
path="res://.godot/imported/asteroid_base.png-a79e53537b060ae8f2520d13eccbd8d0.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/frostwindz/asteroid_base.png"
dest_files=["res://.godot/imported/asteroid_base.png-a79e53537b060ae8f2520d13eccbd8d0.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
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://bf5iwehj5at6t"
path="res://.godot/imported/asteroid_explode.png-3be1e81ddede01303c41100b4d04a0ee.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/frostwindz/asteroid_explode.png"
dest_files=["res://.godot/imported/asteroid_explode.png-3be1e81ddede01303c41100b4d04a0ee.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
1 change: 1 addition & 0 deletions apps/gamejam/brackeys/13/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ shoot={

renderer/rendering_method="gl_compatibility"
renderer/rendering_method.mobile="gl_compatibility"
environment/defaults/default_clear_color=Color(0, 0, 0, 1)
79 changes: 75 additions & 4 deletions apps/gamejam/brackeys/13/scenes/asteroid.tscn
Original file line number Diff line number Diff line change
@@ -1,20 +1,91 @@
[gd_scene load_steps=4 format=3 uid="uid://c4tfp7xjvfd2t"]
[gd_scene load_steps=14 format=3 uid="uid://c4tfp7xjvfd2t"]

[ext_resource type="Texture2D" uid="uid://ct1megp1rctxi" path="res://assets/kenny/space-shooter-redux/png/meteorGrey_big3.png" id="1_bra2q"]
[ext_resource type="Script" path="res://scripts/asteroid.gd" id="1_luuic"]
[ext_resource type="Texture2D" uid="uid://dbx7yu6wgjtfs" path="res://assets/frostwindz/asteroid_base.png" id="2_dvxfl"]
[ext_resource type="Texture2D" uid="uid://bf5iwehj5at6t" path="res://assets/frostwindz/asteroid_explode.png" id="3_t8m0d"]

[sub_resource type="CircleShape2D" id="CircleShape2D_qw1xp"]
radius = 44.6542
radius = 18.2483

[sub_resource type="AtlasTexture" id="AtlasTexture_faa0d"]
atlas = ExtResource("3_t8m0d")
region = Rect2(0, 0, 96, 96)

[sub_resource type="AtlasTexture" id="AtlasTexture_54mr3"]
atlas = ExtResource("3_t8m0d")
region = Rect2(96, 0, 96, 96)

[sub_resource type="AtlasTexture" id="AtlasTexture_4ntrw"]
atlas = ExtResource("3_t8m0d")
region = Rect2(192, 0, 96, 96)

[sub_resource type="AtlasTexture" id="AtlasTexture_lsyjt"]
atlas = ExtResource("3_t8m0d")
region = Rect2(288, 0, 96, 96)

[sub_resource type="AtlasTexture" id="AtlasTexture_p1u3t"]
atlas = ExtResource("3_t8m0d")
region = Rect2(384, 0, 96, 96)

[sub_resource type="AtlasTexture" id="AtlasTexture_oxqmb"]
atlas = ExtResource("3_t8m0d")
region = Rect2(480, 0, 96, 96)

[sub_resource type="AtlasTexture" id="AtlasTexture_o4oup"]
atlas = ExtResource("3_t8m0d")
region = Rect2(576, 0, 96, 96)

[sub_resource type="AtlasTexture" id="AtlasTexture_c77nx"]
atlas = ExtResource("3_t8m0d")
region = Rect2(672, 0, 96, 96)

[sub_resource type="SpriteFrames" id="SpriteFrames_30yq2"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_faa0d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_54mr3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4ntrw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lsyjt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p1u3t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_oxqmb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o4oup")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c77nx")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]

[node name="Asteroid" type="Area2D"]
collision_layer = 128
collision_mask = 288
script = ExtResource("1_luuic")

[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_bra2q")
texture = ExtResource("2_dvxfl")

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_qw1xp")

[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
visible = false
sprite_frames = SubResource("SpriteFrames_30yq2")
frame = 6
frame_progress = 0.643016

[connection signal="body_entered" from="." to="." method="_on_body_entered"]
3 changes: 2 additions & 1 deletion apps/gamejam/brackeys/13/scenes/game.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ script = ExtResource("3_hgajf")
[node name="Background" type="Node2D" parent="."]
script = ExtResource("4_8k503")

[node name="TimespaceLayer" type="Node2D" parent="Background"]
[node name="TimespaceLayer" type="CanvasLayer" parent="Background"]
layer = -2
script = ExtResource("5_jsdqu")

[node name="ColorRect" type="ColorRect" parent="Background/TimespaceLayer"]
Expand Down
5 changes: 5 additions & 0 deletions apps/gamejam/brackeys/13/scenes/spaceship.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,8 @@ position = Vector2(-8.34465e-07, 1.75)
scale = Vector2(0.84375, 0.832031)
sprite_frames = SubResource("SpriteFrames_wdipm")
animation = &"shield"

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

func earn_random_resource(resource_name: String, min_value: int = 3, max_value: int = 15):
Expand Down Expand Up @@ -120,3 +121,10 @@ func get_environment_data(data_name: String):
func set_environment_data(data_name: String, new_value):
environment_data[data_name] = new_value
emit_signal("environment_data_changed", data_name, new_value)

func get_starship_coordinates() -> Vector2:
return starship_data.get("coordinates", Vector2.ZERO)

func set_starship_coordinates(new_position: Vector2):
starship_data["coordinates"] = new_position
call_deferred("emit_signal", "starship_data_changed", "coordinates", new_position)
17 changes: 11 additions & 6 deletions apps/gamejam/brackeys/13/scripts/hud.gd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extends Control

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

# Resources
Expand Down Expand Up @@ -38,13 +38,18 @@ func _ready():
call_deferred("_update_starship_name")
call_deferred("_update_starship_resources")
Global.connect("resource_changed", Callable(self, "_on_resource_changed"))
update_score(0)
Global.connect("starship_data_changed", Callable(self, "_update_starship_data"))
update_coordinates(Global.get_starship_coordinates())

func update_score(new_score):
if score_label:
score_label.text = "Score: %d" % new_score
func update_coordinates(coords: Vector2):
if coordinates_label:
coordinates_label.text = "Coords X: %d, Y: %d" % [coords.x, coords.y]
else:
push_warning("Score label not found!")
push_warning("Coordinates label not found!")

func _update_starship_data(data_name: String, value):
if data_name == "coordinates":
update_coordinates(value)

func _update_starship_resources():
for resource in Global.resources_list:
Expand Down
22 changes: 13 additions & 9 deletions apps/gamejam/brackeys/13/scripts/spaceship.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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()
Expand Down Expand Up @@ -54,15 +55,15 @@ func _physics_process(delta):

move_and_slide()

var screen_size = get_viewport_rect().size
if global_position.y < 0:
global_position.y = screen_size.y
elif global_position.y > screen_size.y:
global_position.y = 0
if global_position.x < 0:
global_position.x = screen_size.x
elif global_position.x > screen_size.x:
global_position.x = 0
#var screen_size = get_viewport_rect().size
#if global_position.y < 0:
#global_position.y = screen_size.y
#elif global_position.y > screen_size.y:
#global_position.y = 0
#if global_position.x < 0:
#global_position.x = screen_size.x
#elif global_position.x > screen_size.x:
#global_position.x = 0

func shoot_laser():
emit_signal("laser_shot", scope.global_position, rotation)
Expand All @@ -72,3 +73,6 @@ func activate_shield():
Global.emit_signal("notification_received", "shield_active", "Shield was deployed", "warning")
shield.visible = true
shield.play("shield")

func defer_set_starship_coordinates():
Global.set_starship_coordinates(global_position)
10 changes: 5 additions & 5 deletions apps/gamejam/brackeys/13/scripts/timespace_layer.gd
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
extends Node2D
extends CanvasLayer

@onready var color_rect := $ColorRect
@onready var background_sprite := $BackgroundSprite

func _ready() -> void:
color_rect.color = Color(0,0,0)
background_sprite.centered = false
color_rect.color = Color.BLACK
background_sprite.centered = true
update_background_size()
get_viewport().connect("size_changed", Callable(self, "_on_viewport_resized"))

Expand All @@ -17,9 +17,9 @@ func update_background_size():
var scale_x: float = viewport_size.x / texture_size.x
var scale_y: float = viewport_size.y / texture_size.y
background_sprite.scale = Vector2(scale_x, scale_y)
background_sprite.position = Vector2.ZERO
background_sprite.position = viewport_size / 2 # Keep centered

color_rect.size = viewport_size
color_rect.size = viewport_size # Make sure the color rect covers the screen

func _on_viewport_resized():
update_background_size()
Loading