Skip to content

Commit

Permalink
add particles and colony animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Semnor committed May 1, 2023
1 parent bd2594e commit 11a50c1
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 19 deletions.
36 changes: 31 additions & 5 deletions Sick_Day_Delivery/Scenes/colony.tscn
Original file line number Diff line number Diff line change
@@ -1,13 +1,38 @@
[gd_scene load_steps=6 format=3 uid="uid://cl3gneduvqjdn"]
[gd_scene load_steps=9 format=3 uid="uid://cl3gneduvqjdn"]

[ext_resource type="Script" path="res://Scripts/colony.gd" id="1_7606h"]
[ext_resource type="PackedScene" uid="uid://bshn0kdmpqbnj" path="res://Scenes/bacterium.tscn" id="2_fxxkw"]
[ext_resource type="Script" path="res://Scripts/ColonyTimer.gd" id="3_pkowl"]
[ext_resource type="Texture2D" uid="uid://dhuvgmi3gk51t" path="res://Sprites/BacteriumPlaceholderOpen.png" id="4_w31ri"]
[ext_resource type="Texture2D" uid="uid://c7mctw3a8v2vt" path="res://Sprites/ColonySpriteOpen.png" id="4_dil1y"]
[ext_resource type="Texture2D" uid="uid://b3ggt8q855jj5" path="res://Sprites/ColonySpriteClosing.png" id="5_capt4"]
[ext_resource type="Texture2D" uid="uid://clqann34s4y8d" path="res://Sprites/ColonySpriteBlink.png" id="6_1r17b"]

[sub_resource type="CircleShape2D" id="CircleShape2D_c51ot"]
radius = 34.2345

[sub_resource type="SpriteFrames" id="SpriteFrames_e4qsp"]
animations = [{
"frames": [{
"duration": 15.0,
"texture": ExtResource("4_dil1y")
}, {
"duration": 0.75,
"texture": ExtResource("5_capt4")
}, {
"duration": 1.0,
"texture": ExtResource("6_1r17b")
}, {
"duration": 0.75,
"texture": ExtResource("5_capt4")
}, {
"duration": 15.0,
"texture": ExtResource("4_dil1y")
}],
"loop": true,
"name": &"Blink",
"speed": 10.0
}]

[node name="colony" type="Area2D"]
position = Vector2(609, 726)
script = ExtResource("1_7606h")
Expand All @@ -18,13 +43,14 @@ metadata/_edit_group_ = true
autostart = true
script = ExtResource("3_pkowl")

[node name="ColonySprite" type="Sprite2D" parent="."]
texture = ExtResource("4_w31ri")

[node name="ColonyCollider" type="CollisionShape2D" parent="."]
position = Vector2(9, 7)
shape = SubResource("CircleShape2D_c51ot")

