1
Fork 0
mirror of https://github.com/RYGhub/the-cold-night.git synced 2024-11-24 05:34:18 +00:00

💥 Drastic changes

This commit is contained in:
Steffo 2022-04-05 00:08:11 +02:00
parent 430aa2aff0
commit 3a42e6d496
Signed by: steffo
GPG key ID: 6965406171929D01
23 changed files with 234 additions and 48 deletions

View file

@ -2,6 +2,8 @@
"files.exclude": {
"**/*.import": true,
"**/*.png": true,
"**/*.tscn": true,
"**/*.tres": true,
"**/*.godot": true,
"**/*.kra": true,
"**/*.mp3": true,

View file

@ -15,7 +15,7 @@ onready var parent = get_parent()
func do_damage(to, multiplier):
# Check if it is possible to damage the collider
var damageable = to.get_node("Damageable")
var damageable = to.get_node_or_null("Damageable")
if damageable == null:
return
# Damage the collider!

View file

@ -27,3 +27,7 @@ func turn(direction):
func _on_AttractedToMovement_moved_in_direction(_origin, direction):
turn(direction)
func _on_PlayerMovement_moved_in_direction(_origin, direction):
turn(direction)

View file

@ -0,0 +1,11 @@
extends Timer
export(float) var multiplier
onready var parent = get_parent()
func _on_DecreaseEvery_timeout():
parent.wait_time *= multiplier

View file

@ -0,0 +1,11 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://src/behaviours/spawning/DecreaseEvery.gd" type="Script" id=1]
[node name="DecreaseEvery" type="Timer"]
wait_time = 5.0
autostart = true
script = ExtResource( 1 )
multiplier = 0.8
[connection signal="timeout" from="." to="." method="_on_DecreaseEvery_timeout"]

View file

@ -7,6 +7,7 @@
script = ExtResource( 1 )
[node name="Cooldown" type="Timer" parent="."]
wait_time = 0.3
one_shot = true
[node name="Sound" type="AudioStreamPlayer2D" parent="."]

View file

@ -8,6 +8,7 @@
extents = Vector2( 16, 6 )
[node name="Arrow" instance=ExtResource( 3 )]
scale = Vector2( 2, 2 )
[node name="Shape" type="CollisionShape2D" parent="." index="0"]
shape = SubResource( 1 )
@ -20,5 +21,5 @@ texture = ExtResource( 2 )
[node name="BulletMovement" parent="." index="1"]
movement_per_second = 200.0
[node name="Damaging" parent="." index="3"]
destroy_after_damage = false
[node name="Damaging" parent="." index="2"]
damage = 50.0

View file

@ -6,13 +6,10 @@
[node name="AbstractEnemy" instance=ExtResource( 2 )]
[node name="Alliance" parent="." index="0"]
alliance = -1
[node name="DropLoot" parent="." index="2" instance=ExtResource( 1 )]
[node name="DropLoot" parent="." index="1" instance=ExtResource( 1 )]
container_name = "Pickups"
[node name="FreeOnRequest" parent="." index="3" instance=ExtResource( 3 )]
[node name="FreeOnRequest" parent="." index="2" instance=ExtResource( 3 )]
[connection signal="health_reached_min" from="Damageable" to="DropLoot" method="_on_Damageable_health_reached_min"]
[connection signal="health_reached_min" from="Damageable" to="FreeOnRequest" method="_on_Damageable_health_reached_min"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=2]
[gd_scene load_steps=15 format=2]
[ext_resource path="res://src/entities/enemies/EnemySnowmanLeft.png" type="Texture" id=1]
[ext_resource path="res://src/pickups/BranchPickup.tscn" type="PackedScene" id=2]
@ -11,6 +11,7 @@
[ext_resource path="res://src/behaviours/graphics/FourSidedSprite.tscn" type="PackedScene" id=9]
[ext_resource path="res://src/entities/enemies/ChaserEnemy.gd" type="Script" id=10]
[ext_resource path="res://src/behaviours/damage/Damaging.gd" type="Script" id=11]
[ext_resource path="res://src/pickups/BigArrowPickup.tscn" type="PackedScene" id=12]
[sub_resource type="CapsuleShape2D" id=1]
radius = 9.0
@ -50,19 +51,19 @@ shape = SubResource( 1 )
frames = SubResource( 2 )
animation = "down"
[node name="Damageable" parent="." index="2"]
[node name="Damageable" parent="." index="1"]
max_health = 10.0
health = 10.0
[node name="DropLoot" parent="." index="3"]
loot_types = [ ExtResource( 2 ), ExtResource( 5 ) ]
loot_weights = [ 95.0, 5.0 ]
[node name="DropLoot" parent="." index="2"]
loot_types = [ ExtResource( 2 ), ExtResource( 5 ), ExtResource( 12 ) ]
loot_weights = [ 80.0, 10.0, 10.0 ]
[node name="AttractedToMovement" parent="." index="5" instance=ExtResource( 3 )]
[node name="AttractedToMovement" parent="." index="4" instance=ExtResource( 3 )]
[node name="Damaging" type="Node" parent="." index="6"]
[node name="Damaging" type="Node" parent="." index="5"]
script = ExtResource( 11 )
damage = 20.0
damage = -10.0
destroy_after_damage = true
[connection signal="collided" from="AttractedToMovement" to="." method="_on_AttractedToMovement_collided"]

View file

@ -44,6 +44,15 @@ shape = SubResource( 1 )
rotation = -1.5708
texture = ExtResource( 2 )
[node name="Damageable" parent="Firepit" instance=ExtResource( 5 )]
max_health = 200.0
health = 100.0
[node name="Damaging" parent="Firepit" instance=ExtResource( 9 )]
friendly_fire = true
[node name="DamageEveryTick" parent="Firepit/Damaging" instance=ExtResource( 6 )]
[node name="Flame" type="Area2D" parent="."]
position = Vector2( 1, 0 )
collision_layer = 4
@ -67,14 +76,5 @@ animation = "v1"
frame = 2
playing = true
[node name="Damageable" parent="." instance=ExtResource( 5 )]
max_health = 200.0
health = 100.0
[node name="Damaging" parent="." instance=ExtResource( 9 )]
friendly_fire = true
[node name="DamageEveryTick" parent="Damaging" instance=ExtResource( 6 )]
[connection signal="health_changed" from="Firepit/Damageable" to="." method="_on_Damageable_health_changed"]
[connection signal="body_entered" from="Flame" to="." method="_on_Flame_body_entered"]
[connection signal="health_changed" from="Damageable" to="." method="_on_Damageable_health_changed"]

View file

@ -5,7 +5,4 @@
[node name="AbstractPlayer" instance=ExtResource( 3 )]
[node name="Alliance" parent="." index="0"]
alliance = 1
[node name="PlayerMovement" parent="." index="2" instance=ExtResource( 2 )]
[node name="PlayerMovement" parent="." index="1" instance=ExtResource( 2 )]

View file

@ -49,8 +49,14 @@ script = ExtResource( 7 )
[node name="Listener" type="Listener2D" parent="." index="1"]
current = true
[node name="SpawnOnShoot" parent="." index="5" instance=ExtResource( 4 )]
[node name="Damageable" parent="." index="2"]
max_health = 50.0
health = 50.0
[node name="SpawnOnShoot" parent="." index="4" instance=ExtResource( 4 )]
spawning = ExtResource( 3 )
container_name = "Bullets"
[node name="ShootOnClick" parent="SpawnOnShoot" index="2" instance=ExtResource( 2 )]
[connection signal="moved_in_direction" from="PlayerMovement" to="Shape/FourSidedSprite" method="_on_PlayerMovement_moved_in_direction"]

View file

@ -21,4 +21,12 @@ func _on_MainMenu_Play_pressed():
# warning-ignore: RETURN_VALUE_DISCARDED
$PhaseOne.connect("survival_seconds_updated", $UserInterface/TheDarkNightUI/TimeSurvived,"_on_PhaseOne_survival_seconds_updated")
# warning-ignore: RETURN_VALUE_DISCARDED
$PhaseOne/Entities/Fire/Firepit/Damageable.connect("health_changed", $Music, "_on_Fire_intensity_changed")
# warning-ignore: RETURN_VALUE_DISCARDED
$PhaseOne/Entities/Fire/Firepit/Damageable.connect("health_reached_min", self, "_on_Fire_died")
# warning-ignore: RETURN_VALUE_DISCARDED
$UserInterface/TheDarkNightUI/MuteButton.connect("toggled", $Music, "_on_MuteButton_toggled")
func _on_Fire_died(_origin, _value):
print("Should move to the second phase...")

View file

@ -35,7 +35,7 @@ func update_state():
func _on_Fire_intensity_changed(value):
func _on_Fire_intensity_changed(_origin, value):
$Choir.volume_db = (smoothstep(choir_min, choir_max, value) - 1) * 60
$Bell.volume_db = (smoothstep(bell_min, bell_max, value) - 1) * 60
$Drum.volume_db = (smoothstep(drum_min, drum_max, value) - 1) * 60

View file

@ -38,12 +38,6 @@ texture = ExtResource( 2 )
position = Vector2( 421, -275 )
scale = Vector2( 4, 4 )
[node name="FlameSprite" parent="TheDarkNightUI/MenuFire/Flame/Shape" index="0"]
frame = 3
[node name="Damaging" parent="TheDarkNightUI/MenuFire" index="3"]
damage = -5.0
[node name="Play" type="Button" parent="TheDarkNightUI"]
anchor_left = 1.0
anchor_top = 1.0

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=2]
[gd_scene load_steps=16 format=2]
[ext_resource path="res://src/pickups/BranchPickup.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/mechanics/GrassDirtTileset.png" type="Texture" id=2]
@ -7,6 +7,7 @@
[ext_resource path="res://src/entities/enemies/ChaserEnemy.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/behaviours/movement/TeleportToScreenEdge.tscn" type="PackedScene" id=6]
[ext_resource path="res://src/mechanics/White.png" type="Texture" id=7]
[ext_resource path="res://src/behaviours/spawning/DecreaseEvery.tscn" type="PackedScene" id=8]
[ext_resource path="res://src/behaviours/targeting/SetSpawnedATMGoalTo.tscn" type="PackedScene" id=11]
[ext_resource path="res://src/mechanics/Darkness.tscn" type="PackedScene" id=13]
[ext_resource path="res://src/mechanics/Background.tscn" type="PackedScene" id=14]
@ -85,22 +86,119 @@ position = Vector2( 640, 319 )
spawning = ExtResource( 5 )
container_name = "Enemies"
[node name="DecreaseEvery" parent="Entities/Containers/Enemies/TowardsFireSpawner/SpawnEveryPeriod/Period" index="0" instance=ExtResource( 8 )]
multiplier = 0.5
[node name="SetSpawnedGoalTo" parent="Entities/Containers/Enemies/TowardsFireSpawner/SpawnEveryPeriod" instance=ExtResource( 11 )]
goal_path = NodePath("../../../../../Fire")
[node name="TeleportToScreenEdge" parent="Entities/Containers/Enemies/TowardsFireSpawner" instance=ExtResource( 6 )]
bounds = Vector2( 1280, 640 )
[node name="TowardsPlayerSpawner" type="Node2D" parent="Entities/Containers/Enemies"]
position = Vector2( 1280, 640 )
[node name="SpawnEveryPeriod" parent="Entities/Containers/Enemies/TowardsPlayerSpawner" instance=ExtResource( 4 )]
spawning = ExtResource( 5 )
container_name = "Enemies"
[node name="Period" parent="Entities/Containers/Enemies/TowardsPlayerSpawner/SpawnEveryPeriod" index="0"]
wait_time = 1.5
[node name="DecreaseEvery" parent="Entities/Containers/Enemies/TowardsPlayerSpawner/SpawnEveryPeriod/Period" index="0" instance=ExtResource( 8 )]
multiplier = 0.5
[node name="SetSpawnedGoalTo" parent="Entities/Containers/Enemies/TowardsPlayerSpawner/SpawnEveryPeriod" instance=ExtResource( 11 )]
goal_path = NodePath("../../../../../PhaseOnePlayer")
[node name="TeleportToScreenEdge" parent="Entities/Containers/Enemies/TowardsPlayerSpawner" instance=ExtResource( 6 )]
bounds = Vector2( 1280, 640 )
[node name="Pickups" type="Node" parent="Entities/Containers"]
[node name="BranchPickup" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 574, 344 )
position = Vector2( 593, 376 )
[node name="BranchPickup2" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 769, 320 )
position = Vector2( 681, 368 )
[node name="BranchPickup6" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 721, 341 )
[node name="BranchPickup7" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 712, 371 )
[node name="BranchPickup8" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 703, 290 )
[node name="BranchPickup9" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 702, 319 )
[node name="BranchPickup10" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 702, 319 )
[node name="BranchPickup11" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 745, 302 )
[node name="BranchPickup12" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 704, 262 )
[node name="BranchPickup13" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 660, 251 )
[node name="BranchPickup14" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 688, 230 )
[node name="BranchPickup15" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 627, 211 )
[node name="BranchPickup16" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 627, 232 )
[node name="BranchPickup20" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 559, 283 )
[node name="BranchPickup21" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 554, 316 )
[node name="BranchPickup22" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 577, 352 )
[node name="BranchPickup23" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 557, 374 )
[node name="BranchPickup24" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 614, 363 )
[node name="BranchPickup25" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 649, 373 )
[node name="BranchPickup26" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 671, 397 )
[node name="BranchPickup27" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 608, 410 )
[node name="BranchPickup28" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 713, 397 )
[node name="BranchPickup29" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 750, 364 )
[node name="BranchPickup30" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 738, 275 )
[node name="BranchPickup17" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 582, 239 )
[node name="BranchPickup18" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 582, 239 )
[node name="BranchPickup19" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 588, 316 )
[node name="BranchPickup3" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 618, 497 )
position = Vector2( 641, 398 )
[node name="BranchPickup4" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )]
position = Vector2( 354, 309 )
@ -110,5 +208,8 @@ position = Vector2( 642, 104 )
[connection signal="spawned" from="Entities/Containers/Enemies/TowardsFireSpawner/SpawnEveryPeriod" to="Entities/Containers/Enemies/TowardsFireSpawner/SpawnEveryPeriod/SetSpawnedGoalTo" method="_on_SpawnEveryPeriod_spawned"]
[connection signal="spawned" from="Entities/Containers/Enemies/TowardsFireSpawner/SpawnEveryPeriod" to="Entities/Containers/Enemies/TowardsFireSpawner/TeleportToScreenEdge" method="_on_SpawnEveryPeriod_spawned"]
[connection signal="spawned" from="Entities/Containers/Enemies/TowardsPlayerSpawner/SpawnEveryPeriod" to="Entities/Containers/Enemies/TowardsPlayerSpawner/SpawnEveryPeriod/SetSpawnedGoalTo" method="_on_SpawnEveryPeriod_spawned"]
[connection signal="spawned" from="Entities/Containers/Enemies/TowardsPlayerSpawner/SpawnEveryPeriod" to="Entities/Containers/Enemies/TowardsPlayerSpawner/TeleportToScreenEdge" method="_on_SpawnEveryPeriod_spawned"]
[editable path="Entities/Containers/Enemies/TowardsFireSpawner/SpawnEveryPeriod"]
[editable path="Entities/Containers/Enemies/TowardsPlayerSpawner/SpawnEveryPeriod"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://src/levels/ui/MusicOn.png" type="Texture" id=1]
[ext_resource path="res://src/levels/ui/UIBar.png" type="Texture" id=2]
@ -7,6 +7,7 @@
[ext_resource path="res://src/levels/ui/LifeBarBg.png" type="Texture" id=5]
[ext_resource path="res://src/levels/ui/fonts/SourceSerifPro-Regular.ttf" type="DynamicFontData" id=6]
[ext_resource path="res://src/levels/ui/MuteButton.gd" type="Script" id=7]
[ext_resource path="res://src/levels/ui/MusicOff.png" type="Texture" id=8]
[sub_resource type="DynamicFont" id=3]
size = 22
@ -70,6 +71,8 @@ size_flags_vertical = 2
toggle_mode = true
flat = true
script = ExtResource( 7 )
on_sprite = ExtResource( 8 )
off_sprite = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="TheDarkNightUI/MuteButton"]
texture = ExtResource( 1 )

