refactor and rename cassette system

- Rename cassette references throughout codebase
- Update scene files and scripts for consistency
- Refactor cassette.gd and related components
- Update player, enemy, and phonebooth interactions
- Sync game_over and pause_screen with new structure
This commit is contained in:
bigmstone committed 2026-10-04 15:43:24 -06:00
1 parent acdee757cb
commit 3f6b9dc8cc
17 files changed
+24 -55

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ var points = 0
func _ready() -> void:
$AnimatedSprite2D.play()
func _on_body_entered(body: Node2D) -> void:
func _on_body_entered(_body: Node2D) -> void:
queue_free()
GlobalData.cassets += 1
GlobalData.cassettes += 1
print("1 point")
+1 -1
View File
@@ -157,7 +157,7 @@ animations = [{
"speed": 15.0
}]
[node name="casset" type="Area2D" unique_id=918954585]
[node name="cassette" type="Area2D" unique_id=918954585]
collision_layer = 16
script = ExtResource("1_e33mb")
+2 -2
View File
@@ -36,11 +36,11 @@ func _on_timer_timeout() -> void:
$Timer.start()
func _on_area_2d_area_entered(area: Area2D) -> void:
func _on_area_2d_area_entered(_area: Area2D) -> void:
if GlobalData.hurtable:
death_counter -= 1
elif GlobalData.weapon == 2:
death_counter -= 1
func _on_area_2d_body_entered(body: Node2D) -> void:
func _on_area_2d_body_entered(_body: Node2D) -> void:
GlobalData.death_counter -= 1
+3 -29
View File
@@ -6,23 +6,16 @@ func _ready() -> void:
pass # Replace with function body.
func _process(delta: float) -> void:
func _process(_delta: float) -> void:
pass
func _on_area_2d_body_entered(body: Node2D) -> void:
if get_parent().get_tree().get_nodes_in_group("Cassets").is_empty():
func _on_area_2d_body_entered(_body: Node2D) -> void:
if get_parent().get_tree().get_nodes_in_group("Cassettes").is_empty():
if $CanvasLayer.get_children().is_empty():
var inst: Control = phonephreak.instantiate()
$CanvasLayer.add_child(inst)
print("== IMMEDIATE ==")
_dump(inst)
await get_tree().process_frame
await get_tree().process_frame
print("== AFTER 2 FRAMES ==")
_dump(inst)
GlobalData.doing_puzzle = true
$CanvasLayer.add_child(inst)
inst.set_anchors_and_offsets_preset(Control.PRESET_CENTER, Control.PRESET_MODE_KEEP_SIZE)
inst.grow_vertical = Control.GROW_DIRECTION_BOTH
inst.grow_horizontal = Control.GROW_DIRECTION_BOTH
@@ -32,22 +25,3 @@ func _on_area_2d_body_entered(body: Node2D) -> void:
get_parent().get_parent().get_node("player").SpeechMarker,
5.0
)
func _dump(inst: Control) -> void:
var vp := get_viewport()
print("window size: ", get_window().size, " content_scale_mode: ", get_window().content_scale_mode)
print("visible_rect: ", vp.get_visible_rect(), " -> screen center: ", vp.get_visible_rect().size / 2.0)
print("layer: offset=", $CanvasLayer.offset, " scale=", $CanvasLayer.scale, " rotation=", $CanvasLayer.rotation,
" follow_viewport=", $CanvasLayer.follow_viewport_enabled)
print("root: type=", inst.get_class(), " pos=", inst.position, " size=", inst.size,
" min=", inst.get_combined_minimum_size(), " scale=", inst.scale, " pivot=", inst.pivot_offset)
print("root anchors L/T/R/B: ", inst.anchor_left, " ", inst.anchor_top, " ", inst.anchor_right, " ", inst.anchor_bottom,
" offsets: ", inst.offset_left, " ", inst.offset_top, " ", inst.offset_right, " ", inst.offset_bottom)
print("root global_rect: ", inst.get_global_rect(), " -> its center: ", inst.get_global_rect().get_center())
print("root parent: ", inst.get_parent().name, " (", inst.get_parent().get_class(), ")")
for c in inst.get_children():
if c is Control:
print(" child ", c.name, " (", c.get_class(), ") global_rect=", c.get_global_rect(),
" visible=", c.visible, " anchors preset-ish: ", c.anchor_left, ",", c.anchor_top, ",", c.anchor_right, ",", c.anchor_bottom)
else:
print(" child ", c.name, " (", c.get_class(), ")")
+3 -5
View File
@@ -326,14 +326,13 @@ func _process(_delta):
var dir: bool = 1
func _physics_process(delta):
print(GlobalData.death_counter)
if Input.is_action_just_pressed("slash_weapon"):
weapon = 1
GlobalData.weapon = 1
if Input.is_action_just_pressed("gun"):
weapon = 2
GlobalData.weapon = 2
$Label.text = str(int(GlobalData.cassets))
$Label.text = str(int(GlobalData.cassettes))
if Input.is_action_just_pressed("right"):
dir = 1
$ColorRect5.global_position = $Marker2D3.global_position
@@ -695,7 +694,7 @@ func _wallJump():
var horizontalWallKick = abs(jumpMagnitude * cos(wallKickAngle * (PI / 180)))
var verticalWallKick = abs(jumpMagnitude * sin(wallKickAngle * (PI / 180)))
velocity.y = -verticalWallKick
var dir = 1
dir = 1
if wallLatchingModifer and latchHold:
dir = -1
if wasMovingR:
@@ -754,8 +753,7 @@ func _endGroundPound():
gravityActive = true
func _placeHolder():
print("")
pass
func shoot():
pass
+6 -6
View File
@@ -62,10 +62,10 @@ metadata/_edit_use_anchors_ = true
position = Vector2(112, 38)
[node name="Label" type="Label" parent="." unique_id=519077191]
offset_left = -687.0
offset_top = -389.0
offset_right = -654.0
offset_bottom = -355.0
offset_left = -642.0
offset_top = -387.0
offset_right = -609.0
offset_bottom = -353.0
theme_override_fonts/font = ExtResource("2_g2els")
theme_override_font_sizes/font_size = 25
text = "0"
@@ -77,7 +77,7 @@ offset_right = -637.0
offset_bottom = -356.0
theme_override_fonts/font = ExtResource("2_g2els")
theme_override_font_sizes/font_size = 25
text = "cassets:"
text = "cassettes:"
[node name="ColorRect5" type="ColorRect" parent="." unique_id=823301403]
visible = false
@@ -107,7 +107,7 @@ position = Vector2(107, 48)
physics_interpolation_mode = 1
top_level = true
position = Vector2(5, 5)
offset = Vector2(0.899438, 1.7079604)
offset = Vector2(1.7197182, -1.6673563)
[node name="PhantomCameraHost" type="Node" parent="Camera2D" unique_id=134961787]
process_priority = 300