[node name="ColonyAnimation" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_e4qsp")
animation = &"Blink"

[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_exited" from="." to="." method="_on_body_exited"]
[connection signal="timeout" from="ColonyTimer" to="." method="_on_colony_timer_timeout"]
7 changes: 4 additions & 3 deletions Sick_Day_Delivery/Scenes/main.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://dyuaql73pytmx"]
[gd_scene load_steps=10 format=3 uid="uid://b4xi3mlkhu4ow"]

[ext_resource type="PackedScene" uid="uid://bhh5dmfulsc0f" path="res://Scenes/body_map.tscn" id="1_6xrru"]
[ext_resource type="Script" path="res://Scripts/main.gd" id="1_mnr5t"]
Expand All @@ -8,7 +8,7 @@
[ext_resource type="PackedScene" uid="uid://q78nn6ov4tkl" path="res://Scenes/infection_spawner.tscn" id="7_sg8fw"]
[ext_resource type="PackedScene" uid="uid://cl3gneduvqjdn" path="res://Scenes/colony.tscn" id="8_nndff"]
[ext_resource type="PackedScene" uid="uid://by2kd0e26letn" path="res://Scenes/HUD.tscn" id="8_to7ic"]
[ext_resource type="PackedScene" uid="uid://ccvpanj0i8wfv" path="res://Scenes/pause_menu.tscn" id="9_y16aj"]
[ext_resource type="PackedScene" path="res://Scenes/pause_menu.tscn" id="9_y16aj"]

[node name="Node2D" type="Node2D"]
script = ExtResource("1_mnr5t")
Expand Down Expand Up @@ -44,7 +44,6 @@ position = Vector2(1571, 1134)
[node name="Left_Elbow" type="Node2D" parent="infection_spawner/SpawnPoints"]
position = Vector2(2103, 1754)

[node name="PauseMenu" parent="." instance=ExtResource("9_y16aj")]
[node name="Right_Elbow" type="Node2D" parent="infection_spawner/SpawnPoints"]
position = Vector2(899, 1705)

Expand All @@ -65,3 +64,5 @@ position = Vector2(1510, 1969)

[node name="Mid_Torso" type="Node2D" parent="infection_spawner/SpawnPoints"]
position = Vector2(1554, 1541)

[node name="PauseMenu" parent="." instance=ExtResource("9_y16aj")]
46 changes: 37 additions & 9 deletions Sick_Day_Delivery/Scenes/player_cell.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,32 @@

[ext_resource type="Script" path="res://Scripts/player_cell.gd" id="1_aui7q"]
[ext_resource type="Texture2D" uid="uid://bgfxom1a4pd4b" path="res://Sprites/Pill_PlaceholderOpen.png" id="2_cb6xu"]
[ext_resource type="Texture2D" uid="uid://d1spj261c4q8f" path="res://Sprites/Pill_Placeholder.png" id="2_juu6w"]
[ext_resource type="Texture2D" uid="uid://dpsrjkbs785cv" path="res://Sprites/Pill_PlaceholderClosing.png" id="3_b0xxo"]
[ext_resource type="Texture2D" uid="uid://dpxwmtk4ldmci" path="res://Sprites/Pill_PlaceholderBlink.png" id="4_h4bqs"]
[ext_resource type="PackedScene" uid="uid://dda8sqvfl2s8l" path="res://Scenes/bacteria_indicator.tscn" id="5_f10cd"]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_2k2cv"]
radius = 40.0
height = 140.0

[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_7ckoj"]
lifetime_randomness = 0.5
particle_flag_disable_z = true
direction = Vector3(1, 1, 0)
spread = 180.0
gravity = Vector3(0, 0, 0)
initial_velocity_min = 300.0
initial_velocity_max = 300.0
angular_velocity_max = 100.0
orbit_velocity_min = 0.0
orbit_velocity_max = 0.0
angle_max = 360.0
scale_min = 0.02
scale_max = 0.08
hue_variation_min = -0.37
hue_variation_max = 0.24

[sub_resource type="SpriteFrames" id="SpriteFrames_lf3au"]
animations = [{
"frames": [{
Expand All @@ -29,22 +51,13 @@ animations = [{
"speed": 10.0
}]

[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_2k2cv"]
radius = 40.0
height = 140.0

[node name="PlayerCell" type="CharacterBody2D" groups=["Player"]]
scale = Vector2(0.1, 0.1)
motion_mode = 1
wall_min_slide_angle = 0.0174533
script = ExtResource("1_aui7q")
metadata/_edit_group_ = true

[node name="PlayerAnimation" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_lf3au")
frame = 4
frame_progress = 0.895432

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CapsuleShape2D_2k2cv")

Expand All @@ -57,3 +70,18 @@ limit_bottom = 5000
position_smoothing_speed = 10.0

[node name="bacteria_indicator" parent="." instance=ExtResource("5_f10cd")]
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
emitting = false
amount = 20
process_material = SubResource("ParticleProcessMaterial_7ckoj")
texture = ExtResource("2_juu6w")
one_shot = true
explosiveness = 1.0
randomness = 0.75
visibility_rect = Rect2(0, 0, 0, 0)

[node name="PlayerAnimation" type="AnimatedSprite2D" parent="."]
scale = Vector2(1, 1)
sprite_frames = SubResource("SpriteFrames_lf3au")
frame = 4
frame_progress = 0.895432
4 changes: 2 additions & 2 deletions Sick_Day_Delivery/Scripts/colony.gd
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ var colony_ded = false

# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
$ColonyAnimation.play("Blink")


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_pressed("cure") && colliding:
$ColonySprite.hide()
$ColonyAnimation.hide()
process_priority = 0
if self.get_children().size() == 3 && process_priority == 0:
print_debug("colony destroyed")
Expand Down
6 changes: 6 additions & 0 deletions Sick_Day_Delivery/Scripts/player_cell.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ func _physics_process(delta):
var collision = get_slide_collision(i)
# print_debug(collision.get_collider().name)

if Input.is_action_just_pressed("cure"):
if $GPUParticles2D.emitting == false:
$GPUParticles2D.restart()
$GPUParticles2D.emitting = true
# if Input.is_action_just_released("cure"):
# $GPUParticles2D.emitting = false
Binary file added Sick_Day_Delivery/Sprites/ColonySpriteBlink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Sick_Day_Delivery/Sprites/ColonySpriteBlink.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://clqann34s4y8d"
path="res://.godot/imported/ColonySpriteBlink.png-fac7703935a44361d3e68a81495ce882.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Sprites/ColonySpriteBlink.png"
dest_files=["res://.godot/imported/ColonySpriteBlink.png-fac7703935a44361d3e68a81495ce882.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added Sick_Day_Delivery/Sprites/ColonySpriteClosing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Sick_Day_Delivery/Sprites/ColonySpriteClosing.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b3ggt8q855jj5"
path="res://.godot/imported/ColonySpriteClosing.png-05f24a63104100926c625e7da19a892a.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Sprites/ColonySpriteClosing.png"
dest_files=["res://.godot/imported/ColonySpriteClosing.png-05f24a63104100926c625e7da19a892a.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added Sick_Day_Delivery/Sprites/ColonySpriteOpen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Sick_Day_Delivery/Sprites/ColonySpriteOpen.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c7mctw3a8v2vt"
path="res://.godot/imported/ColonySpriteOpen.png-a62042cdce9cd23cf3e03e3ab4097a40.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Sprites/ColonySpriteOpen.png"
dest_files=["res://.godot/imported/ColonySpriteOpen.png-a62042cdce9cd23cf3e03e3ab4097a40.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

0 comments on commit 11a50c1

Please sign in to comment.