View file

@ -0,0 +1,16 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://src/pickups/Pickup.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/entities/bullets/PiercingArrow.png" type="Texture" id=2]
[node name="BranchPickup" instance=ExtResource( 1 )]
scale = Vector2( 0.5, 0.5 )
[node name="Sprite" parent="Shape" index="0"]
rotation = 0.785398
scale = Vector2( 1.5, 1.5 )
texture = ExtResource( 2 )
[node name="Despawn" parent="." index="2"]
wait_time = 10.0
autostart = true

View file

@ -12,11 +12,12 @@ scale = Vector2( 2, 2 )
texture = ExtResource( 2 )
[node name="Duration" parent="." index="1"]
wait_time = 15.0
wait_time = 7.0
[node name="Despawn" parent="." index="2"]
wait_time = 30.0
[node name="RapidFire" parent="." index="3" instance=ExtResource( 1 )]
[connection signal="expired" from="." to="RapidFire" method="_on_expired"]
[connection signal="picked_up" from="." to="RapidFire" method="_on_picked_up"]

View file

@ -0,0 +1,20 @@
extends Node
export(PackedScene) var new_spawning
onready var target = get_tree().root.find_node("PhaseOnePlayer", true, false).get_node("SpawnOnShoot")
onready var pickup: Area2D = get_parent()
var previous_spawn
func _on_picked_up():
previous_spawn = target.spawning
target.spawning = new_spawning
target.connect("shot", self, "_on_shot")
func _on_shot():
target.spawning = previous_spawn

View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://src/pickups/effects/RapidFire.gd" type="Script" id=1]
[node name="BigArrow" type="Node"]
script = ExtResource( 1 )

View file

@ -5,7 +5,7 @@ class_name ChangeFireIntensity
export var amount_per_second: float = 0.2
onready var target = get_tree().root.find_node("Fire", true, false).get_node("Damageable")
onready var target = get_tree().root.find_node("Fire", true, false).get_node("Firepit/Damageable")
onready var pickup: Area2D = get_parent()

View file

@ -2,13 +2,19 @@ extends Node
class_name RapidFire
onready var target = get_tree().root.find_node("PhaseOnePlayer", true, false).get_node("SpawnOnShoot/ShootOnClick")
onready var target = get_tree().root.find_node("PhaseOnePlayer", true, false).get_node("SpawnOnShoot")
onready var target_click = target.get_node("ShootOnClick")
onready var target_cooldown = target.get_node("Cooldown")
onready var pickup: Area2D = get_parent()
func _on_picked_up():
target.rapid_fire_instances += 1
target_click.rapid_fire_instances += 1
target_cooldown.wait_time /= 2
func _on_expired():
target.rapid_fire_instances -= 1
target_click.rapid_fire_instances -= 1
target_cooldown.wait_time *= 2