portal 2 still alive

This commit is contained in:
pennyrigate 2025-03-06 21:12:36 -05:00
parent 2f9f4877d9
commit 07eb3ed129
17 changed files with 311 additions and 7 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=27 format=3 uid="uid://bwtpsjpe2lf7l"]
[gd_scene load_steps=35 format=3 uid="uid://bwtpsjpe2lf7l"]
[ext_resource type="Script" uid="uid://dhyi4yn0xleoy" path="res://objects/player/player.gd" id="1_xs4s5"]
[ext_resource type="Texture2D" uid="uid://c71nqfyw4a3v4" path="res://assets/textures/player/capri.png" id="3_trcll"]
@ -14,6 +14,11 @@
[ext_resource type="AudioStream" uid="uid://7be7ts3rdegh" path="res://assets/audio/vox/capri_jump.ogg" id="9_8c74o"]
[ext_resource type="AudioStream" uid="uid://c6gck1lyk6aer" path="res://assets/audio/vox/capri_die3.ogg" id="9_ylcck"]
[ext_resource type="Script" uid="uid://cyvphy8py4ntr" path="res://addons/godot_state_charts/atomic_state.gd" id="10_mvu25"]
[ext_resource type="AudioStream" uid="uid://cquhska140wrt" path="res://assets/audio/vox/capri_whee.ogg" id="10_xlkbi"]
[ext_resource type="AudioStream" uid="uid://e3ptgegyv17" path="res://assets/audio/vox/capri_whee2.ogg" id="11_l55sg"]
[ext_resource type="AudioStream" uid="uid://bauqpxusk0p1i" path="res://assets/audio/vox/capri_whee3.ogg" id="12_28utn"]
[ext_resource type="AudioStream" uid="uid://bhr0uvens076m" path="res://assets/audio/sfx/se_turn2.ogg" id="13_yyeqs"]
[ext_resource type="AudioStream" uid="uid://c7b60nylv85rw" path="res://assets/audio/sfx/se_Attack.wav" id="14_l55sg"]
[sub_resource type="CircleShape2D" id="CircleShape2D_tvyy1"]
radius = 6.0
@ -30,6 +35,22 @@ stream_0/stream = ExtResource("5_bi5m7")
stream_1/stream = ExtResource("8_45rsp")
stream_2/stream = ExtResource("9_ylcck")
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_u8bnf"]
streams_count = 3
stream_0/stream = ExtResource("10_xlkbi")
stream_1/stream = ExtResource("11_l55sg")
stream_2/stream = ExtResource("12_28utn")
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_lc6id"]
random_pitch = 1.1
streams_count = 1
stream_0/stream = ExtResource("13_yyeqs")
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_28utn"]
random_pitch = 1.1
streams_count = 1
stream_0/stream = ExtResource("14_l55sg")
[sub_resource type="Resource" id="Resource_sfpnl"]
resource_name = "Not On Floor"
script = ExtResource("8_8i2im")
@ -167,6 +188,17 @@ bus = &"Capri"
stream = SubResource("AudioStreamRandomizer_x5bgp")
bus = &"Capri"
[node name="Whee" type="AudioStreamPlayer" parent="Sounds"]
stream = SubResource("AudioStreamRandomizer_u8bnf")
[node name="Wallkick" type="AudioStreamPlayer" parent="Sounds"]
stream = SubResource("AudioStreamRandomizer_lc6id")
volume_db = -20.0
[node name="HitWall" type="AudioStreamPlayer" parent="Sounds"]
stream = SubResource("AudioStreamRandomizer_28utn")
volume_db = -10.0
[node name="StateChart" type="Node" parent="."]
script = ExtResource("5_bcjtl")
initial_expression_properties = {
@ -365,9 +397,12 @@ delay_in_seconds = ".25"
[connection signal="state_entered" from="StateChart/Root/Airborne/Jumping" to="Graphics/Sprite/Jump" method="play"]
[connection signal="state_entered" from="StateChart/Root/Airborne/Jumping" to="Sounds/Jump" method="play"]
[connection signal="state_entered" from="StateChart/Root/Airborne/Missile" to="Graphics/Sprite/Missile" method="play"]
[connection signal="state_entered" from="StateChart/Root/Airborne/Missile" to="Sounds/Whee" method="play"]
[connection signal="state_entered" from="StateChart/Root/Airborne/Missile" to="Sounds/Wallkick" method="play"]
[connection signal="state_exited" from="StateChart/Root/Airborne/Missile" to="." method="_restore_graphics_rotation"]
[connection signal="state_physics_processing" from="StateChart/Root/Airborne/Missile" to="." method="_face_towards_velocity"]
[connection signal="state_physics_processing" from="StateChart/Root/Airborne/Missile" to="." method="_check_for_splat"]
[connection signal="taken" from="StateChart/Root/Airborne/Missile/on Splatted" to="Sounds/HitWall" method="play"]
[connection signal="state_entered" from="StateChart/Root/Floating/Splat" to="Graphics/Sprite/Splat" method="play"]
[connection signal="taken" from="StateChart/Root/Floating/Splat/on JumpPressed" to="." method="_do_splat_launch"]
[connection signal="state_entered" from="StateChart/Root/Floating/UnSplat" to="Graphics/Sprite/UnSplat" method="play"]

16
objects/portal/portal.gd Normal file
View file

@ -0,0 +1,16 @@
extends Node2D
@export var connected_portal: NodePath
@onready var portal = get_node(connected_portal)
var check_for_bodies = true
func _on_area_2d_body_entered(body: Node2D) -> void:
if body is Player && check_for_bodies:
body.global_position = portal.global_position
body.launch(body.velocity * 1.25)
portal.check_for_bodies = false
func _on_area_2d_body_exited(body: Node2D) -> void:
await get_tree().create_timer(0.1).timeout
check_for_bodies = true

View file

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

View file

@ -0,0 +1,67 @@
[gd_scene load_steps=7 format=3 uid="uid://cypj35yv5auuc"]
[ext_resource type="Script" uid="uid://dbrblyk7xttpj" path="res://objects/portal/portal.gd" id="1_v7atq"]
[ext_resource type="Texture2D" uid="uid://dtwp3ohanw2sn" path="res://assets/textures/portal/portal.png" id="2_ah4id"]
[sub_resource type="Animation" id="Animation_xxtm7"]
resource_name = "spin"
length = 0.5
loop_mode = 1
step = 0.25
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 6.28319]
}
[sub_resource type="Animation" id="Animation_0po8f"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_6y8yo"]
_data = {
&"RESET": SubResource("Animation_0po8f"),
&"spin": SubResource("Animation_xxtm7")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_v7atq"]
size = Vector2(16, 16)
[node name="Portal" type="Node2D"]
script = ExtResource("1_v7atq")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_ah4id")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_6y8yo")
}
autoplay = "spin"
[node name="Area2D" type="Area2D" parent="."]
collision_mask = 16
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("RectangleShape2D_v7atq")
[connection signal="body_entered" from="Area2D" to="." method="_on_area_2d_body_entered"]
[connection signal="body_exited" from="Area2D" to="." method="_on_area_2d_body_exited"]