Skip to content

Commit

Permalink
feat/shrink-over-portal (#56)
Browse files Browse the repository at this point in the history
* Added 'readme.txt' with link to water shader

* Player shrinks when he enters a portal

Co-authored-by: Telmo Valverde <[email protected]>
  • Loading branch information
telmotrooper and telmotrooper authored May 24, 2022
1 parent eef9a0d commit 9f47be5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
36 changes: 35 additions & 1 deletion entities/player/player.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=11 format=2]

[ext_resource path="res://entities/player/player.glb" type="PackedScene" id=1]
[ext_resource path="res://entities/player/player.gd" type="Script" id=2]
Expand Down Expand Up @@ -54,6 +54,36 @@ tracks/0/keys = {
"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 720, 0 ) ]
}

[sub_resource type="Animation" id=6]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath("Pivot/Character:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector3( 1, 0.999999, 0.999999 ) ]
}

[sub_resource type="Animation" id=7]
resource_name = "shrink"
tracks/0/type = "value"
tracks/0/path = NodePath("Pivot/Character:scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector3( 1, 0.999999, 0.999999 ), Vector3( 0, 0, 0 ) ]
}

[sub_resource type="CylinderShape" id=5]

[node name="Player" type="KinematicBody"]
Expand Down Expand Up @@ -84,6 +114,10 @@ autoplay = "float"
anims/float = SubResource( 3 )
anims/spin-y = SubResource( 4 )

[node name="EffectsAnimationPlayer" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 6 )
anims/shrink = SubResource( 7 )

[node name="CameraPivot" type="Spatial" parent="."]
script = ExtResource( 3 )

Expand Down
1 change: 1 addition & 0 deletions maps/portal_placeholder.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ extends CSGCylinder
export var map_name: String

func _on_Portal_entered(_body):
GameState.Player.get_node("EffectsAnimationPlayer").play("shrink")
GameState.change_map(map_name)
2 changes: 2 additions & 0 deletions shaders/stylized_water/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://godotshaders.com/shader/stylized-water-with-depthfade/

0 comments on commit 9f47be5

Please sign in to comment.