Skip to content

Commit

Permalink
Added "Heal Points" (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
Woahsea authored Mar 26, 2023
1 parent 7ad9970 commit 8e6ffce
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 11 deletions.
17 changes: 6 additions & 11 deletions scenes/levels/Stardepths/0_stardepths_test.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[ext_resource path="res://scenes/decorations/DecorBasic.tscn" type="PackedScene" id=5]
[ext_resource path="res://scenes/enemies/DepthBlob.tscn" type="PackedScene" id=6]
[ext_resource path="res://scenes/enemies/BadCoin.tscn" type="PackedScene" id=7]
[ext_resource path="res://scenes/objects/StatsGate.tscn" type="PackedScene" id=8]
[ext_resource path="res://scenes/objects/HealPoint.tscn" type="PackedScene" id=8]
[ext_resource path="res://scenes/boxes/GreedyCoinBox.tscn" type="PackedScene" id=9]
[ext_resource path="res://scenes/Coin/Coin.tscn" type="PackedScene" id=10]
[ext_resource path="res://scenes/objects/CameraLimits.tscn" type="PackedScene" id=11]
Expand Down Expand Up @@ -116,10 +116,6 @@ position = Vector2( -1024, 160 )

[node name="Objects" type="Node" parent="."]

[node name="StatsGate" parent="Objects" instance=ExtResource( 8 )]
position = Vector2( 2528, -416 )
resetValue = 10

[node name="GreedyCoinBox" parent="Objects" instance=ExtResource( 9 )]
position = Vector2( 368, -96 )
player_coin_limit = 10
Expand Down Expand Up @@ -147,15 +143,17 @@ position = Vector2( 424, 0 )
[node name="Coin6" parent="Objects" instance=ExtResource( 10 )]
position = Vector2( 312, 0 )

[node name="HealPoint" parent="Objects" instance=ExtResource( 8 )]
position = Vector2( 2496, -352 )

[node name="Decorations" type="Node" parent="."]

[node name="BasicDecoration" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 1168, -288 )
frame = 3

[node name="BasicDecoration6" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 1392, -384 )
frame = 2
frame = 0

[node name="BasicDecoration8" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 1872, -352 )
Expand All @@ -175,22 +173,18 @@ frame = 0
[node name="BasicDecoration12" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 104, 8 )
animation = "float_star"
frame = 7

[node name="BasicDecoration13" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 784, 112 )
animation = "float_star"
frame = 7

[node name="BasicDecoration14" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 2648, -448 )
animation = "float_star"
frame = 7

[node name="BasicDecoration15" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 752, -352 )
animation = "float_star"
frame = 7

[node name="BasicDecoration11" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 2320, -352 )
Expand All @@ -199,6 +193,7 @@ frame = 0

[node name="BasicDecoration7" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 1120, -416 )
frame = 4

[node name="BasicDecoration2" parent="Decorations" instance=ExtResource( 5 )]
position = Vector2( 1328, -224 )
Expand Down
41 changes: 41 additions & 0 deletions scenes/objects/HealPoint.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[gd_scene load_steps=6 format=2]

[ext_resource path="res://sprites/particles/HealPointHeart.png" type="Texture" id=1]
[ext_resource path="res://scripts/objects/HealPoint.gd" type="Script" id=2]

[sub_resource type="Curve" id=2]
_data = [ Vector2( 0, 0 ), 0.0, 1.9381, 0, 0, Vector2( 0.131579, 1 ), 20.4941, 0.0, 0, 0, Vector2( 0.921053, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.190909 ), -18.3782, 0.0, 0, 0 ]

[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0.0123457, 0.152263, 0.753086, 1 )
colors = PoolColorArray( 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 )

[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 64, 80 )

[node name="HealPoint" type="Area2D"]
collision_layer = 0
collision_mask = 64
monitorable = false
script = ExtResource( 2 )

[node name="CPUParticles2D" type="CPUParticles2D" parent="."]
amount = 6
lifetime = 2.0
speed_scale = 0.75
texture = ExtResource( 1 )
emission_shape = 2
emission_rect_extents = Vector2( 48, 32 )
direction = Vector2( 0, 1 )
spread = 90.0
gravity = Vector2( 0, -60 )
initial_velocity = 30.0
initial_velocity_random = 0.5
scale_amount_curve = SubResource( 2 )
color_ramp = SubResource( 1 )

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -32 )
shape = SubResource( 3 )

[connection signal="body_entered" from="." to="." method="_body_entered"]
4 changes: 4 additions & 0 deletions scripts/objects/HealPoint.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends Area2D

func _body_entered(body):
HeartInventoryHandle.change_hearts_on(body, 99)
Binary file added sprites/particles/HealPointHeart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions sprites/particles/HealPointHeart.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/HealPointHeart.png-8ec51f621312cc5bedc69312b8505241.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://sprites/particles/HealPointHeart.png"
dest_files=[ "res://.import/HealPointHeart.png-8ec51f621312cc5bedc69312b8505241.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

1 comment on commit 8e6ffce

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.