egtting there
This commit is contained in:
parent
f16d046a6c
commit
35db2250f7
23 changed files with 395 additions and 11 deletions
25
games/platformer/door.gd
Normal file
25
games/platformer/door.gd
Normal 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
|
||||
1
games/platformer/door.gd.uid
Normal file
1
games/platformer/door.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dwahwijlkceyr
|
||||
18
games/platformer/door.tscn
Normal file
18
games/platformer/door.tscn
Normal 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")
|
||||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
15
games/platformer/trip_animation.gd
Normal file
15
games/platformer/trip_animation.gd
Normal 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")
|
||||
1
games/platformer/trip_animation.gd.uid
Normal file
1
games/platformer/trip_animation.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bs0xmxrplimpf
|
||||
18
games/platformer/tv_remote.gd
Normal file
18
games/platformer/tv_remote.gd
Normal 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()
|
||||
1
games/platformer/tv_remote.gd.uid
Normal file
1
games/platformer/tv_remote.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bl7sx7fl7ye4a
|
||||
Loading…
Add table
Add a link
Reference in a new issue