Skip to content

Commit

Permalink
feat/house-keeping-2 (#59)
Browse files Browse the repository at this point in the history
* Fixed bug in PurpleEnemy

* Moved portal to new folder 'props' and added logic to play sound on teleport. No sound ready yet.

Co-authored-by: Telmo Valverde <[email protected]>
  • Loading branch information
telmotrooper and telmotrooper authored May 25, 2022
1 parent 18a0262 commit f0dea75
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 11 deletions.
4 changes: 2 additions & 2 deletions entities/enemy/blue_enemy.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ tracks/2/keys = {
} ]
}

[sub_resource type="SpatialMaterial" id=4]
[sub_resource type="SpatialMaterial" id=6]
flags_transparent = true
params_billboard_mode = 1
albedo_texture = ExtResource( 5 )

[sub_resource type="QuadMesh" id=5]
material = SubResource( 4 )
material = SubResource( 6 )
size = Vector2( 1.5, 1.5 )

[node name="BlueEnemy" type="KinematicBody" groups=["enemies"]]
Expand Down
30 changes: 25 additions & 5 deletions entities/enemy/purple_enemy.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=8 format=2]
[gd_scene load_steps=11 format=2]

[ext_resource path="res://entities/enemy/blue_enemy.gd" type="Script" id=1]
[ext_resource path="res://entities/enemy/purple_enemy.glb" type="PackedScene" id=2]
[ext_resource path="res://entities/enemy/prism_area.tscn" type="PackedScene" id=3]
[ext_resource path="res://art/slime_jump.ogg" type="AudioStream" id=4]
[ext_resource path="res://entities/enemy/exclamation_mark.png" type="Texture" id=5]

[sub_resource type="BoxShape" id=1]
extents = Vector3( 1, 1.20057, 1 )
Expand Down Expand Up @@ -78,6 +79,15 @@ tracks/2/keys = {
} ]
}

[sub_resource type="SpatialMaterial" id=4]
flags_transparent = true
params_billboard_mode = 1
albedo_texture = ExtResource( 5 )

[sub_resource type="QuadMesh" id=5]
material = SubResource( 4 )
size = Vector2( 1.5, 1.5 )

[node name="PurpleEnemy" type="KinematicBody" groups=["enemies"]]
transform = Transform( 6, 0, 0, 0, 6, 0, 0, 0, 6, 0, 0, 0 )
collision_layer = 2
Expand All @@ -100,16 +110,26 @@ shape = SubResource( 1 )
transform = Transform( 1.21071, 0, 0, 0, 1, 0, 0, 0, 1.7127, 0, 0, 0.28548 )
visible = false

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "float"
anims/float = SubResource( 2 )
anims/squash = SubResource( 3 )

[node name="PrismArea" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, -3 )
visible = false
monitoring = false
monitorable = false

[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "float"
anims/float = SubResource( 2 )
anims/squash = SubResource( 3 )
[node name="AlertTimer" type="Timer" parent="."]
one_shot = true

[node name="ExclamationMark" type="MeshInstance" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.2, 0 )
visible = false
mesh = SubResource( 5 )
material/0 = null

[connection signal="screen_exited" from="VisibilityNotifier" to="." method="_on_VisibilityNotifier_screen_exited"]
[connection signal="body_entered" from="PrismArea" to="." method="_on_PrismArea_body_entered"]
[connection signal="timeout" from="AlertTimer" to="." method="_on_AlertTimer_timeout"]
2 changes: 1 addition & 1 deletion maps/mountain_map.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
[ext_resource path="res://entities/enemy/blue_enemy.tscn" type="PackedScene" id=9]
[ext_resource path="res://models/ball/ball.tscn" type="PackedScene" id=10]
[ext_resource path="res://models/red_button/red_button.tscn" type="PackedScene" id=11]
[ext_resource path="res://maps/portal_placeholder.tscn" type="PackedScene" id=12]
[ext_resource path="res://props/portal/portal_placeholder.tscn" type="PackedScene" id=12]
[ext_resource path="res://models/height_map/Material.material" type="Material" id=13]

[sub_resource type="Curve3D" id=1]
Expand Down
5 changes: 3 additions & 2 deletions maps/test_map.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[ext_resource path="res://models/goweti/goweti.tscn" type="PackedScene" id=18]
[ext_resource path="res://models/red_button/red_button.tscn" type="PackedScene" id=19]
[ext_resource path="res://entities/enemy/purple_enemy.tscn" type="PackedScene" id=20]
[ext_resource path="res://maps/portal_placeholder.tscn" type="PackedScene" id=21]
[ext_resource path="res://props/portal/portal_placeholder.tscn" type="PackedScene" id=21]

[sub_resource type="BoxShape" id=3]
extents = Vector3( 30, 1, 30 )
Expand Down Expand Up @@ -223,7 +223,8 @@ modifier_stack = Object(Node,"_import_path":NodePath(""),"pause_mode":0,"process
)
, Object(Node,"_import_path":NodePath(""),"pause_mode":0,"process_priority":0,"script":Resource( "res://addons/scatter/src/modifiers/randomize_transforms.gd" ),"enabled":true,"display_name":"Randomize Transforms","category":"Edit","warning":"","warning_ignore_no_transforms":false,"warning_ignore_no_path":true,"override_global_seed":false,"custom_seed":0,"local_space":true,"position":Vector3( 0, 0, 0 ),"rotation":Vector3( 0, 180, 0 ),"scale":Vector3( 1, 1, 1 ),"_rng":Object(RandomNumberGenerator,"seed":5570693362334884271,"state":3772973385647095650,"script":null)
)
],"just_created":false,"undo_redo":null)
],"just_created":false,"undo_redo":Object(UndoRedo,"script":null)
)


[node name="ScatterItem" type="Spatial" parent="Map/Grass"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ extends CSGCylinder
export var map_name: String

func _on_Portal_entered(_body):
#$AudioStreamPlayer.play()
GameState.Player.get_node("EffectsAnimationPlayer").play("shrink")
GameState.change_map(map_name)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=2]

[ext_resource path="res://maps/portal_placeholder.gd" type="Script" id=1]
[ext_resource path="res://props/portal/portal_placeholder.gd" type="Script" id=1]

[sub_resource type="SpatialMaterial" id=19]
albedo_color = Color( 0.639216, 0.141176, 0.141176, 1 )
Expand All @@ -24,4 +24,7 @@ monitorable = false
transform = Transform( 3, 0, 0, 0, 0.25, 0, 0, 0, 3, 0, 0, 0 )
shape = SubResource( 20 )

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
bus = "Sound"

[connection signal="body_entered" from="Area" to="." method="_on_Portal_entered"]

0 comments on commit f0dea75

Please sign in to comment.