diff --git a/Travesty/Ending/Shenron_Water.png b/Travesty/Ending/Shenron_Water.png new file mode 100644 index 0000000..1ca7b2a Binary files /dev/null and b/Travesty/Ending/Shenron_Water.png differ diff --git a/Travesty/Ending/Shenron_Water.png.import b/Travesty/Ending/Shenron_Water.png.import new file mode 100644 index 0000000..c919154 --- /dev/null +++ b/Travesty/Ending/Shenron_Water.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Shenron_Water.png-28a2de56f695ec9a6bb7dac5ed84c458.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Ending/Shenron_Water.png" +dest_files=[ "res://.import/Shenron_Water.png-28a2de56f695ec9a6bb7dac5ed84c458.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Fish/Fish.gd b/Travesty/Fish/Fish.gd index a0fca43..258b910 100644 --- a/Travesty/Fish/Fish.gd +++ b/Travesty/Fish/Fish.gd @@ -110,3 +110,7 @@ func _on_HungerTimer_timeout() -> void: belly_up("starvation") else: $HungerTimer.stop() + + +func _on_ThoughtTimer_timeout() -> void: + $ThoughtBubble.visible = false diff --git a/Travesty/Fish/Fish.tscn b/Travesty/Fish/Fish.tscn index 0b74321..f9d1444 100644 --- a/Travesty/Fish/Fish.tscn +++ b/Travesty/Fish/Fish.tscn @@ -23,6 +23,8 @@ height = 80.0 [sub_resource type="DynamicFont" id=4] size = 24 +outline_size = 1 +outline_color = Color( 0, 0, 0, 1 ) use_filter = true font_data = ExtResource( 4 ) @@ -36,7 +38,6 @@ swim_length = 200 position = Vector2( -12, -17 ) scale = Vector2( -0.5, 0.5 ) frames = SubResource( 3 ) -frame = 1 playing = true [node name="CollisionShape2D" type="CollisionShape2D" parent="."] @@ -82,7 +83,7 @@ one_shot = true [node name="Thought" type="RichTextLabel" parent="ThoughtBubble"] margin_left = -137.0 -margin_top = -172.0 +margin_top = -200.0 margin_right = 138.0 margin_bottom = -80.0 custom_colors/default_color = Color( 0.945098, 0.352941, 0.160784, 1 ) @@ -94,5 +95,10 @@ Must... resist... eating...!" text = "Wait, something's wrong with these flakes! Must... resist... eating...!" +[node name="ThoughtTimer" type="Timer" parent="ThoughtBubble"] +wait_time = 8.0 +one_shot = true + [connection signal="timeout" from="SwimTimer" to="." method="_on_SwimTimer_timeout"] [connection signal="timeout" from="HungerTimer" to="." method="_on_HungerTimer_timeout"] +[connection signal="timeout" from="ThoughtBubble/ThoughtTimer" to="." method="_on_ThoughtTimer_timeout"] diff --git a/Travesty/Hazards/Angler/Angler.gd b/Travesty/Hazards/Angler/Angler.gd index 275233c..37582f4 100644 --- a/Travesty/Hazards/Angler/Angler.gd +++ b/Travesty/Hazards/Angler/Angler.gd @@ -1,22 +1,48 @@ extends Node2D export var hp : int = 3 # Number of hits before dying -export var dash_duration : int = 3 # Duration of charge tween in seconds +export var dash_duration : int = 2 # Duration of charge tween in seconds onready var fish = get_node("/root/Tank/Fish") +var charging = false + func _ready(): - pass + $ChargeTimer.start() + $Sprite.flip_h = true func _process(delta: float) -> void: - # look at fish like how Fish.tscn looks at get_global_mouse_position() in Fish.gd's _process - pass + var v + v = fish.get_global_position() - global_position + var angle = v.angle() + deg2rad(270) + if rad2deg(angle) < 180 or rad2deg(angle) > 360: + if not charging: + $Sprite.flip_v = true + elif not charging: + $Sprite.flip_v = false + var rotation_speed = PI * 0.75 # PI = 180 degrees + var angle_delta = rotation_speed * delta + angle = lerp_angle(global_rotation, angle + 1.57, 1.0) + angle = clamp(angle, global_rotation - angle_delta, global_rotation + angle_delta) + if not charging: + global_rotation = angle + func _on_ChargeTimer_timeout() -> void: - # $Tween self toward fish.get_global_position() - $Tween.interpolate_property(self, "position", get_global_position(), fish.get_global_position(), dash_duration, Tween.TRANS_CIRC, Tween.EASE_OUT_IN) - pass + var destination = $ChargeDestination.get_global_position() + print("destination=" + str(destination)) + destination.x = clamp(destination.x, 200, 1720) + destination.y = clamp(destination.y, 200, 880) + print("clamped destination=" + str(destination)) + print("position=" + str(position)) + print("global_pos=" + str(global_position)) + $Tween.interpolate_property(self, "position", global_position, destination, dash_duration, Tween.TRANS_EXPO, Tween.EASE_IN) + $Tween.start() + charging = true + yield($Tween, "tween_completed") + charging = false + $ChargeTimer.start() func _on_Hurtbox_area_entered(area: Area2D) -> void: @@ -28,18 +54,20 @@ func _on_Hurtbox_area_entered(area: Area2D) -> void: func _on_Hitbox_area_entered(area: Area2D) -> void: if area.is_in_group("Fish"): if fish.electrified: - hp -= 1 + hp-=1 #below is flash feedback on hit + $TweenColor.interpolate_property(self, "modulate", modulate, Color(0,0,0,1), .085) + $TweenColor.start() + yield($TweenColor, "tween_completed") + $TweenColor.interpolate_property(self, "modulate", modulate, Color(1,1,1,1), .085) + $TweenColor.start() if hp < 1: # kill angler _death() - else: # damage angler - # Modulate self across all white > yellow > black and maybe? - $TweenColor.interpolate_property(self, "modulate", modulate, Color(0,0,0,1)) - $Tween.start() func _death(): - # do something to make it obvious he died - # probably replacing his eyes with X_X's - # flipping him upside-down, maybe like: $AnimatedSprite.flip_v = true - # floating him to top ($Tween probably) - pass + $ChargeTimer.stop() #stop charging when dead + $Sprite.flip_v = true + charging = true #hack to stop rotating + $Tween.interpolate_property(self, "position", get_global_position(),Vector2(get_global_position().x,100), dash_duration, Tween.TRANS_LINEAR, Tween.EASE_IN) + # probably replacing his eyes with X_X's SKIP DO THIS + $Tween.start() diff --git a/Travesty/Hazards/Angler/Angler.tscn b/Travesty/Hazards/Angler/Angler.tscn index 3137002..9d0c1b1 100644 --- a/Travesty/Hazards/Angler/Angler.tscn +++ b/Travesty/Hazards/Angler/Angler.tscn @@ -8,6 +8,7 @@ radius = 25.0 height = 108.0 [node name="Angler" type="Node2D"] +position = Vector2( 133, 108 ) script = ExtResource( 1 ) [node name="Sprite" type="Sprite" parent="."] @@ -18,7 +19,8 @@ texture = ExtResource( 2 ) [node name="Tween" type="Tween" parent="."] [node name="ChargeTimer" type="Timer" parent="."] -wait_time = 4.0 +wait_time = 2.5 +one_shot = true [node name="Hitbox" type="Area2D" parent="."] @@ -32,6 +34,11 @@ position = Vector2( 10, -3 ) rotation = 1.5708 shape = SubResource( 1 ) +[node name="ChargeDestination" type="Position2D" parent="."] +position = Vector2( 1665, -24 ) + +[node name="TweenColor" type="Tween" parent="."] + [connection signal="timeout" from="ChargeTimer" to="." method="_on_ChargeTimer_timeout"] [connection signal="area_entered" from="Hitbox" to="." method="_on_Hitbox_area_entered"] [connection signal="area_entered" from="Hurtbox" to="." method="_on_Hurtbox_area_entered"] diff --git a/Travesty/Hazards/Fork/Fork.gd b/Travesty/Hazards/Fork/Fork.gd index 1ba397f..97499ec 100644 --- a/Travesty/Hazards/Fork/Fork.gd +++ b/Travesty/Hazards/Fork/Fork.gd @@ -1,20 +1,21 @@ extends Sprite + onready var tank = get_node("/root/Tank") onready var spawner = get_node("/root/Tank/HazardSpawner") var playingforwards = true -func _ready() -> void: - $Timer.start() - - -func _on_Timer_timeout() -> void: - _reposition() - yield($Tween, "tween_completed") - _stab() - yield($AnimationPlayer, "animation_finished") - _retract() +#func _ready() -> void: +# $Timer.start() +# +# +#func _on_Timer_timeout() -> void: +# _reposition() +# yield($Tween, "tween_completed") +# _stab() +# yield($AnimationPlayer, "animation_finished") +# _retract() func _reposition() -> void: diff --git a/Travesty/Hazards/Heater/Heater.gd b/Travesty/Hazards/Heater/Heater.gd new file mode 100644 index 0000000..a94b1ea --- /dev/null +++ b/Travesty/Hazards/Heater/Heater.gd @@ -0,0 +1,34 @@ +extends Node2D + +enum { TOP, MID, BOT } +var active_channel = TOP +onready var fish = get_node("/root/Tank/Fish") + + +func _ready(): + pass + + +func _on_Timer_timeout() -> void: + active_channel += 1 + + if active_channel == TOP: + var areas = $TopChannel.get_overlapping_areas() + for area in areas: + if area.is_in_group("Fish"): + var destination = $TopChannel/CollisionShape2D.position - $TopChannel/CollisionShape2D.extents + $TweenPush.interpolate_property(fish, "position:x", position.x, destination.x, 1.5, Tween.TRANS_CIRC, Tween.EASE_IN_OUT) + print("Pushing fish back!") + fish.get_node("TweenSwim").stop_all() + if active_channel == MID: + var areas = $MidChannel.get_overlapping_areas() + for area in areas: + if area.is_in_group("Fish"): + print("Pushing fish back!") + fish.get_node("TweenSwim").stop_all() + if active_channel == BOT: + var areas = $TopChannel.get_overlapping_areas() + for area in areas: + if area.is_in_group("Fish"): + print("Pushing fish back!") + fish.get_node("TweenSwim").stop_all() diff --git a/Travesty/Hazards/Heater/Heater.tscn b/Travesty/Hazards/Heater/Heater.tscn new file mode 100644 index 0000000..c2ccbe5 --- /dev/null +++ b/Travesty/Hazards/Heater/Heater.tscn @@ -0,0 +1,40 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://Hazards/Heater/Heater2.png" type="Texture" id=1] +[ext_resource path="res://Hazards/Heater/Heater3.png" type="Texture" id=2] +[ext_resource path="res://Hazards/Heater/Heater1.png" type="Texture" id=3] +[ext_resource path="res://Hazards/Heater/Heater.gd" type="Script" id=4] + +[sub_resource type="SpriteFrames" id=1] +animations = [ { +"frames": [ ExtResource( 3 ), ExtResource( 1 ), ExtResource( 2 ) ], +"loop": true, +"name": "default", +"speed": 5.0 +} ] + +[sub_resource type="CapsuleShape2D" id=2] +radius = 81.0 +height = 714.0 + +[node name="Heater" type="Node2D"] +script = ExtResource( 4 ) + +[node name="PivotPoint" type="Position2D" parent="."] +position = Vector2( 3, -494 ) + +[node name="Sprite" type="AnimatedSprite" parent="PivotPoint"] +position = Vector2( 0, 494 ) +frames = SubResource( 1 ) + +[node name="Hitbox" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] +position = Vector2( 0, 29 ) +shape = SubResource( 2 ) + +[node name="Timer" type="Timer" parent="."] + +[node name="TweenPush" type="Tween" parent="."] + +[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] diff --git a/Travesty/Hazards/Heater/Heater1.png b/Travesty/Hazards/Heater/Heater1.png new file mode 100644 index 0000000..a2d2ef2 Binary files /dev/null and b/Travesty/Hazards/Heater/Heater1.png differ diff --git a/Travesty/Hazards/Heater/Heater1.png.import b/Travesty/Hazards/Heater/Heater1.png.import new file mode 100644 index 0000000..c4f6df1 --- /dev/null +++ b/Travesty/Hazards/Heater/Heater1.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Heater1.png-dae6580e355aabcfbecd8fd28855d76c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Heater/Heater1.png" +dest_files=[ "res://.import/Heater1.png-dae6580e355aabcfbecd8fd28855d76c.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Heater/Heater2.png b/Travesty/Hazards/Heater/Heater2.png new file mode 100644 index 0000000..20450ec Binary files /dev/null and b/Travesty/Hazards/Heater/Heater2.png differ diff --git a/Travesty/Hazards/Heater/Heater2.png.import b/Travesty/Hazards/Heater/Heater2.png.import new file mode 100644 index 0000000..b0720f4 --- /dev/null +++ b/Travesty/Hazards/Heater/Heater2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Heater2.png-6a4f25b59a74d865bf5f070f41941c5f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Heater/Heater2.png" +dest_files=[ "res://.import/Heater2.png-6a4f25b59a74d865bf5f070f41941c5f.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Heater/Heater3.png b/Travesty/Hazards/Heater/Heater3.png new file mode 100644 index 0000000..fd4b5f5 Binary files /dev/null and b/Travesty/Hazards/Heater/Heater3.png differ diff --git a/Travesty/Hazards/Heater/Heater3.png.import b/Travesty/Hazards/Heater/Heater3.png.import new file mode 100644 index 0000000..ad3761b --- /dev/null +++ b/Travesty/Hazards/Heater/Heater3.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Heater3.png-f85b7365979e755d8005ac5fc3ea170c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Heater/Heater3.png" +dest_files=[ "res://.import/Heater3.png-f85b7365979e755d8005ac5fc3ea170c.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Knife/Fork.png b/Travesty/Hazards/Knife/Fork.png new file mode 100644 index 0000000..531c847 Binary files /dev/null and b/Travesty/Hazards/Knife/Fork.png differ diff --git a/Travesty/Hazards/Knife/Fork.png.import b/Travesty/Hazards/Knife/Fork.png.import new file mode 100644 index 0000000..45a181e --- /dev/null +++ b/Travesty/Hazards/Knife/Fork.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Fork.png-fdf3f45883c3a6a97f4f0f7ae68e5ef9.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Knife/Fork.png" +dest_files=[ "res://.import/Fork.png-fdf3f45883c3a6a97f4f0f7ae68e5ef9.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Knife/Fork2.png b/Travesty/Hazards/Knife/Fork2.png new file mode 100644 index 0000000..86755e5 Binary files /dev/null and b/Travesty/Hazards/Knife/Fork2.png differ diff --git a/Travesty/Hazards/Knife/Fork2.png.import b/Travesty/Hazards/Knife/Fork2.png.import new file mode 100644 index 0000000..86fcde4 --- /dev/null +++ b/Travesty/Hazards/Knife/Fork2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Fork2.png-65b19b1b134a5c993075d0aac12306d2.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Knife/Fork2.png" +dest_files=[ "res://.import/Fork2.png-65b19b1b134a5c993075d0aac12306d2.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Knife/Knife.gd b/Travesty/Hazards/Knife/Knife.gd new file mode 100644 index 0000000..1ba397f --- /dev/null +++ b/Travesty/Hazards/Knife/Knife.gd @@ -0,0 +1,35 @@ +extends Sprite + +onready var tank = get_node("/root/Tank") +onready var spawner = get_node("/root/Tank/HazardSpawner") +var playingforwards = true + + +func _ready() -> void: + $Timer.start() + + +func _on_Timer_timeout() -> void: + _reposition() + yield($Tween, "tween_completed") + _stab() + yield($AnimationPlayer, "animation_finished") + _retract() + + +func _reposition() -> void: + var tween_duration = 1 + $Tween.interpolate_property(self, "position:x", position.x, rand_range(400, 2000), tween_duration, Tween.TRANS_BACK, Tween.EASE_IN_OUT) + $Tween.start() + + +func _stab() -> void: + $AnimationPlayer.play("Stab") + + +func _retract() -> void: + $AnimationPlayer.play_backwards("Stab") + + +func destroy() -> void: + queue_free() diff --git a/Travesty/Hazards/Knife/Knife.png b/Travesty/Hazards/Knife/Knife.png new file mode 100644 index 0000000..0fcac6a Binary files /dev/null and b/Travesty/Hazards/Knife/Knife.png differ diff --git a/Travesty/Hazards/Knife/Knife.png.import b/Travesty/Hazards/Knife/Knife.png.import new file mode 100644 index 0000000..951876a --- /dev/null +++ b/Travesty/Hazards/Knife/Knife.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Knife.png-f70fc2a8b7fa12ed79d50974e2cc9809.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Knife/Knife.png" +dest_files=[ "res://.import/Knife.png-f70fc2a8b7fa12ed79d50974e2cc9809.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Knife/Knife.tscn b/Travesty/Hazards/Knife/Knife.tscn new file mode 100644 index 0000000..5602f37 --- /dev/null +++ b/Travesty/Hazards/Knife/Knife.tscn @@ -0,0 +1,89 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://Hazards/Knife/Knife.gd" type="Script" id=1] +[ext_resource path="res://Hazards/Fork/Fork.png" type="Texture" id=2] + +[sub_resource type="Animation" id=2] +resource_name = "Stab" +length = 0.1 +tracks/0/type = "value" +tracks/0/path = NodePath(".:region_rect") +tracks/0/interp = 2 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.05 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Rect2( 0, -400, 300, 470 ), Rect2( 0, 0, 300, 470 ) ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("ForkAbove:region_rect") +tracks/1/interp = 2 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0, 0.05 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Rect2( 200, 10, 300, 100 ), Rect2( 200, 410, 300, 100 ) ] +} +tracks/2/type = "method" +tracks/2/path = NodePath(".") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( ), +"transitions": PoolRealArray( ), +"values": [ ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Hitbox:position") +tracks/3/interp = 2 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0, 0.5 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 0, -400 ) ] +} + +[sub_resource type="RectangleShape2D" id=3] +extents = Vector2( 22.25, 28.25 ) + +[node name="Fork" type="Sprite"] +position = Vector2( 550, 570 ) +rotation = 3.14159 +scale = Vector2( 2, 2 ) +texture = ExtResource( 2 ) +region_enabled = true +region_rect = Rect2( 0, -400, 300, 470 ) +script = ExtResource( 1 ) + +[node name="ForkAbove" type="Sprite" parent="."] +position = Vector2( 220.499, 278.001 ) +texture = ExtResource( 2 ) +region_enabled = true +region_rect = Rect2( 200, 10, 300, 100 ) + +[node name="Timer" type="Timer" parent="."] +wait_time = 1.75 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/Stab = SubResource( 2 ) + +[node name="Hitbox" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"] +position = Vector2( 108.749, 205.75 ) +shape = SubResource( 3 ) + +[node name="Tween" type="Tween" parent="."] + +[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] diff --git a/Travesty/Hazards/Piranha.7z b/Travesty/Hazards/Piranha.7z new file mode 100644 index 0000000..a08c119 Binary files /dev/null and b/Travesty/Hazards/Piranha.7z differ diff --git a/Travesty/Hazards/Piranha/Piranha.gd b/Travesty/Hazards/Piranha/Piranha.gd new file mode 100644 index 0000000..342dc60 --- /dev/null +++ b/Travesty/Hazards/Piranha/Piranha.gd @@ -0,0 +1,18 @@ +extends Node2D + + +onready var fish = get_node("/root/Tank/Fish") + + +func _ready(): + pass + + +func _process(delta: float) -> void: + $SwordPivot.rotation_degrees += 1 + + +func _on_SwordHitbox_area_entered(area: Area2D) -> void: + pass # Replace with function body. +# if is_in_group("Fish"): +# fish.belly_up() diff --git a/Travesty/Hazards/Piranha/Piranha.tscn b/Travesty/Hazards/Piranha/Piranha.tscn new file mode 100644 index 0000000..b4b403e --- /dev/null +++ b/Travesty/Hazards/Piranha/Piranha.tscn @@ -0,0 +1,53 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://Hazards/Piranha/Piranha2.png" type="Texture" id=1] +[ext_resource path="res://Hazards/Piranha/Piranha1.png" type="Texture" id=2] +[ext_resource path="res://Hazards/Piranha/Piranha.gd" type="Script" id=3] + +[sub_resource type="CapsuleShape2D" id=2] +height = 644.0 + +[sub_resource type="SpriteFrames" id=1] +animations = [ { +"frames": [ ExtResource( 2 ), ExtResource( 1 ) ], +"loop": true, +"name": "default", +"speed": 3.0 +} ] + +[sub_resource type="CircleShape2D" id=3] +radius = 515.097 + +[node name="Piranha" type="Node2D"] +script = ExtResource( 3 ) + +[node name="SwordPivot" type="Position2D" parent="."] +position = Vector2( 4, 1 ) +rotation = 6.28319 + +[node name="Sword" type="Sprite" parent="SwordPivot"] + +[node name="SwordHitbox" type="Area2D" parent="SwordPivot"] + +[node name="StandinArt" type="Polygon2D" parent="SwordPivot/SwordHitbox"] +position = Vector2( -212, 8.00004 ) +polygon = PoolVector2Array( 458, -9, 467, -28, 524, -29, 523, -56, 546, -56, 547, -32, 781, -29, 906, -8, 782, 12, 549, 10, 550, 37, 526, 37, 524, 10, 466, 10 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="SwordPivot/SwordHitbox"] +position = Vector2( 344, -6.00815e-05 ) +rotation = 1.5708 +shape = SubResource( 2 ) + +[node name="AnimatedSprite" type="AnimatedSprite" parent="."] +position = Vector2( 67, -25 ) +scale = Vector2( 0.5, 0.5 ) +frames = SubResource( 1 ) +playing = true + +[node name="Blindzone" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Blindzone"] +position = Vector2( 2, 5 ) +shape = SubResource( 3 ) + +[connection signal="area_entered" from="SwordPivot/SwordHitbox" to="." method="_on_SwordHitbox_area_entered"] diff --git a/Travesty/Hazards/Piranha/Piranha1.png b/Travesty/Hazards/Piranha/Piranha1.png new file mode 100644 index 0000000..4c21f59 Binary files /dev/null and b/Travesty/Hazards/Piranha/Piranha1.png differ diff --git a/Travesty/Hazards/Piranha/Piranha1.png.import b/Travesty/Hazards/Piranha/Piranha1.png.import new file mode 100644 index 0000000..ee77592 --- /dev/null +++ b/Travesty/Hazards/Piranha/Piranha1.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Piranha1.png-bae56f38a929eae66a2103ba57992b06.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Piranha/Piranha1.png" +dest_files=[ "res://.import/Piranha1.png-bae56f38a929eae66a2103ba57992b06.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Piranha/Piranha2.png b/Travesty/Hazards/Piranha/Piranha2.png new file mode 100644 index 0000000..10b16cf Binary files /dev/null and b/Travesty/Hazards/Piranha/Piranha2.png differ diff --git a/Travesty/Hazards/Piranha/Piranha2.png.import b/Travesty/Hazards/Piranha/Piranha2.png.import new file mode 100644 index 0000000..3b0e448 --- /dev/null +++ b/Travesty/Hazards/Piranha/Piranha2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Piranha2.png-1c09ad0beb723852e2cc2518a6374b8c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Hazards/Piranha/Piranha2.png" +dest_files=[ "res://.import/Piranha2.png-1c09ad0beb723852e2cc2518a6374b8c.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=true +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=true +svg/scale=1.0 diff --git a/Travesty/Hazards/Poison/Poison.gd b/Travesty/Hazards/Poison/Poison.gd index b3ffc5b..ebd191a 100644 --- a/Travesty/Hazards/Poison/Poison.gd +++ b/Travesty/Hazards/Poison/Poison.gd @@ -5,8 +5,10 @@ var fish : Node var direction var projectile = false + func _ready(): fish = get_node("/root/Tank/Fish") + global_rotation_degrees = rand_range(0, 360) $AnimatedSprite.frame = choose([0,1,2]) diff --git a/Travesty/Hazards/Squid/Squid.tscn b/Travesty/Hazards/Squid/Squid.tscn index e378903..a1fda46 100644 --- a/Travesty/Hazards/Squid/Squid.tscn +++ b/Travesty/Hazards/Squid/Squid.tscn @@ -1,9 +1,8 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://Hazards/Squid/Squid2.png" type="Texture" id=1] [ext_resource path="res://Hazards/Squid/Tentacle.png" type="Texture" id=2] [ext_resource path="res://Hazards/Squid/Squid.gd" type="Script" id=3] -[ext_resource path="res://Tank/Water.png" type="Texture" id=4] [sub_resource type="Animation" id=2] resource_name = "Stab" @@ -24,10 +23,6 @@ tracks/0/keys = { [node name="Squid" type="Node2D"] script = ExtResource( 3 ) -[node name="DELETEME" type="Sprite" parent="."] -texture = ExtResource( 4 ) -centered = false - [node name="Tentacle" type="Sprite" parent="."] position = Vector2( -900, 0 ) texture = ExtResource( 2 ) diff --git a/Travesty/Hazards/Squid/Squid2.png b/Travesty/Hazards/Squid/Squid2.png index 7763317..4a4e0b2 100644 Binary files a/Travesty/Hazards/Squid/Squid2.png and b/Travesty/Hazards/Squid/Squid2.png differ diff --git a/Travesty/Tank/Tank.gd b/Travesty/Tank/Tank.gd index cb8f08a..a854703 100644 --- a/Travesty/Tank/Tank.gd +++ b/Travesty/Tank/Tank.gd @@ -27,7 +27,7 @@ static func random_position(area: CollisionShape2D) -> Vector2: func _on_HazardTimer_timeout() -> void: - if phase == Phase.CLEAN or phase == Phase.POISON: + if phase == Phase.CLEAN or phase == Phase.POISON or phase == Phase.SQUID: var poison_scene = load("res://Hazards/Poison/Poison.tscn") var poison = poison_scene.instance() if phase == Phase.CLEAN: @@ -37,6 +37,7 @@ func _on_HazardTimer_timeout() -> void: func blackout() -> void: + $Fish/ThoughtBubble.visible = false if not phase == Phase.START: yield($Fish.go_inside(), "completed") if not modulate == Color(0,0,0,1): @@ -48,7 +49,15 @@ func blackout() -> void: $House/HouseRight.z_index = $House/HouseLeft.z_index print(phase) if phase == Phase.POISON: - $SurvivePoisonTimer.start() + $SurviveTimer.start() + if phase == Phase.KNIFE: + var fork_scene = load("res://Hazards/Fork/Fork.tscn") + var fork = fork_scene.instance() + add_child(fork) + if phase == Phase.SQUID: + var squid_scene = load("res://Hazards/Squid/Squid.tscn") + var squid = squid_scene.instance() + add_child(squid) if not phase == Phase.CLEAN: $Fish.position = $House/RightEntrance.get_global_position() + Vector2(0,-100) $Fish.global_rotation_degrees = 180 @@ -61,6 +70,7 @@ func blackout() -> void: $TweenBlackout.start() yield($TweenBlackout, "tween_completed") $Fish.invincible = false + _think() func next_phase() -> void: @@ -68,8 +78,29 @@ func next_phase() -> void: var pellets = get_tree().get_nodes_in_group("Pellets") for pellet in pellets: pellet.queue_free() + if phase == Phase.KNIFE: # Clean tank of poison before fork phase + var pellets = get_tree().get_nodes_in_group("Pellets") + for pellet in pellets: + pellet.queue_free() phase += 1 -func _on_SurvivePoisonTimer_timeout() -> void: +func _think() -> void: + var thought = $Fish/ThoughtBubble/Thought + $Fish/ThoughtBubble/ThoughtTimer.start() + if phase == Phase.CLEAN: + $Fish/ThoughtBubble.visible = true + thought.bbcode_text = \ + "\n[center][tornado]ooOOoo! " + \ + "Does it really rain yummy treats in here? :D" + if phase == Phase.POISON: + $Fish/ThoughtBubble.visible = true + thought.bbcode_text = \ + "[center]Wait, something's wrong with these flakes!\n" + \ + "[shake]Must... resist... eating...!" + + # Tween the $Thought.bbcode_text's percent_visible property + + +func _on_SurviveTimer_timeout() -> void: blackout() diff --git a/Travesty/Tank/Tank.tscn b/Travesty/Tank/Tank.tscn index 8a67a60..bf4ec70 100644 --- a/Travesty/Tank/Tank.tscn +++ b/Travesty/Tank/Tank.tscn @@ -128,8 +128,9 @@ position = Vector2( 160, 245 ) [node name="TweenBlackout" type="Tween" parent="."] -[node name="SurvivePoisonTimer" type="Timer" parent="."] -wait_time = 60.0 +[node name="SurviveTimer" type="Timer" parent="."] +wait_time = 10.0 +one_shot = true [connection signal="timeout" from="HazardSpawner/HazardTimer" to="." method="_on_HazardTimer_timeout"] -[connection signal="timeout" from="SurvivePoisonTimer" to="." method="_on_SurvivePoisonTimer_timeout"] +[connection signal="timeout" from="SurviveTimer" to="." method="_on_SurviveTimer_timeout"]