egtting there

This commit is contained in:
Tabby 2025-05-16 01:29:12 +10:00
parent f16d046a6c
commit 35db2250f7
23 changed files with 395 additions and 11 deletions

View file

@ -13,7 +13,7 @@ viewport_path = NodePath("GameViewport")
[sub_resource type="AnimatedTexture" id="AnimatedTexture_8t1w7"]
frames = 5
speed_scale = 20.0
speed_scale = 9.1
frame_0/texture = ExtResource("3_w8dl7")
frame_1/texture = ExtResource("4_sawva")
frame_1/duration = 1.0
@ -63,6 +63,7 @@ expand_mode = 2
[node name="Static" type="TextureRect" parent="."]
visible = false
modulate = Color(0.226707, 0.226707, 0.226707, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0

View file

@ -1,6 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://ip51kjj5sl6v"]
[gd_scene load_steps=3 format=3 uid="uid://ip51kjj5sl6v"]
[ext_resource type="Script" uid="uid://cuct36ytrc3mu" path="res://game_manager.gd" id="1_d8p07"]
[ext_resource type="Texture2D" uid="uid://r71wb0u4bsxw" path="res://sprites/broken_tv_remote.png" id="2_s0thi"]
[node name="GameManager" type="Node"]
script = ExtResource("1_d8p07")
broken_tv_remote = ExtResource("2_s0thi")

View file

@ -21,6 +21,7 @@ var zooming_out : bool = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
GameManager.zoom_out_signal.connect(zoom_out)
GameManager.prepare.connect(get_ready)
if(gamemode == Gamemode.Story):
main_camera.zoom = Vector2(3.1,3.1)
main_channel.start_channel(platformer_game)
@ -36,3 +37,7 @@ func _process(delta: float) -> void:
func zoom_out():
zooming_out = true
func get_ready():
for channel in outer_channels:
channel.channel_mode = channel.Mode.Static

View file

@ -6,6 +6,10 @@ signal zoom_out_signal
signal allow_movement(bool)
signal show_chat_signal(String)
signal show_item_signal(String, Texture)
signal prepare
signal gaming
@export var broken_tv_remote : Texture
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
@ -27,3 +31,14 @@ func show_item(text : String, texture : Texture):
func change_player_movement(state : bool):
allow_movement.emit(state)
func prepare_for_gaming():
#switch displays to satic
prepare.emit()
# as soon as the player dismisses this chat the game is afoot
GameManager.show_item("Broken TV Remote", broken_tv_remote)
GameManager.show_chat("[color=red]ALERT: Intruder Detected")
pass
func actually_gaming():
gaming.emit()

View file

@ -100,6 +100,7 @@ offset = Vector2(320, 180)
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Chat" type="PanelContainer" parent="CanvasLayer" node_paths=PackedStringArray("rich_label")]
visible = false
custom_minimum_size = Vector2(500, 0)
anchors_preset = 7
anchor_left = 0.5
@ -135,6 +136,7 @@ text = "Press Enter..."
label_settings = SubResource("LabelSettings_daj04")
[node name="Item Get Popup" type="PanelContainer" parent="CanvasLayer" node_paths=PackedStringArray("texture_rect", "label")]
visible = false
custom_minimum_size = Vector2(200, 200)
anchors_preset = 8
anchor_left = 0.5
@ -172,6 +174,7 @@ horizontal_alignment = 1
layout_mode = 2
size_flags_vertical = 3
texture = ExtResource("11_j5hk1")
expand_mode = 2
stretch_mode = 5
[node name="Label2" type="RichTextLabel" parent="CanvasLayer/Item Get Popup/MarginContainer/VBoxContainer"]

25
games/platformer/door.gd Normal file
View file

@ -0,0 +1,25 @@
extends AnimatableBody2D
@export var open_pos_y : float
@export var close_pos_y : float
@export var open : bool = true
@export var move_speed : float = 2
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
GameManager.gaming.connect(close_door)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
if(open):
position.y = clampf(position.y - delta*move_speed, open_pos_y, close_pos_y)
else:
position.y = clampf(position.y + delta*move_speed, open_pos_y, close_pos_y)
func open_door():
open = true
func close_door():
open = false

View file

@ -0,0 +1 @@
uid://dwahwijlkceyr

View file

@ -0,0 +1,18 @@
[gd_scene load_steps=4 format=3 uid="uid://dv4ex5tshavff"]
[ext_resource type="Script" uid="uid://dwahwijlkceyr" path="res://games/platformer/door.gd" id="1_ddehx"]
[ext_resource type="Texture2D" uid="uid://03rvlxisf6x0" path="res://sprites/bigDoor.png" id="1_s27vo"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ddehx"]
size = Vector2(32, 96)
[node name="Door" type="AnimatableBody2D"]
z_index = -1
script = ExtResource("1_ddehx")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(2, 2)
texture = ExtResource("1_s27vo")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_ddehx")

View file

@ -10,6 +10,7 @@ var becoming_real : bool = false
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
GameManager.gaming.connect(fade_in)
starting_y = position.y

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=20 format=4 uid="uid://ckbyiwy0dxbsd"]
[gd_scene load_steps=30 format=4 uid="uid://ckbyiwy0dxbsd"]
[ext_resource type="Script" uid="uid://dqyddqx8xm0gw" path="res://games/platformer/player.gd" id="1_1wj3w"]
[ext_resource type="Texture2D" uid="uid://diilj7xuttpqu" path="res://icon.svg" id="1_oyf6i"]
@ -9,6 +9,11 @@
[ext_resource type="Script" uid="uid://43jxroyergh0" path="res://games/platformer/platformerCam.gd" id="5_x2rtd"]
[ext_resource type="Texture2D" uid="uid://dyjxtuapxfiip" path="res://sprites/box.png" id="6_02uuf"]
[ext_resource type="PackedScene" uid="uid://bgpoql6pt8pph" path="res://games/platformer/event.tscn" id="8_gqvfi"]
[ext_resource type="Texture2D" uid="uid://b2girwlk6ijy5" path="res://sprites/bigRemote.png" id="10_cpnel"]
[ext_resource type="Script" uid="uid://bs0xmxrplimpf" path="res://games/platformer/trip_animation.gd" id="10_vuxiy"]
[ext_resource type="Texture2D" uid="uid://r71wb0u4bsxw" path="res://sprites/broken_tv_remote.png" id="11_vuxiy"]
[ext_resource type="Script" uid="uid://bl7sx7fl7ye4a" path="res://games/platformer/tv_remote.gd" id="13_7gl5q"]
[ext_resource type="PackedScene" uid="uid://dv4ex5tshavff" path="res://games/platformer/door.tscn" id="14_yphhh"]
[sub_resource type="Gradient" id="Gradient_1wj3w"]
offsets = PackedFloat32Array(0.0209205, 1)
@ -50,6 +55,131 @@ size = Vector2(32, 32)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7eu3u"]
size = Vector2(20, 150)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_cpnel"]
[sub_resource type="Animation" id="Animation_7gl5q"]
resource_name = "trip"
length = 0.8
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationProps/TVRemote:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.133333, 0.266667, 0.4, 0.533333, 0.666667),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Vector2(40, 272), Vector2(112, 208), Vector2(152, 184), Vector2(200, 208), Vector2(240, 248), Vector2(256.09, 281.105)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationProps/TVRemote:rotation")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.666667),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 18.8496]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimationProps/TVRemote:frame")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 0.666667),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [0, 1]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimationProps/TVRemote:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.0333333),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
[sub_resource type="Animation" id="Animation_yphhh"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("AnimationProps/TVRemote:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector2(40, 272)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationProps/TVRemote:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [1]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("AnimationProps/TVRemote:rotation")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("AnimationProps/TVRemote:visible")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_mauky"]
_data = {
&"RESET": SubResource("Animation_yphhh"),
&"trip": SubResource("Animation_7gl5q")
}
[sub_resource type="SpriteFrames" id="SpriteFrames_mwuuv"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("10_cpnel")
}, {
"duration": 1.0,
"texture": ExtResource("11_vuxiy")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="Platformer" type="Node"]
[node name="Parallax2D" type="Parallax2D" parent="."]
@ -97,13 +227,13 @@ tile_map_data = PackedByteArray("AAAAAAkAAAAAAAAAAAABAAkAAAAAAAAAAAACAAkAAAAAAAA
tile_set = SubResource("TileSet_x2rtd")
[node name="LabPlatformer" parent="." instance=ExtResource("4_w58m1")]
position = Vector2(112, 208)
position = Vector2(128, 208)
[node name="LabPlatformer2" parent="." instance=ExtResource("4_w58m1")]
position = Vector2(496, 208)
position = Vector2(512, 208)
[node name="LabPlatformer3" parent="." instance=ExtResource("4_w58m1")]
position = Vector2(368, 112)
position = Vector2(400, 112)
[node name="LabPlatformer4" parent="." instance=ExtResource("4_w58m1")]
position = Vector2(240, 112)
@ -144,4 +274,40 @@ position = Vector2(32, 248)
[node name="CollisionShape2D" type="CollisionShape2D" parent="TheBitWhereYouTrip"]
shape = SubResource("RectangleShape2D_7eu3u")
[node name="BrokenRemote" type="Area2D" parent="."]
position = Vector2(256, 280)
[node name="CollisionShape2D" type="CollisionShape2D" parent="BrokenRemote"]
shape = SubResource("RectangleShape2D_cpnel")
[node name="TripAnimation" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_mauky")
}
script = ExtResource("10_vuxiy")
[node name="AnimationProps" type="Node2D" parent="."]
[node name="TVRemote" type="AnimatedSprite2D" parent="AnimationProps"]
visible = false
position = Vector2(40, 272)
scale = Vector2(0.1, 0.1)
sprite_frames = SubResource("SpriteFrames_mwuuv")
frame = 1
script = ExtResource("13_7gl5q")
[node name="Door" parent="." instance=ExtResource("14_yphhh")]
position = Vector2(16, 152)
open_pos_y = 152.0
close_pos_y = 240.0
move_speed = 1000.0
[node name="Door2" parent="." instance=ExtResource("14_yphhh")]
position = Vector2(624, 152)
open_pos_y = 152.0
close_pos_y = 240.0
move_speed = 1000.0
[connection signal="area_entered" from="Player/hitbox" to="Player" method="_on_hitbox_area_entered"]
[connection signal="area_entered" from="TheBitWhereYouTrip" to="TripAnimation" method="_on_the_bit_where_you_trip_area_entered"]
[connection signal="area_entered" from="BrokenRemote" to="AnimationProps/TVRemote" method="_on_broken_remote_area_entered"]

View file

@ -5,6 +5,7 @@ extends Camera2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
GameManager.prepare.connect(start_arena_cam)
pass # Replace with function body.
@ -12,12 +13,12 @@ func _ready() -> void:
func _process(delta: float) -> void:
if(following):
global_position = target.global_position
if(Input.is_action_just_pressed("ui_right")):
start_arena_cam()
#if(Input.is_action_just_pressed("ui_right")):
#start_arena_cam()
pass
func start_arena_cam():
print("weh!")
#print("weh!")
following = false
position = Vector2(320,180)
#offset = Vector2(0,0)

View file

@ -39,20 +39,27 @@ func _on_hitbox_area_entered(area: Area2D) -> void:
#print(area.name)
if(area.name == "Box"):
#GameManager.play_zoom_out()
area.monitoring = false
area.queue_free()
GameManager.show_item("TV Remote", remote_sprite)
GameManager.show_chat("Wonder what i can do with this")
if(is_instance_of(area,Event)):
#GameManager.play_zoom_out()
area.monitoring = false
area.queue_free()
if(area.type == Event.Type.Chat):
GameManager.show_chat(area.text)
elif(area.type == Event.Type.Item):
GameManager.show_item(area.text, area.texture)
if(area.name == "Zoomer"):
area.queue_free()
GameManager.play_zoom_out()
GameManager.show_chat("I guess it did something..?")
if(area.name == "TheBitWhereYouTrip"):
area.queue_free()
GameManager.show_chat("Ouch, I tripped")
if(area.name == "BrokenRemote"):
area.queue_free()
GameManager.prepare_for_gaming()
#GameManager.play_zoom_out()
#box event

View file

@ -0,0 +1,15 @@
extends AnimationPlayer
# 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
func _on_the_bit_where_you_trip_area_entered(area: Area2D) -> void:
play("trip")

View file

@ -0,0 +1 @@
uid://bs0xmxrplimpf

View file

@ -0,0 +1,18 @@
extends AnimatedSprite2D
# 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
func _on_broken_remote_area_entered(area: Area2D) -> void:
queue_free()

View file

@ -0,0 +1 @@
uid://bl7sx7fl7ye4a

View file

@ -14,6 +14,8 @@ func _process(delta: float) -> void:
visible = active
if(Input.is_action_just_pressed("advance_prompt")):
hidePopup()
if(label.text == "Broken TV Remote"):
GameManager.actually_gaming()
func showPopup(item_name : String, item_texture : Texture):
label.text = item_name

BIN
sprites/bigDoor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://03rvlxisf6x0"
path="res://.godot/imported/bigDoor.png-8f21fe01c6bf3eae9888a70f0e94afba.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/bigDoor.png"
dest_files=["res://.godot/imported/bigDoor.png-8f21fe01c6bf3eae9888a70f0e94afba.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

BIN
sprites/bigRemote.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b2girwlk6ijy5"
path="res://.godot/imported/bigRemote.png-0fed164755ceac3f9d7254018369b164.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/bigRemote.png"
dest_files=["res://.godot/imported/bigRemote.png-0fed164755ceac3f9d7254018369b164.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

BIN
sprites/doorTile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dhgfs8rfr7qq4"
path="res://.godot/imported/doorTile.png-25f24af846088a35a471b2109f1b69ae.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://sprites/doorTile.png"
dest_files=["res://.godot/imported/doorTile.png-25f24af846088a35a471b2109f1b69ae.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