diff --git a/project.godot b/project.godot index 997c2e8..ae64020 100644 --- a/project.godot +++ b/project.godot @@ -15,9 +15,9 @@ _global_script_classes=[ { "path": "res://src/behaviours/damage/Alliance.gd" }, { "base": "KinematicBody2D", -"class": "ArrowAlternative", +"class": "Arrow", "language": "GDScript", -"path": "res://src/entities/bullets/ArrowAlternative.gd" +"path": "res://src/entities/bullets/Arrow.gd" }, { "base": "Node", "class": "AttractedToMovement", @@ -30,6 +30,21 @@ _global_script_classes=[ { "path": "res://src/behaviours/movement/BulletMovement.gd" }, { "base": "Node", +"class": "ChangeFireIntensity", +"language": "GDScript", +"path": "res://src/pickups/effects/ChangeFireIntensity.gd" +}, { +"base": "Node", +"class": "DamageEveryTick", +"language": "GDScript", +"path": "res://src/behaviours/damage/DamageEveryTick.gd" +}, { +"base": "Node", +"class": "Damageable", +"language": "GDScript", +"path": "res://src/behaviours/damage/Damageable.gd" +}, { +"base": "Node", "class": "Damaging", "language": "GDScript", "path": "res://src/behaviours/damage/Damaging.gd" @@ -39,10 +54,10 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://src/behaviours/spawning/DropLoot.gd" }, { -"base": "Node", -"class": "ErraticMovement", +"base": "Node2D", +"class": "Fire", "language": "GDScript", -"path": "res://src/behaviours/movement/ErraticMovement.gd" +"path": "res://src/entities/fire/Fire.gd" }, { "base": "Node", "class": "Flammable", @@ -60,6 +75,16 @@ _global_script_classes=[ { "path": "res://src/behaviours/spawning/FreeWhenShapeIsOffScreen.gd" }, { "base": "Node", +"class": "Music", +"language": "GDScript", +"path": "res://src/levels/Music.gd" +}, { +"base": "Button", +"class": "MuteButton", +"language": "GDScript", +"path": "res://src/levels/ui/MuteButton.gd" +}, { +"base": "Node", "class": "Ownership", "language": "GDScript", "path": "res://src/behaviours/damage/Ownership.gd" @@ -85,16 +110,26 @@ _global_script_classes=[ { "path": "res://src/pickups/effects/RapidFire.gd" }, { "base": "Node", -"class": "SetSpawnedGoalTo", +"class": "SetSpawnedATMGoalTo", "language": "GDScript", -"path": "res://src/behaviours/targeting/SetSpawnedGoalTo.gd" +"path": "res://src/behaviours/targeting/SetSpawnedATMGoalTo.gd" }, { -"base": "Node2D", +"base": "Node", +"class": "ShootOnClick", +"language": "GDScript", +"path": "res://src/behaviours/spawning/ShootOnClick.gd" +}, { +"base": "Node", +"class": "ShootWhenPossible", +"language": "GDScript", +"path": "res://src/behaviours/spawning/ShootWhenPossible.gd" +}, { +"base": "Node", "class": "SpawnEveryPeriod", "language": "GDScript", "path": "res://src/behaviours/spawning/SpawnEveryPeriod.gd" }, { -"base": "Node2D", +"base": "Node", "class": "SpawnOnShoot", "language": "GDScript", "path": "res://src/behaviours/spawning/SpawnOnShoot.gd" @@ -108,34 +143,48 @@ _global_script_classes=[ { "class": "TeleportToScreenEdge", "language": "GDScript", "path": "res://src/behaviours/movement/TeleportToRandomPosition.gd" +}, { +"base": "Reference", +"class": "Utils", +"language": "GDScript", +"path": "res://src/Utils.gd" } ] _global_script_class_icons={ "Alliance": "", -"ArrowAlternative": "", +"Arrow": "", "AttractedToMovement": "", "BulletMovement": "", +"ChangeFireIntensity": "", +"DamageEveryTick": "", +"Damageable": "", "Damaging": "", "DropLoot": "", -"ErraticMovement": "", +"Fire": "", "Flammable": "", "FourSidedSprite": "", "FreeWhenShapeIsOffScreen": "", +"Music": "", +"MuteButton": "", "Ownership": "", "PlayerMovement": "", "RNG": "", "RandomRotationOnReady": "", "RapidFire": "", -"SetSpawnedGoalTo": "", +"SetSpawnedATMGoalTo": "", +"ShootOnClick": "", +"ShootWhenPossible": "", "SpawnEveryPeriod": "", "SpawnOnShoot": "", "TeleportToRandomPosition": "", -"TeleportToScreenEdge": "" +"TeleportToScreenEdge": "", +"Utils": "" } [application] -config/name="LD50" -run/main_scene="res://src/levels/MainMenu.tscn" +config/name="The Cold Night" +run/main_scene="res://src/levels/Game.tscn" +boot_splash/bg_color=Color( 0, 0, 0, 1 ) [audio] diff --git a/src/Utils.gd b/src/Utils.gd new file mode 100644 index 0000000..0e2cb37 --- /dev/null +++ b/src/Utils.gd @@ -0,0 +1,5 @@ +class_name Utils + + +static func is_between(m, val, x): + return (m < val) && (val <= x) diff --git a/src/behaviours/BulletSpawn.tscn b/src/behaviours/BulletSpawn.tscn deleted file mode 100644 index e79eee1..0000000 --- a/src/behaviours/BulletSpawn.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/BulletSpawn.gd" type="Script" id=1] - -[node name="BulletSpawn" type="Node"] -script = ExtResource( 1 ) diff --git a/src/behaviours/damage/Alliance.gd b/src/behaviours/damage/Alliance.gd index 7f677a6..a5e06f8 100644 --- a/src/behaviours/damage/Alliance.gd +++ b/src/behaviours/damage/Alliance.gd @@ -2,22 +2,31 @@ extends Node class_name Alliance +signal alliance_changed(origin, value) + + enum AllianceKind { ENEMY = -1, NONE = 0, PLAYER = 1, } -export(AllianceKind) var alliance: int + +export(AllianceKind) var alliance setget set_alliance -static func get_value(first) -> int: - var first_node = first.get_node("Alliance") - var first_alliance = null - if first_node != null: - first_alliance = first_node.alliance - return first_alliance +func set_alliance(value): + alliance = value + emit_signal("alliance_changed", self, value) -static func compare(first, second) -> bool: - return get_value(first) == get_value(second) +static func discover(node): + var alliance_node = node.get_node("Alliance") + if alliance_node != null: + return alliance_node.alliance + else: + return AllianceKind.NONE + + +static func discover_and_compare(first, second): + return discover(first) == discover(second) diff --git a/src/behaviours/damage/DamageEveryTick.gd b/src/behaviours/damage/DamageEveryTick.gd new file mode 100644 index 0000000..d9cb687 --- /dev/null +++ b/src/behaviours/damage/DamageEveryTick.gd @@ -0,0 +1,10 @@ +extends Node +class_name DamageEveryTick + + +onready var parent = get_parent() +onready var target = parent.get_parent() + + +func _process(delta): + parent.do_damage(target, delta) diff --git a/src/behaviours/damage/DamageEveryTick.tscn b/src/behaviours/damage/DamageEveryTick.tscn new file mode 100644 index 0000000..f6674c2 --- /dev/null +++ b/src/behaviours/damage/DamageEveryTick.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/damage/DamageEveryTick.gd" type="Script" id=1] + +[node name="DamageEveryTick" type="Node"] +script = ExtResource( 1 ) diff --git a/src/behaviours/damage/Damageable.gd b/src/behaviours/damage/Damageable.gd index 5194bb8..59a8254 100644 --- a/src/behaviours/damage/Damageable.gd +++ b/src/behaviours/damage/Damageable.gd @@ -1,25 +1,24 @@ -extends Node2D +extends Node +class_name Damageable -signal health_changed(value) -signal dead +signal health_changed(origin, value) +signal health_reached_min(origin, value) +signal health_reached_max(origin, value) -export var health: int = 1 setget set_health, get_health -export var max_health: int = 1 +export(float) var min_health +export(float) var max_health +export(float) var health setget set_health -onready var parent: Node = get_parent() +onready var parent = get_parent() func set_health(value): - health = value - emit_signal("health_changed", value) - if health <= 0: - emit_signal("dead") - # WIP - parent.queue_free() - - -func get_health(): - return health + health = clamp(value, min_health, max_health) + emit_signal("health_changed", self, value) + if is_zero_approx(health - min_health): + emit_signal("health_reached_min", self, value) + if is_zero_approx(health - max_health): + emit_signal("health_reached_max", self, value) diff --git a/src/behaviours/damage/Damageable.tscn b/src/behaviours/damage/Damageable.tscn index a5f0ad1..a7af621 100644 --- a/src/behaviours/damage/Damageable.tscn +++ b/src/behaviours/damage/Damageable.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://src/behaviours/damage/Damageable.gd" type="Script" id=1] -[node name="Damageable" type="Node2D"] +[node name="Damageable" type="Node"] script = ExtResource( 1 ) __meta__ = { "_editor_description_": "Allows the parent entity to take damage and die." diff --git a/src/behaviours/damage/Damaging.gd b/src/behaviours/damage/Damaging.gd index c795878..b61a86a 100644 --- a/src/behaviours/damage/Damaging.gd +++ b/src/behaviours/damage/Damaging.gd @@ -2,31 +2,33 @@ extends Node class_name Damaging -export var damage: int -export var destroy_on_damage: bool -export var friendly_fire: bool +signal damaged(origin, damaged) -onready var parent: Node2D = get_parent() +export(float) var damage +export(bool) var destroy_after_damage +export(bool) var friendly_fire -func do_damage(to: Node): - # Find the owner of this bullet - var bullet_owner = Ownership.get_value(parent) - # Check if the bullet should do damage - var same_alliance = Alliance.compare(bullet_owner, to) - if same_alliance and not friendly_fire: - return +onready var parent = get_parent() + + +func do_damage(to, multiplier): + # Should alliances be considered? + if not friendly_fire: + # Find the owner of this bullet + var bullet_owner = Ownership.discover(parent) + # Check if the bullet should do damage + var same_alliance = Alliance.discover_and_compare(bullet_owner, to) + if same_alliance and not friendly_fire: + return + # Check if it is possible to damage the collider var damageable = to.get_node("Damageable") if damageable == null: return # Damage the collider! - damageable.health -= damage - # Alas, destroy self - if destroy_on_damage: - parent.queue_free() + damageable.health += damage * multiplier + # Emit the signal + emit_signal("damaged", self, to) - -func do_damage_to_collider(collision: KinematicCollision2D): - do_damage(collision.collider) diff --git a/src/behaviours/damage/Damaging.tscn b/src/behaviours/damage/Damaging.tscn index 0681ac7..c544712 100644 --- a/src/behaviours/damage/Damaging.tscn +++ b/src/behaviours/damage/Damaging.tscn @@ -7,5 +7,4 @@ script = ExtResource( 1 ) __meta__ = { "_editor_description_": "Allows the object to damage Damageable nodes." } -damage = 1 -destroy_on_damage = true +damage = -1.0 diff --git a/src/behaviours/damage/Flammable.gd b/src/behaviours/damage/Flammable.gd index b4a6a5f..4f30c2f 100644 --- a/src/behaviours/damage/Flammable.gd +++ b/src/behaviours/damage/Flammable.gd @@ -2,8 +2,8 @@ extends Node class_name Flammable -signal caught_fire -signal extinguished_fire +signal caught_fire(origin) +signal extinguished_fire(origin) var on_fire = false @@ -11,9 +11,11 @@ var on_fire = false func catch_fire(): if not on_fire: - emit_signal("caught_fire") + on_fire = true + emit_signal("caught_fire", self) func extinguish_fire(): if on_fire: - emit_signal("extinguished_fire") + on_fire = false + emit_signal("extinguished_fire", self) diff --git a/src/behaviours/damage/Ownership.gd b/src/behaviours/damage/Ownership.gd index 0286a91..e5fa53f 100644 --- a/src/behaviours/damage/Ownership.gd +++ b/src/behaviours/damage/Ownership.gd @@ -2,12 +2,12 @@ extends Node class_name Ownership -var entity_owner: Node = null +var entity_owner = null -static func get_value(first) -> Node: - var first_node = first.get_node("Ownership") - var first_eowner = null - if first_node != null: - first_eowner = first_node.entity_owner - return first_eowner +static func discover(node): + var ownership_node = node.get_node("Ownership") + if ownership_node != null: + return ownership_node.entity_owner + else: + return null diff --git a/src/behaviours/graphics/FourSidedSprite.gd b/src/behaviours/graphics/FourSidedSprite.gd index 054849b..7a97819 100644 --- a/src/behaviours/graphics/FourSidedSprite.gd +++ b/src/behaviours/graphics/FourSidedSprite.gd @@ -2,28 +2,24 @@ extends AnimatedSprite class_name FourSidedSprite -const UP_LEFT = -3*PI/4 -const UP_RIGHT = -PI/4 -const DOWN_RIGHT = PI/4 -const DOWN_LEFT = 3*PI/4 +const UP_LEFT = -3*TAU/8 +const UP_RIGHT = -TAU/8 +const DOWN_RIGHT = TAU/8 +const DOWN_LEFT = 3*TAU/8 func turn(direction: Vector2) -> String: var angle = direction.angle() var anime - if _between(UP_LEFT, angle, UP_RIGHT): + if Utils.is_between(UP_LEFT, angle, UP_RIGHT): anime = "up" - elif _between(UP_RIGHT, angle, DOWN_RIGHT): + elif Utils.is_between(UP_RIGHT, angle, DOWN_RIGHT): anime = "right" - elif _between(DOWN_RIGHT, angle, DOWN_LEFT): + elif Utils.is_between(DOWN_RIGHT, angle, DOWN_LEFT): anime = "down" else: anime = "left" play(anime) return animation - - -func _between(m, val, x) -> bool: - return (m < val) && (val <= x) diff --git a/src/behaviours/graphics/RandomRotationOnReady.gd b/src/behaviours/graphics/RandomRotationOnReady.gd index e813607..bbcdb83 100644 --- a/src/behaviours/graphics/RandomRotationOnReady.gd +++ b/src/behaviours/graphics/RandomRotationOnReady.gd @@ -2,8 +2,8 @@ extends Node class_name RandomRotationOnReady -onready var parent: Node2D = get_parent() -onready var rng: RandomNumberGenerator = get_tree().root.get_node("Game/RNG").rng +onready var parent = get_parent() +onready var rng = get_tree().root.get_node("Game/RNG").rng func _ready(): diff --git a/src/behaviours/movement/AttractedToMovement.gd b/src/behaviours/movement/AttractedToMovement.gd index 5cfa318..8090522 100644 --- a/src/behaviours/movement/AttractedToMovement.gd +++ b/src/behaviours/movement/AttractedToMovement.gd @@ -2,34 +2,35 @@ extends Node class_name AttractedToMovement -signal moving_in_direction(direction) -signal touching_goal(who) -signal goal_reached(who) +signal moved_in_direction(origin, direction) +signal goal_reached(origin, who) +signal collided(origin, collision) -export var movement_per_second: float +export(float) var movement_per_second -onready var parent: KinematicBody2D = get_parent() +onready var parent = get_parent() -var goal: Node2D = null -var _goal_reached_triggered: bool = false +var goal -func move(): - var direction: Vector2 = (goal.global_position - parent.global_position).normalized() - emit_signal("moving_in_direction", direction) - var _motion: Vector2 = parent.move_and_slide(direction * movement_per_second, Vector2.ZERO) +func _move(): + var direction = (goal.global_position - parent.global_position).normalized() + var _motion = parent.move_and_slide(direction * movement_per_second) + _handle_collisions() + emit_signal("moved_in_direction", self, direction) + + +func _handle_collisions(): for slide_no in parent.get_slide_count(): - var slide = parent.get_slide_collision(slide_no) - if slide.collider == goal: - emit_signal("touching_goal", self) - if not _goal_reached_triggered: - emit_signal("goal_reached", self) - _goal_reached_triggered = true + var collision = parent.get_slide_collision(slide_no) + emit_signal("collided", self, collision) + if collision.collider == goal: + emit_signal("goal_reached", self) func _physics_process(_delta): if goal: - move() + _move() diff --git a/src/behaviours/movement/BulletMovement.gd b/src/behaviours/movement/BulletMovement.gd index 649446c..917b5de 100644 --- a/src/behaviours/movement/BulletMovement.gd +++ b/src/behaviours/movement/BulletMovement.gd @@ -2,17 +2,19 @@ extends Node class_name BulletMovement -signal hit(collision) +signal moved_in_direction(origin, direction) +signal collided(origin, collision) export var movement_per_second: float -onready var target: KinematicBody2D = get_parent() +onready var parent = get_parent() func _physics_process(delta): - var direction = Vector2(cos(target.rotation), sin(target.rotation)) - var collision: KinematicCollision2D = target.move_and_collide(direction * movement_per_second * delta) + var direction = Vector2(cos(parent.rotation), sin(parent.rotation)) + var collision = parent.move_and_collide(direction * movement_per_second * delta) if collision != null: - emit_signal("hit", collision) + emit_signal("collided", self, collision) + emit_signal("moved_in_direction", self, direction) diff --git a/src/behaviours/movement/ErraticMovement.gd b/src/behaviours/movement/ErraticMovement.gd deleted file mode 100644 index 99f0ccd..0000000 --- a/src/behaviours/movement/ErraticMovement.gd +++ /dev/null @@ -1,14 +0,0 @@ -extends Node -class_name ErraticMovement - - -export var movement_per_second: float - - -onready var target: KinematicBody2D = get_parent() -onready var rng: RandomNumberGenerator = get_tree().root.get_node("Game/RNG").rng - - -func _physics_process(_delta): - var direction: Vector2 = Vector2(rng.randf_range(-1, 1), rng.randf_range(-1, 1)).normalized() - var _motion: Vector2 = target.move_and_slide(direction * movement_per_second, Vector2.ZERO) diff --git a/src/behaviours/movement/ErraticMovement.tscn b/src/behaviours/movement/ErraticMovement.tscn deleted file mode 100644 index 1cd7d6b..0000000 --- a/src/behaviours/movement/ErraticMovement.tscn +++ /dev/null @@ -1,7 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/movement/ErraticMovement.gd" type="Script" id=1] - -[node name="ErraticMovement" type="Node"] -script = ExtResource( 1 ) -movement_per_second = 16.0 diff --git a/src/behaviours/movement/PlayerMovement.gd b/src/behaviours/movement/PlayerMovement.gd index 8667d43..f48399b 100644 --- a/src/behaviours/movement/PlayerMovement.gd +++ b/src/behaviours/movement/PlayerMovement.gd @@ -2,7 +2,8 @@ extends Node class_name PlayerMovement -signal moving_in_direction(direction) +signal moved_in_direction(origin, direction) +signal collided(origin, collision) export var movement_per_second: float @@ -11,7 +12,7 @@ export var movement_per_second: float onready var parent: KinematicBody2D = get_parent() -func _physics_process(_delta): +func _read_direction(): var direction = Vector2.ZERO direction += Input.get_action_strength("player_move_up") * Vector2.UP direction += Input.get_action_strength("player_move_down") * Vector2.DOWN @@ -21,6 +22,21 @@ func _physics_process(_delta): # Basically, "cap" movement at 1 if direction.length() > 1: direction.normalized() + return direction - emit_signal("moving_in_direction", direction) - var _motion: Vector2 = parent.move_and_slide(direction * movement_per_second, Vector2.ZERO) + +func _move(): + var direction = _read_direction() + var _motion = parent.move_and_slide(direction * movement_per_second, Vector2.ZERO) + _handle_collisions() + emit_signal("moved_in_direction", self, direction.normalized()) + + +func _handle_collisions(): + for slide_no in parent.get_slide_count(): + var collision = parent.get_slide_collision(slide_no) + emit_signal("collided", self, collision) + + +func _physics_process(_delta): + _move() diff --git a/src/behaviours/movement/TeleportToRandomPosition.gd b/src/behaviours/movement/TeleportToRandomPosition.gd index 0b7a73f..229f7d0 100644 --- a/src/behaviours/movement/TeleportToRandomPosition.gd +++ b/src/behaviours/movement/TeleportToRandomPosition.gd @@ -2,10 +2,10 @@ extends Node class_name TeleportToScreenEdge -signal teleported(to) +signal teleported(origin) -export var bounds: Vector2 +export(Vector2) var bounds onready var parent = get_parent() @@ -19,9 +19,8 @@ func teleport(): ) parent.set_position(new_position) - emit_signal("teleported", parent.position) + emit_signal("teleported", self) func _handle_spawned(_node): teleport() - \ No newline at end of file diff --git a/src/behaviours/movement/TeleportToScreenEdge.gd b/src/behaviours/movement/TeleportToScreenEdge.gd index 572cb96..3f552d3 100644 --- a/src/behaviours/movement/TeleportToScreenEdge.gd +++ b/src/behaviours/movement/TeleportToScreenEdge.gd @@ -2,10 +2,10 @@ extends Node class_name TeleportToRandomPosition -signal teleported(to) +signal teleported(origin) -export var bounds: Vector2 +export(Vector2) var bounds onready var parent = get_parent() @@ -30,8 +30,8 @@ func teleport(): new_position = Vector2(rng.randf_range(0, bounds.x), bounds.y) parent.set_position(new_position) - emit_signal("teleported", parent.position) + emit_signal("teleported", self) -func _handle_spawned(_node): +func _on_SpawnEveryPeriod_spawned(_origin, _node): teleport() diff --git a/src/behaviours/spawning/DropLoot.gd b/src/behaviours/spawning/DropLoot.gd index cb8f400..ea8d6b0 100644 --- a/src/behaviours/spawning/DropLoot.gd +++ b/src/behaviours/spawning/DropLoot.gd @@ -4,12 +4,12 @@ class_name DropLoot export(Array, PackedScene) var loot_types export(Array, float) var loot_weights +export(String) var container_name -# This may break if the container structure is changed -onready var source: Node2D = get_parent() -onready var container: Node = get_node(@"../../../Pickups") -onready var rng: RandomNumberGenerator = get_tree().root.get_node("Game/RNG").rng +onready var source = get_parent() +onready var container = get_tree().root.find_node(container_name, true, false) +onready var rng = get_tree().root.get_node("Game/RNG").rng func _ready(): @@ -17,8 +17,8 @@ func _ready(): push_error("The amount of loot types and loot weights is different!") -func select_drop() -> PackedScene: - var total_weights: float = 0.0 +func select_drop(): + var total_weights = 0.0 for weight in loot_weights: total_weights += weight @@ -35,13 +35,13 @@ func select_drop() -> PackedScene: return null -func create_drop() -> Node: +func create_drop(): var scene = select_drop() # Allow dropping nothing if scene == null: return null var node = scene.instance() - node.set_position(source.global_position) container.add_child(node) + node.set_position(source.global_position) return node diff --git a/src/behaviours/spawning/FreeWhenShapeIsOffScreen.gd b/src/behaviours/spawning/FreeWhenShapeIsOffScreen.gd index 493591d..d26a68c 100644 --- a/src/behaviours/spawning/FreeWhenShapeIsOffScreen.gd +++ b/src/behaviours/spawning/FreeWhenShapeIsOffScreen.gd @@ -2,13 +2,13 @@ extends VisibilityNotifier2D class_name FreeWhenShapeIsOffScreen -onready var shape: Node = get_parent() -onready var target: Node = shape.get_parent() +onready var parent = get_parent() +onready var target = parent.get_parent() func _ready(): # This is gonna break. - var ext = shape.shape.extents + var ext = parent.shape.extents rect = Rect2(-ext.x, -ext.y, ext.x * 2, ext.y * 2) diff --git a/src/behaviours/spawning/ShootOnClick.gd b/src/behaviours/spawning/ShootOnClick.gd new file mode 100644 index 0000000..fcd883e --- /dev/null +++ b/src/behaviours/spawning/ShootOnClick.gd @@ -0,0 +1,14 @@ +extends Node +class_name ShootOnClick + + +export(int) var rapid_fire_instances + + +onready var parent = get_parent() + + +func _process(_delta): + if Input.is_action_pressed("player_shoot") if rapid_fire_instances > 0 else Input.is_action_just_pressed("player_shoot"): + var target = parent.parent.get_global_mouse_position() + parent.shoot(parent.parent.get_angle_to(target)) diff --git a/src/behaviours/spawning/ShootOnClick.tscn b/src/behaviours/spawning/ShootOnClick.tscn new file mode 100644 index 0000000..73aad41 --- /dev/null +++ b/src/behaviours/spawning/ShootOnClick.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/spawning/ShootOnClick.gd" type="Script" id=1] + +[node name="ShootOnClick" type="Node"] +script = ExtResource( 1 ) diff --git a/src/behaviours/spawning/ShootWhenPossible.gd b/src/behaviours/spawning/ShootWhenPossible.gd new file mode 100644 index 0000000..a627af2 --- /dev/null +++ b/src/behaviours/spawning/ShootWhenPossible.gd @@ -0,0 +1,9 @@ +extends Node +class_name ShootWhenPossible + + +onready var parent = get_parent() + + +func _process(_delta): + parent.shoot(parent.rotation) diff --git a/src/behaviours/spawning/ShootWhenPossible.tscn b/src/behaviours/spawning/ShootWhenPossible.tscn new file mode 100644 index 0000000..aff023e --- /dev/null +++ b/src/behaviours/spawning/ShootWhenPossible.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/spawning/ShootWhenPossible.gd" type="Script" id=1] + +[node name="ShootWhenPossible" type="Node"] +script = ExtResource( 1 ) diff --git a/src/behaviours/spawning/SpawnEveryPeriod.gd b/src/behaviours/spawning/SpawnEveryPeriod.gd index 2ae3539..de2c48d 100644 --- a/src/behaviours/spawning/SpawnEveryPeriod.gd +++ b/src/behaviours/spawning/SpawnEveryPeriod.gd @@ -1,36 +1,22 @@ -extends Node2D +extends Node class_name SpawnEveryPeriod -signal spawned(node) +signal spawned(origin, node) -export var spawning: PackedScene -export var bounds: Vector2 setget set_bounds, get_bounds -export var period_secs: float setget set_period, get_period +export(PackedScene) var spawning +export(String) var container_name -onready var container = get_parent() +onready var parent = get_parent() +onready var container = get_tree().root.find_node(container_name, true, false) func spawn(): if spawning == null: return - var node: Node2D = spawning.instance() + var node = spawning.instance() container.add_child(node) - node.set_position(global_position) - emit_signal("spawned", node) - - -func set_bounds(value): - $TeleportToScreenEdge.bounds = value - -func get_bounds(): - return $TeleportToScreenEdge.bounds - - -func set_period(value): - $Period.wait_time = value - -func get_period(): - return $Period.wait_time + node.set_position(parent.global_position) + emit_signal("spawned", self, node) diff --git a/src/behaviours/spawning/SpawnEveryPeriod.tscn b/src/behaviours/spawning/SpawnEveryPeriod.tscn index 75b250e..4aec6ce 100644 --- a/src/behaviours/spawning/SpawnEveryPeriod.tscn +++ b/src/behaviours/spawning/SpawnEveryPeriod.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://src/behaviours/spawning/SpawnEveryPeriod.gd" type="Script" id=1] -[node name="SpawnEveryPeriod" type="Node2D"] +[node name="SpawnEveryPeriod" type="Node"] script = ExtResource( 1 ) [node name="Period" type="Timer" parent="."] diff --git a/src/behaviours/spawning/SpawnOnShoot.gd b/src/behaviours/spawning/SpawnOnShoot.gd index 1251aaa..f9d3373 100644 --- a/src/behaviours/spawning/SpawnOnShoot.gd +++ b/src/behaviours/spawning/SpawnOnShoot.gd @@ -1,43 +1,28 @@ -extends Node2D +extends Node class_name SpawnOnShoot -signal shot(bullet) +signal shot(origin, bullet) -export var bullet: PackedScene -export var cooldown: float setget set_cooldown, get_cooldown -export var rapid_fire: bool -export var angle_offset: float +export(PackedScene) var spawning +export(float) var angle_offset +export(String) var container_name -onready var parent: Node2D = get_parent() -onready var container: Node = get_tree().root.find_node("Bullets", true, false) +onready var parent = get_parent() +onready var container = get_tree().root.find_node(container_name, true, false) -func set_cooldown(value): - $Cooldown.wait_time = value - -func get_cooldown() -> float: - return $Cooldown.wait_time - - -func shoot(target): - var node = bullet.instance() +func shoot(angle): + if not $Cooldown.is_stopped(): + return + var node = spawning.instance() container.add_child(node) - node.set_position(global_position) - node.set_rotation(node.get_angle_to(target) + angle_offset) + node.set_position(parent.global_position) + node.set_rotation(angle + angle_offset) node.get_node("Ownership").entity_owner = parent node.add_collision_exception_with(parent) - emit_signal("shot") $Sound.play() $Cooldown.start() - - -func _process(_delta): - var not_on_cooldown: bool = $Cooldown.is_stopped() - var trying_to_shoot: bool = Input.is_action_pressed("player_shoot") if rapid_fire else Input.is_action_just_pressed("player_shoot") - - if not_on_cooldown and trying_to_shoot: - var target = get_global_mouse_position() - shoot(target) + emit_signal("shot", self, node) diff --git a/src/behaviours/spawning/SpawnOnShoot.tscn b/src/behaviours/spawning/SpawnOnShoot.tscn index 7b95eb2..1fba655 100644 --- a/src/behaviours/spawning/SpawnOnShoot.tscn +++ b/src/behaviours/spawning/SpawnOnShoot.tscn @@ -3,7 +3,7 @@ [ext_resource path="res://src/behaviours/spawning/SpawnOnShoot.gd" type="Script" id=1] [ext_resource path="res://src/sounds/Arrow.mp3" type="AudioStream" id=2] -[node name="SpawnOnShoot" type="Node2D"] +[node name="SpawnOnShoot" type="Node"] script = ExtResource( 1 ) [node name="Cooldown" type="Timer" parent="."] diff --git a/src/behaviours/targeting/SetGoalReachedConsequences.gd b/src/behaviours/targeting/SetGoalReachedConsequences.gd deleted file mode 100644 index e16e6dc..0000000 --- a/src/behaviours/targeting/SetGoalReachedConsequences.gd +++ /dev/null @@ -1,13 +0,0 @@ -extends Node - - -signal goal_reached(who) - - -func set_consequences(node): - var movement = node.get_node("AttractedToMovement") - movement.connect("goal_reached", self, "_on_goal_reached") - - -func _on_goal_reached(who): - emit_signal("goal_reached", who) diff --git a/src/behaviours/targeting/SetGoalReachedConsequences.tscn b/src/behaviours/targeting/SetGoalReachedConsequences.tscn deleted file mode 100644 index 213ffe8..0000000 --- a/src/behaviours/targeting/SetGoalReachedConsequences.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/targeting/SetGoalReachedConsequences.gd" type="Script" id=1] - -[node name="SetGoalReachedConsequences" type="Node"] -script = ExtResource( 1 ) diff --git a/src/behaviours/targeting/SetSpawnedATMGoalTo.gd b/src/behaviours/targeting/SetSpawnedATMGoalTo.gd new file mode 100644 index 0000000..c751ffc --- /dev/null +++ b/src/behaviours/targeting/SetSpawnedATMGoalTo.gd @@ -0,0 +1,21 @@ +extends Node +class_name SetSpawnedATMGoalTo + + +signal set_goal(origin, target) + + +export(NodePath) var goal_path + + +onready var goal = get_node(goal_path) + + +func set_goal(node): + var movement = node.get_node("AttractedToMovement") + movement.goal = goal + emit_signal("set_goal", self, movement) + + +func _on_SpawnEveryPeriod_spawned(_origin, node): + set_goal(node) diff --git a/src/behaviours/targeting/SetSpawnedGoalTo.tscn b/src/behaviours/targeting/SetSpawnedATMGoalTo.tscn similarity index 52% rename from src/behaviours/targeting/SetSpawnedGoalTo.tscn rename to src/behaviours/targeting/SetSpawnedATMGoalTo.tscn index 817d80f..9153359 100644 --- a/src/behaviours/targeting/SetSpawnedGoalTo.tscn +++ b/src/behaviours/targeting/SetSpawnedATMGoalTo.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://src/behaviours/targeting/SetSpawnedGoalTo.gd" type="Script" id=1] +[ext_resource path="res://src/behaviours/targeting/SetSpawnedATMGoalTo.gd" type="Script" id=1] [node name="SetSpawnedGoalTo" type="Node"] script = ExtResource( 1 ) diff --git a/src/behaviours/targeting/SetSpawnedGoalTo.gd b/src/behaviours/targeting/SetSpawnedGoalTo.gd deleted file mode 100644 index 6d2321c..0000000 --- a/src/behaviours/targeting/SetSpawnedGoalTo.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends Node -class_name SetSpawnedGoalTo - - -export var goal_path: NodePath -onready var goal = get_node(goal_path) - - -func set_goal(node): - var movement = node.get_node("AttractedToMovement") - movement.goal = goal diff --git a/src/entities/bullets/AbstractBullet.tscn b/src/entities/bullets/AbstractBullet.tscn index 2158d82..493ea5a 100644 --- a/src/entities/bullets/AbstractBullet.tscn +++ b/src/entities/bullets/AbstractBullet.tscn @@ -13,5 +13,4 @@ collision_mask = 2 [node name="Ownership" parent="." instance=ExtResource( 2 )] [node name="Damaging" parent="." instance=ExtResource( 3 )] - -[connection signal="hit" from="BulletMovement" to="Damaging" method="do_damage_to_collider"] +destroy_after_damage = true diff --git a/src/entities/bullets/Arrow.gd b/src/entities/bullets/Arrow.gd new file mode 100644 index 0000000..26c7837 --- /dev/null +++ b/src/entities/bullets/Arrow.gd @@ -0,0 +1,23 @@ +extends KinematicBody2D +class_name Arrow + + +export(Texture) var dim_texture +export(int) var dim_damage + +export(Texture) var lit_texture +export(int) var lit_damage + + +func _on_Flammable_caught_fire(_origin): + $Shape/Sprite.texture = lit_texture + $Damaging.damage = lit_damage + $Damaging.destroy_after_damage = false + $Light.visible = true + + +func _on_Flammable_extinguished_fire(_origin): + $Shape/Sprite.texture = dim_texture + $Damaging.damage = dim_damage + $Damaging.destroy_after_damage = true + $Light.visible = false diff --git a/src/entities/bullets/Arrow.png b/src/entities/bullets/Arrow.png index 6a95cff..8e08173 100644 --- a/src/entities/bullets/Arrow.png +++ b/src/entities/bullets/Arrow.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0842c896f21f87347c70f1feab8f05f4046277f947db107a97ff843d395c1abf -size 892 +oid sha256:49d0ba7c71b3d99f2711befc37cdee43c311bd96386b5cb96fa36019e7616853 +size 158 diff --git a/src/entities/bullets/Arrow.tscn b/src/entities/bullets/Arrow.tscn index 421bb5c..0111b0e 100644 --- a/src/entities/bullets/Arrow.tscn +++ b/src/entities/bullets/Arrow.tscn @@ -1,13 +1,22 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://src/entities/bullets/AbstractBullet.tscn" type="PackedScene" id=1] [ext_resource path="res://src/entities/bullets/Arrow.png" type="Texture" id=2] -[ext_resource path="res://src/behaviours/spawning/FreeWhenShapeIsOffScreen.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/entities/bullets/Arrow.gd" type="Script" id=3] +[ext_resource path="res://src/behaviours/damage/Flammable.tscn" type="PackedScene" id=4] +[ext_resource path="res://src/mechanics/Light.png" type="Texture" id=5] +[ext_resource path="res://src/behaviours/spawning/FreeWhenShapeIsOffScreen.tscn" type="PackedScene" id=6] +[ext_resource path="res://src/entities/bullets/ArrowFire.png" type="Texture" id=7] [sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 16, 6 ) +extents = Vector2( 6, 1.5 ) [node name="Arrow" instance=ExtResource( 1 )] +script = ExtResource( 3 ) +dim_texture = ExtResource( 2 ) +dim_damage = 1 +lit_texture = ExtResource( 7 ) +lit_damage = 5 [node name="Shape" type="CollisionShape2D" parent="." index="0"] shape = SubResource( 1 ) @@ -15,7 +24,19 @@ shape = SubResource( 1 ) [node name="Sprite" type="Sprite" parent="Shape" index="0"] texture = ExtResource( 2 ) -[node name="FreeWhenShapeIsOffScreen" parent="Shape" index="1" instance=ExtResource( 3 )] +[node name="FreeWhenShapeIsOffScreen" parent="Shape" index="1" instance=ExtResource( 6 )] [node name="BulletMovement" parent="." index="1"] movement_per_second = 400.0 + +[node name="Light" type="Light2D" parent="." index="4"] +visible = false +position = Vector2( 5, 0 ) +texture = ExtResource( 5 ) +texture_scale = 0.02 +color = Color( 1, 0.607843, 0, 1 ) + +[node name="Flammable" parent="." index="5" instance=ExtResource( 4 )] + +[connection signal="caught_fire" from="Flammable" to="." method="_on_Flammable_caught_fire"] +[connection signal="extinguished_fire" from="Flammable" to="." method="_on_Flammable_extinguished_fire"] diff --git a/src/entities/bullets/ArrowAlternative.gd b/src/entities/bullets/ArrowAlternative.gd deleted file mode 100644 index 63bc968..0000000 --- a/src/entities/bullets/ArrowAlternative.gd +++ /dev/null @@ -1,23 +0,0 @@ -extends KinematicBody2D -class_name ArrowAlternative - - -export var dim_texture: Texture = preload("res://src/entities/bullets/ArrowAlternative.png") -export var dim_damage: int = 1 - -export var lit_texture: Texture = preload("res://src/entities/bullets/ArrowAlternativeOnFire.png") -export var lit_damage: int = 5 - - -func _on_Flammable_caught_fire(): - $Shape/Sprite.texture = lit_texture - $Damaging.damage = lit_damage - $Damaging.destroy_on_damage = false - $Light.visible = true - - -func _on_Flammable_extinguished_fire(): - $Shape/Sprite.texture = dim_texture - $Damaging.damage = dim_damage - $Damaging.destroy_on_damage = true - $Light.visible = false diff --git a/src/entities/bullets/ArrowAlternative.png b/src/entities/bullets/ArrowAlternative.png deleted file mode 100644 index 8e08173..0000000 --- a/src/entities/bullets/ArrowAlternative.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:49d0ba7c71b3d99f2711befc37cdee43c311bd96386b5cb96fa36019e7616853 -size 158 diff --git a/src/entities/bullets/ArrowAlternative.png.import b/src/entities/bullets/ArrowAlternative.png.import deleted file mode 100644 index 7eee017..0000000 --- a/src/entities/bullets/ArrowAlternative.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/ArrowAlternative.png-83943b77de3726256aea2b460f0a30e4.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/entities/bullets/ArrowAlternative.png" -dest_files=[ "res://.import/ArrowAlternative.png-83943b77de3726256aea2b460f0a30e4.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=true -svg/scale=1.0 diff --git a/src/entities/bullets/ArrowAlternative.tscn b/src/entities/bullets/ArrowAlternative.tscn deleted file mode 100644 index 5684d1c..0000000 --- a/src/entities/bullets/ArrowAlternative.tscn +++ /dev/null @@ -1,37 +0,0 @@ -[gd_scene load_steps=8 format=2] - -[ext_resource path="res://src/entities/bullets/AbstractBullet.tscn" type="PackedScene" id=1] -[ext_resource path="res://src/entities/bullets/ArrowAlternative.png" type="Texture" id=2] -[ext_resource path="res://src/entities/bullets/ArrowAlternative.gd" type="Script" id=3] -[ext_resource path="res://src/behaviours/damage/Flammable.tscn" type="PackedScene" id=4] -[ext_resource path="res://src/mechanics/Light.png" type="Texture" id=5] -[ext_resource path="res://src/behaviours/spawning/FreeWhenShapeIsOffScreen.tscn" type="PackedScene" id=6] - -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 6, 1.5 ) - -[node name="ArrowAlternative" instance=ExtResource( 1 )] -script = ExtResource( 3 ) - -[node name="Shape" type="CollisionShape2D" parent="." index="0"] -shape = SubResource( 1 ) - -[node name="Sprite" type="Sprite" parent="Shape" index="0"] -texture = ExtResource( 2 ) - -[node name="FreeWhenShapeIsOffScreen" parent="Shape" index="1" instance=ExtResource( 6 )] - -[node name="BulletMovement" parent="." index="1"] -movement_per_second = 400.0 - -[node name="Light" type="Light2D" parent="." index="4"] -visible = false -position = Vector2( 5, 0 ) -texture = ExtResource( 5 ) -texture_scale = 0.02 -color = Color( 1, 0.607843, 0, 1 ) - -[node name="Flammable" parent="." index="5" instance=ExtResource( 4 )] - -[connection signal="caught_fire" from="Flammable" to="." method="_on_Flammable_caught_fire"] -[connection signal="extinguished_fire" from="Flammable" to="." method="_on_Flammable_extinguished_fire"] diff --git a/src/entities/bullets/ArrowAlternativeOnFire.png.import b/src/entities/bullets/ArrowAlternativeOnFire.png.import deleted file mode 100644 index b498cc0..0000000 --- a/src/entities/bullets/ArrowAlternativeOnFire.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/ArrowAlternativeOnFire.png-8a0ce235161d77b846223626ffd5e8d6.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/entities/bullets/ArrowAlternativeOnFire.png" -dest_files=[ "res://.import/ArrowAlternativeOnFire.png-8a0ce235161d77b846223626ffd5e8d6.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=true -svg/scale=1.0 diff --git a/src/entities/bullets/ArrowAlternativeOnFire.png b/src/entities/bullets/ArrowFire.png similarity index 100% rename from src/entities/bullets/ArrowAlternativeOnFire.png rename to src/entities/bullets/ArrowFire.png diff --git a/src/mechanics/EnemySpider.png.import b/src/entities/bullets/ArrowFire.png.import similarity index 70% rename from src/mechanics/EnemySpider.png.import rename to src/entities/bullets/ArrowFire.png.import index de04712..649ed17 100644 --- a/src/mechanics/EnemySpider.png.import +++ b/src/entities/bullets/ArrowFire.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/EnemySpider.png-c95784f88ad7e56ff4e9578701ea7904.stex" +path="res://.import/ArrowFire.png-3ca6cc210fd6ec182e20326648c8302d.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/mechanics/EnemySpider.png" -dest_files=[ "res://.import/EnemySpider.png-c95784f88ad7e56ff4e9578701ea7904.stex" ] +source_file="res://src/entities/bullets/ArrowFire.png" +dest_files=[ "res://.import/ArrowFire.png-3ca6cc210fd6ec182e20326648c8302d.stex" ] [params] diff --git a/src/entities/bullets/PiercingArrow.png b/src/entities/bullets/PiercingArrow.png new file mode 100644 index 0000000..6a95cff --- /dev/null +++ b/src/entities/bullets/PiercingArrow.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0842c896f21f87347c70f1feab8f05f4046277f947db107a97ff843d395c1abf +size 892 diff --git a/src/entities/fire/Fire-v2-f0000.png.import b/src/entities/bullets/PiercingArrow.png.import similarity index 69% rename from src/entities/fire/Fire-v2-f0000.png.import rename to src/entities/bullets/PiercingArrow.png.import index 3d369bb..ffc6188 100644 --- a/src/entities/fire/Fire-v2-f0000.png.import +++ b/src/entities/bullets/PiercingArrow.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/Fire-v2-f0000.png-c3c7633cb72ff2aa54d8a1d627a73199.stex" +path="res://.import/PiercingArrow.png-cc699c14f201167c707e32420ad72b4a.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/entities/fire/Fire-v2-f0000.png" -dest_files=[ "res://.import/Fire-v2-f0000.png-c3c7633cb72ff2aa54d8a1d627a73199.stex" ] +source_file="res://src/entities/bullets/PiercingArrow.png" +dest_files=[ "res://.import/PiercingArrow.png-cc699c14f201167c707e32420ad72b4a.stex" ] [params] diff --git a/src/entities/bullets/PiercingArrow.tscn b/src/entities/bullets/PiercingArrow.tscn new file mode 100644 index 0000000..b79fd5f --- /dev/null +++ b/src/entities/bullets/PiercingArrow.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://src/behaviours/spawning/FreeWhenShapeIsOffScreen.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/entities/bullets/PiercingArrow.png" type="Texture" id=2] +[ext_resource path="res://src/entities/bullets/AbstractBullet.tscn" type="PackedScene" id=3] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 16, 6 ) + +[node name="Arrow" instance=ExtResource( 3 )] + +[node name="Shape" type="CollisionShape2D" parent="." index="0"] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="Shape" index="0"] +texture = ExtResource( 2 ) + +[node name="FreeWhenShapeIsOffScreen" parent="Shape" index="1" instance=ExtResource( 1 )] + +[node name="BulletMovement" parent="." index="1"] +movement_per_second = 200.0 + +[node name="Damaging" parent="." index="3"] +destroy_after_damage = false diff --git a/src/entities/enemies/AbstractEnemy.tscn b/src/entities/enemies/AbstractEnemy.tscn index 294478d..512468c 100644 --- a/src/entities/enemies/AbstractEnemy.tscn +++ b/src/entities/enemies/AbstractEnemy.tscn @@ -9,5 +9,4 @@ alliance = -1 [node name="DropLoot" parent="." index="2" instance=ExtResource( 1 )] - -[connection signal="dead" from="Damageable" to="DropLoot" method="create_drop"] +container_name = "Pickups" diff --git a/src/entities/enemies/ChaserEnemy.tscn b/src/entities/enemies/ChaserEnemy.tscn index 0c0fca2..08053cf 100644 --- a/src/entities/enemies/ChaserEnemy.tscn +++ b/src/entities/enemies/ChaserEnemy.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=12 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] @@ -9,7 +9,6 @@ [ext_resource path="res://src/entities/enemies/EnemySnowmanFront.png" type="Texture" id=7] [ext_resource path="res://src/entities/enemies/EnemySnowmanRight.png" type="Texture" id=8] [ext_resource path="res://src/behaviours/graphics/FourSidedSprite.tscn" type="PackedScene" id=9] -[ext_resource path="res://src/sounds/Death.mp3" type="AudioStream" id=10] [sub_resource type="CapsuleShape2D" id=1] radius = 9.0 @@ -52,10 +51,3 @@ loot_types = [ null, ExtResource( 2 ), ExtResource( 5 ) ] loot_weights = [ 1.0, 1.0, 0.1 ] [node name="AttractedToMovement" parent="." index="4" instance=ExtResource( 3 )] - -[node name="MeltSound" parent="." index="5"] -stream = ExtResource( 10 ) - -[connection signal="dead" from="Damageable" to="DropLoot" method="create_drop"] -[connection signal="dead" from="Damageable" to="MeltSound" method="_on_Damageable_dead"] -[connection signal="moving_in_direction" from="AttractedToMovement" to="Shape/FourSidedSprite" method="turn"] diff --git a/src/mechanics/EnemySpider.png b/src/entities/enemies/EnemySpider.png similarity index 100% rename from src/mechanics/EnemySpider.png rename to src/entities/enemies/EnemySpider.png diff --git a/src/entities/enemies/EnemySpider.png.import b/src/entities/enemies/EnemySpider.png.import new file mode 100644 index 0000000..a5ebdc5 --- /dev/null +++ b/src/entities/enemies/EnemySpider.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/EnemySpider.png-cb28a041f7bd929ab2ebedaf573389ea.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/entities/enemies/EnemySpider.png" +dest_files=[ "res://.import/EnemySpider.png-cb28a041f7bd929ab2ebedaf573389ea.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=true +svg/scale=1.0 diff --git a/src/mechanics/EnemySpiderSanta.png b/src/entities/enemies/EnemySpiderSanta.png similarity index 100% rename from src/mechanics/EnemySpiderSanta.png rename to src/entities/enemies/EnemySpiderSanta.png diff --git a/src/mechanics/EnemySpiderSanta.png.import b/src/entities/enemies/EnemySpiderSanta.png.import similarity index 68% rename from src/mechanics/EnemySpiderSanta.png.import rename to src/entities/enemies/EnemySpiderSanta.png.import index 73987f2..2ed61cf 100644 --- a/src/mechanics/EnemySpiderSanta.png.import +++ b/src/entities/enemies/EnemySpiderSanta.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/EnemySpiderSanta.png-eac0456ac0f4bbe49e411b81e6d559f8.stex" +path="res://.import/EnemySpiderSanta.png-cba6da66b147fcf646d5ce8562f321c5.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/mechanics/EnemySpiderSanta.png" -dest_files=[ "res://.import/EnemySpiderSanta.png-eac0456ac0f4bbe49e411b81e6d559f8.stex" ] +source_file="res://src/entities/enemies/EnemySpiderSanta.png" +dest_files=[ "res://.import/EnemySpiderSanta.png-cba6da66b147fcf646d5ce8562f321c5.stex" ] [params] diff --git a/src/entities/enemies/PathEnemy.tscn b/src/entities/enemies/PathEnemy.tscn new file mode 100644 index 0000000..831294c --- /dev/null +++ b/src/entities/enemies/PathEnemy.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://src/entities/enemies/EnemySpider.png" type="Texture" id=1] +[ext_resource path="res://src/entities/enemies/AbstractEnemy.tscn" type="PackedScene" id=2] + +[sub_resource type="CircleShape2D" id=1] +radius = 33.0 + +[node name="PathEnemy" instance=ExtResource( 2 )] + +[node name="Shape" type="CollisionShape2D" parent="." index="0"] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="Shape" index="0"] +texture = ExtResource( 1 ) diff --git a/src/entities/fire/Fire-v2-f0000.png b/src/entities/fire/Fire-v2-f0000.png deleted file mode 100644 index 974d863..0000000 --- a/src/entities/fire/Fire-v2-f0000.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2bb3387aa63f262bb110372fd012b0f1be3e1f48887dc8b82ae5d9c55d08d975 -size 6903 diff --git a/src/entities/fire/Fire-v2-f0002.png b/src/entities/fire/Fire-v2-f0002.png deleted file mode 100644 index dd6dbad..0000000 --- a/src/entities/fire/Fire-v2-f0002.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5854a793302bb3e4013201d37cc767f5a135730e427ff194bff539ca32f41b01 -size 7186 diff --git a/src/entities/fire/Fire-v2-f0002.png.import b/src/entities/fire/Fire-v2-f0002.png.import deleted file mode 100644 index 0dfbe25..0000000 --- a/src/entities/fire/Fire-v2-f0002.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/Fire-v2-f0002.png-6918086f60d08af1502a25fbd0160af4.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/entities/fire/Fire-v2-f0002.png" -dest_files=[ "res://.import/Fire-v2-f0002.png-6918086f60d08af1502a25fbd0160af4.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=true -svg/scale=1.0 diff --git a/src/entities/fire/Fire-v2-f0004.png b/src/entities/fire/Fire-v2-f0004.png deleted file mode 100644 index fa3ca32..0000000 --- a/src/entities/fire/Fire-v2-f0004.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17cca5678fdf974266852cdf8de892dade6aecabbb2b4fd849ebcdaf097b1e84 -size 8590 diff --git a/src/entities/fire/Fire-v2-f0004.png.import b/src/entities/fire/Fire-v2-f0004.png.import deleted file mode 100644 index c3c14c9..0000000 --- a/src/entities/fire/Fire-v2-f0004.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/Fire-v2-f0004.png-869043dd473b06e573b8de42a9b37843.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/entities/fire/Fire-v2-f0004.png" -dest_files=[ "res://.import/Fire-v2-f0004.png-869043dd473b06e573b8de42a9b37843.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=true -svg/scale=1.0 diff --git a/src/entities/fire/Fire-v2-f0006.png b/src/entities/fire/Fire-v2-f0006.png deleted file mode 100644 index 8bc7cdf..0000000 --- a/src/entities/fire/Fire-v2-f0006.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:996f1193cb9df5e9c72d2145acc9fa00661e52083840c30171506108943f4bd5 -size 7502 diff --git a/src/entities/fire/Fire-v2-f0006.png.import b/src/entities/fire/Fire-v2-f0006.png.import deleted file mode 100644 index 07f1dd3..0000000 --- a/src/entities/fire/Fire-v2-f0006.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/Fire-v2-f0006.png-8f88a006c846bf327208a83f85304e65.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/entities/fire/Fire-v2-f0006.png" -dest_files=[ "res://.import/Fire-v2-f0006.png-8f88a006c846bf327208a83f85304e65.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=true -svg/scale=1.0 diff --git a/src/entities/fire/Fire-v2-f0008.png b/src/entities/fire/Fire-v2-f0008.png deleted file mode 100644 index f7aef52..0000000 --- a/src/entities/fire/Fire-v2-f0008.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f8fd03ccb31affd14de98608857e6cdaf632c129ba37b987983877ffbea034a6 -size 6856 diff --git a/src/entities/fire/Fire-v2-f0008.png.import b/src/entities/fire/Fire-v2-f0008.png.import deleted file mode 100644 index 44c2507..0000000 --- a/src/entities/fire/Fire-v2-f0008.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/Fire-v2-f0008.png-ff0a69063533f0f2b8e26bd0a7c17473.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/entities/fire/Fire-v2-f0008.png" -dest_files=[ "res://.import/Fire-v2-f0008.png-ff0a69063533f0f2b8e26bd0a7c17473.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=true -svg/scale=1.0 diff --git a/src/entities/fire/Fire-v2-f0010.png b/src/entities/fire/Fire-v2-f0010.png deleted file mode 100644 index 07281a1..0000000 --- a/src/entities/fire/Fire-v2-f0010.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ac2bc3b93adb05a5f8aa9efb20c014fadc89a8c420d2720efe56383d21391c44 -size 7326 diff --git a/src/entities/fire/Fire-v2-f0010.png.import b/src/entities/fire/Fire-v2-f0010.png.import deleted file mode 100644 index cab44a8..0000000 --- a/src/entities/fire/Fire-v2-f0010.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/Fire-v2-f0010.png-8835d325650eb9a3d686496d562eb34c.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://src/entities/fire/Fire-v2-f0010.png" -dest_files=[ "res://.import/Fire-v2-f0010.png-8835d325650eb9a3d686496d562eb34c.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=true -svg/scale=1.0 diff --git a/src/entities/fire/Fire.gd b/src/entities/fire/Fire.gd index dd116fe..01c4dab 100644 --- a/src/entities/fire/Fire.gd +++ b/src/entities/fire/Fire.gd @@ -1,57 +1,14 @@ extends Node2D +class_name Fire -export var intensity: float = 1.0 setget set_intensity -export var change_per_second: float = - 1.0 / 60.0 -export var min_intensity: float = 0 -export var max_intensity: float = INF -export var enemy_touch_penalty = 0.1 - - -signal intensity_changed(value) -signal intensity_at_max -signal intensity_at_min -var intensity_reached_max_triggered: bool = false -var intensity_reached_min_triggered: bool = false -signal intensity_reached_min -signal intensity_reached_max - - -func set_intensity(value): - intensity = clamp(value, min_intensity, max_intensity) - # Update everything that needs to be updated when the intensity changes - $Flame.scale = Vector2(value, value) - # Trigger signals - emit_signal("intensity_changed", intensity) - # max intensity signal - if intensity == max_intensity: - emit_signal("intensity_at_max") - if not intensity_reached_max_triggered: - emit_signal("intensity_reached_max") - intensity_reached_max_triggered = true - else: - intensity_reached_max_triggered = false - # min intensity signal - if intensity == min_intensity: - emit_signal("intensity_at_min") - if not intensity_reached_min_triggered: - emit_signal("intensity_reached_min") - intensity_reached_min_triggered = true - else: - intensity_reached_min_triggered = false - - -func _process(delta): - set_intensity(intensity + (delta * change_per_second)) - - -func _on_Flame_body_entered(body: PhysicsBody2D): +func _on_Flame_body_entered(body): var flammable = body.get_node("Flammable") if flammable != null: flammable.catch_fire() -func _on_Enemy_goal_reached(who): - intensity -= enemy_touch_penalty - # Melt - who.queue_free() +func _on_Damageable_health_changed(origin, value): + var scale = smoothstep(origin.min_health, origin.max_health, value) * 2 + $Flame.scale = Vector2(scale, scale) + \ No newline at end of file diff --git a/src/entities/fire/Fire.tscn b/src/entities/fire/Fire.tscn index c024b30..8c9e5d4 100644 --- a/src/entities/fire/Fire.tscn +++ b/src/entities/fire/Fire.tscn @@ -1,19 +1,16 @@ -[gd_scene load_steps=20 format=2] +[gd_scene load_steps=17 format=2] [ext_resource path="res://src/mechanics/Light.png" type="Texture" id=1] [ext_resource path="res://src/entities/fire/FirePit.png" type="Texture" id=2] [ext_resource path="res://src/entities/fire/Fire.gd" type="Script" id=3] [ext_resource path="res://src/entities/fire/Fire-v1-f0006.png" type="Texture" id=4] -[ext_resource path="res://src/entities/fire/Fire-v2-f0006.png" type="Texture" id=5] -[ext_resource path="res://src/entities/fire/Fire-v2-f0008.png" type="Texture" id=6] +[ext_resource path="res://src/behaviours/damage/Damageable.tscn" type="PackedScene" id=5] +[ext_resource path="res://src/behaviours/damage/DamageEveryTick.tscn" type="PackedScene" id=6] [ext_resource path="res://src/entities/fire/Fire-v1-f0000.png" type="Texture" id=7] [ext_resource path="res://src/entities/fire/Fire-v1-f0002.png" type="Texture" id=8] -[ext_resource path="res://src/entities/fire/Fire-v2-f0002.png" type="Texture" id=9] -[ext_resource path="res://src/entities/fire/Fire-v2-f0000.png" type="Texture" id=10] +[ext_resource path="res://src/behaviours/damage/Damaging.tscn" type="PackedScene" id=9] [ext_resource path="res://src/entities/fire/Fire-v1-f0004.png" type="Texture" id=11] [ext_resource path="res://src/entities/fire/Fire-v1-f0010.png" type="Texture" id=12] -[ext_resource path="res://src/entities/fire/Fire-v2-f0004.png" type="Texture" id=13] -[ext_resource path="res://src/entities/fire/Fire-v2-f0010.png" type="Texture" id=14] [ext_resource path="res://src/entities/fire/Fire-v1-f0008.png" type="Texture" id=15] [sub_resource type="CapsuleShape2D" id=1] @@ -28,15 +25,10 @@ blend_mode = 1 [sub_resource type="SpriteFrames" id=4] animations = [ { -"frames": [ ExtResource( 10 ), ExtResource( 9 ), ExtResource( 13 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 14 ) ], -"loop": true, -"name": "v2", -"speed": 5.0 -}, { "frames": [ ExtResource( 7 ), ExtResource( 8 ), ExtResource( 11 ), ExtResource( 4 ), ExtResource( 15 ), ExtResource( 12 ) ], "loop": true, "name": "v1", -"speed": 5.0 +"speed": 8.0 } ] [node name="Fire" type="Node2D"] @@ -53,6 +45,7 @@ rotation = -1.5708 texture = ExtResource( 2 ) [node name="Flame" type="Area2D" parent="."] +position = Vector2( 1, 0 ) collision_layer = 4 collision_mask = 4 @@ -67,10 +60,21 @@ shape = SubResource( 3 ) [node name="FlameSprite" type="AnimatedSprite" parent="Flame/Shape"] material = SubResource( 2 ) +position = Vector2( 0, -12 ) z_index = 1 frames = SubResource( 4 ) animation = "v1" -frame = 4 +frame = 1 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="body_entered" from="Flame" to="." method="_on_Flame_body_entered"] +[connection signal="health_changed" from="Damageable" to="." method="_on_Damageable_health_changed"] diff --git a/src/entities/players/AbstractPlayer.tscn b/src/entities/players/AbstractPlayer.tscn index 284ed62..9797276 100644 --- a/src/entities/players/AbstractPlayer.tscn +++ b/src/entities/players/AbstractPlayer.tscn @@ -5,4 +5,7 @@ [node name="AbstractPlayer" instance=ExtResource( 3 )] +[node name="Alliance" parent="." index="0"] +alliance = 1 + [node name="PlayerMovement" parent="." index="2" instance=ExtResource( 2 )] diff --git a/src/entities/players/PhaseOnePlayer.tscn b/src/entities/players/PhaseOnePlayer.tscn index 3dbe519..783695d 100644 --- a/src/entities/players/PhaseOnePlayer.tscn +++ b/src/entities/players/PhaseOnePlayer.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://src/entities/players/AbstractPlayer.tscn" type="PackedScene" id=1] -[ext_resource path="res://src/entities/bullets/ArrowAlternative.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/behaviours/spawning/ShootOnClick.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/entities/bullets/Arrow.tscn" type="PackedScene" id=3] [ext_resource path="res://src/behaviours/spawning/SpawnOnShoot.tscn" type="PackedScene" id=4] [ext_resource path="res://src/entities/players/CharacterFrontLeft.png" type="Texture" id=5] [ext_resource path="res://src/entities/players/CharacterFront.png" type="Texture" id=6] @@ -48,8 +49,8 @@ script = ExtResource( 7 ) [node name="Listener" type="Listener2D" parent="." index="1"] current = true -[node name="SpawnOnShoot" parent="." index="2" instance=ExtResource( 4 )] -bullet = ExtResource( 3 ) -cooldown = 0.2 +[node name="SpawnOnShoot" parent="." index="5" instance=ExtResource( 4 )] +spawning = ExtResource( 3 ) +container_name = "Bullets" -[connection signal="moving_in_direction" from="PlayerMovement" to="Shape/FourSidedSprite" method="turn"] +[node name="ShootOnClick" parent="SpawnOnShoot" index="2" instance=ExtResource( 2 )] diff --git a/src/levels/Game.gd b/src/levels/Game.gd index ff9033b..6d02d3b 100644 --- a/src/levels/Game.gd +++ b/src/levels/Game.gd @@ -1,18 +1,24 @@ extends Node2D -var survival_seconds: float setget set_survival_seconds -signal survival_seconds_updated(value) +export(PackedScene) var main_menu = preload("res://src/levels/mainmenu/MainMenu.tscn") +export(PackedScene) var phase_one = preload("res://src/levels/phaseone/PhaseOne.tscn") +export(PackedScene) var user_interface = preload("res://src/levels/ui/UserInterface.tscn") -func set_survival_seconds(value): - survival_seconds = value - emit_signal("survival_seconds_updated", value) +func _ready(): + print("Starting from the menu!") + add_child(main_menu.instance()) + # warning-ignore: RETURN_VALUE_DISCARDED + $MainMenu/TheDarkNightUI/Play.connect("pressed", self, "_on_MainMenu_Play_pressed") -func _process(delta): - set_survival_seconds(survival_seconds + delta) - - -func _on_Fire_intensity_reached_min(): - print("Game over!") +func _on_MainMenu_Play_pressed(): + print("Moving to the first phase...") + $MainMenu.queue_free() + add_child(phase_one.instance()) + add_child(user_interface.instance()) + # warning-ignore: RETURN_VALUE_DISCARDED + $PhaseOne.connect("survival_seconds_updated", $UserInterface/TheDarkNightUI/TimeSurvived,"_on_PhaseOne_survival_seconds_updated") + # warning-ignore: RETURN_VALUE_DISCARDED + $UserInterface/TheDarkNightUI/MuteButton.connect("toggled", $Music, "_on_MuteButton_toggled") diff --git a/src/levels/Game.tscn b/src/levels/Game.tscn index 8e7ad6d..ae14516 100644 --- a/src/levels/Game.tscn +++ b/src/levels/Game.tscn @@ -1,188 +1,43 @@ -[gd_scene load_steps=22 format=2] +[gd_scene load_steps=9 format=2] -[ext_resource path="res://src/mechanics/Background.tscn" type="PackedScene" id=1] -[ext_resource path="res://src/mechanics/Darkness.tscn" type="PackedScene" id=2] -[ext_resource path="res://src/entities/fire/Fire.tscn" type="PackedScene" id=3] -[ext_resource path="res://src/entities/players/PhaseOnePlayer.tscn" type="PackedScene" id=4] +[ext_resource path="res://src/music/BossDrum.mp3" type="AudioStream" id=3] [ext_resource path="res://src/mechanics/RNG.tscn" type="PackedScene" id=5] [ext_resource path="res://src/levels/Game.gd" type="Script" id=6] -[ext_resource path="res://src/ui/UIBar.png" type="Texture" id=7] -[ext_resource path="res://src/ui/TheDarkNightUI.tscn" type="PackedScene" id=8] -[ext_resource path="res://src/ui/LifeBarFg.png" type="Texture" id=9] -[ext_resource path="res://src/ui/LifeBarBg.png" type="Texture" id=10] -[ext_resource path="res://src/levels/PhaseOneMusic.gd" type="Script" id=11] -[ext_resource path="res://src/ui/Music_on.png" type="Texture" id=12] -[ext_resource path="res://src/mechanics/ScreenEdgeSpawner.tscn" type="PackedScene" id=13] -[ext_resource path="res://src/entities/enemies/ChaserEnemy.tscn" type="PackedScene" id=14] -[ext_resource path="res://src/behaviours/targeting/SetSpawnedGoalTo.tscn" type="PackedScene" id=15] -[ext_resource path="res://src/pickups/BranchPickup.tscn" type="PackedScene" id=16] -[ext_resource path="res://src/behaviours/targeting/SetGoalReachedConsequences.tscn" type="PackedScene" id=17] +[ext_resource path="res://src/music/BossGuitar.mp3" type="AudioStream" id=7] +[ext_resource path="res://src/levels/Music.gd" type="Script" id=11] [ext_resource path="res://src/music/BaseDrum.mp3" type="AudioStream" id=19] [ext_resource path="res://src/music/BaseBell.mp3" type="AudioStream" id=20] [ext_resource path="res://src/music/BaseChoir.mp3" type="AudioStream" id=21] -[sub_resource type="GDScript" id=1] -script/source = "extends Label - - -func _ready(): - var game = get_tree().root.get_node(\"Game\") - game.connect(\"survival_seconds_updated\", self, \"_on_survival_seconds_updated\") - - -func _on_survival_seconds_updated(value: float): - # warning-ignore:NARROWING_CONVERSION - var minutes: int = floor(value / 60) - var seconds_and_millis: float = value - minutes * 60 - var seconds: int = int(seconds_and_millis) - var millis: int = int((seconds_and_millis - seconds) * 1000) - text = \"%02d:%02d.%03d\" % ([minutes, seconds, millis]) -" - [node name="Game" type="Node2D"] script = ExtResource( 6 ) [node name="RNG" parent="." instance=ExtResource( 5 )] -[node name="PhaseOne" type="CanvasLayer" parent="."] -layer = 0 - -[node name="Music" type="Node" parent="PhaseOne"] +[node name="Music" type="Node" parent="."] script = ExtResource( 11 ) -[node name="Bell" type="AudioStreamPlayer" parent="PhaseOne/Music"] +[node name="Bell" type="AudioStreamPlayer" parent="Music"] stream = ExtResource( 20 ) volume_db = -80.0 autoplay = true -[node name="Choir" type="AudioStreamPlayer" parent="PhaseOne/Music"] +[node name="Choir" type="AudioStreamPlayer" parent="Music"] stream = ExtResource( 21 ) volume_db = -80.0 autoplay = true -[node name="Drum" type="AudioStreamPlayer" parent="PhaseOne/Music"] +[node name="Drum" type="AudioStreamPlayer" parent="Music"] stream = ExtResource( 19 ) volume_db = -80.0 autoplay = true -[node name="Entities" type="Node2D" parent="PhaseOne"] +[node name="BossDrum" type="AudioStreamPlayer" parent="Music"] +stream = ExtResource( 3 ) +volume_db = -80.0 +autoplay = true -[node name="Background" parent="PhaseOne/Entities" instance=ExtResource( 1 )] -tile_data = PoolIntArray( 0, 0, 131074, 1, 0, 131074, 2, 0, 131074, 3, 0, 131074, 4, 0, 131074, 5, 0, 131074, 6, 0, 131074, 7, 0, 131074, 8, 0, 131074, 9, 0, 131074, 10, 0, 131074, 11, 0, 131074, 12, 0, 131074, 13, 0, 131074, 14, 0, 131074, 15, 0, 131074, 16, 0, 131075, 17, 0, 0, 18, 0, 0, 19, 0, 0, 20, 0, 0, 21, 0, 0, 22, 0, 0, 23, 0, 131073, 24, 0, 131074, 25, 0, 131074, 26, 0, 131074, 27, 0, 131074, 28, 0, 131074, 29, 0, 131074, 30, 0, 131074, 31, 0, 131074, 32, 0, 131074, 33, 0, 131074, 34, 0, 131074, 35, 0, 131074, 36, 0, 131074, 37, 0, 131074, 38, 0, 131074, 39, 0, 131074, 65536, 0, 131074, 65537, 0, 131074, 65538, 0, 131074, 65539, 0, 131074, 65540, 0, 131074, 65541, 0, 131074, 65542, 0, 131074, 65543, 0, 131074, 65544, 0, 131074, 65545, 0, 131074, 65546, 0, 131074, 65547, 0, 131074, 65548, 0, 131074, 65549, 0, 131074, 65550, 0, 131074, 65551, 0, 131074, 65552, 0, 131075, 65553, 0, 0, 65554, 0, 0, 65555, 0, 0, 65556, 0, 0, 65557, 0, 0, 65558, 0, 0, 65559, 0, 131073, 65560, 0, 131074, 65561, 0, 131074, 65562, 0, 131074, 65563, 0, 131074, 65564, 0, 131074, 65565, 0, 131074, 65566, 0, 131074, 65567, 0, 131074, 65568, 0, 131074, 65569, 0, 131074, 65570, 0, 131074, 65571, 0, 131074, 65572, 0, 131074, 65573, 0, 131074, 65574, 0, 131074, 65575, 0, 131074, 131072, 0, 131074, 131073, 0, 131074, 131074, 0, 131074, 131075, 0, 131074, 131076, 0, 131074, 131077, 0, 131074, 131078, 0, 131074, 131079, 0, 131074, 131080, 0, 131074, 131081, 0, 131074, 131082, 0, 131074, 131083, 0, 131074, 131084, 0, 131074, 131085, 0, 131074, 131086, 0, 131074, 131087, 0, 131074, 131088, 0, 131075, 131089, 0, 0, 131090, 0, 0, 131091, 0, 0, 131092, 0, 0, 131093, 0, 0, 131094, 0, 0, 131095, 0, 131073, 131096, 0, 131074, 131097, 0, 131074, 131098, 0, 131074, 131099, 0, 131074, 131100, 0, 131074, 131101, 0, 131074, 131102, 0, 131074, 131103, 0, 131074, 131104, 0, 131074, 131105, 0, 131074, 131106, 0, 131074, 131107, 0, 131074, 131108, 0, 131074, 131109, 0, 131074, 131110, 0, 131074, 131111, 0, 131074, 196608, 0, 131074, 196609, 0, 131074, 196610, 0, 131074, 196611, 0, 131074, 196612, 0, 131074, 196613, 0, 131074, 196614, 0, 131074, 196615, 0, 131074, 196616, 0, 131074, 196617, 0, 131074, 196618, 0, 131074, 196619, 0, 131074, 196620, 0, 131074, 196621, 0, 131074, 196622, 0, 131074, 196623, 0, 131074, 196624, 0, 131075, 196625, 0, 0, 196626, 0, 0, 196627, 0, 0, 196628, 0, 0, 196629, 0, 0, 196630, 0, 0, 196631, 0, 131073, 196632, 0, 131074, 196633, 0, 131074, 196634, 0, 131074, 196635, 0, 131074, 196636, 0, 131074, 196637, 0, 131074, 196638, 0, 131074, 196639, 0, 131074, 196640, 0, 131074, 196641, 0, 131074, 196642, 0, 131074, 196643, 0, 131074, 196644, 0, 131074, 196645, 0, 131074, 196646, 0, 131074, 196647, 0, 131074, 262144, 0, 131074, 262145, 0, 131074, 262146, 0, 131074, 262147, 0, 131074, 262148, 0, 131074, 262149, 0, 131074, 262150, 0, 131074, 262151, 0, 131074, 262152, 0, 131074, 262153, 0, 131074, 262154, 0, 131074, 262155, 0, 131074, 262156, 0, 131074, 262157, 0, 131074, 262158, 0, 131074, 262159, 0, 131074, 262160, 0, 131075, 262161, 0, 0, 262162, 0, 0, 262163, 0, 0, 262164, 0, 0, 262165, 0, 0, 262166, 0, 0, 262167, 0, 131073, 262168, 0, 131074, 262169, 0, 131074, 262170, 0, 131074, 262171, 0, 131074, 262172, 0, 131074, 262173, 0, 131074, 262174, 0, 131074, 262175, 0, 131074, 262176, 0, 131074, 262177, 0, 131074, 262178, 0, 131074, 262179, 0, 131074, 262180, 0, 131074, 262181, 0, 131074, 262182, 0, 131074, 262183, 0, 131074, 327680, 0, 131074, 327681, 0, 131074, 327682, 0, 131074, 327683, 0, 131074, 327684, 0, 131074, 327685, 0, 131074, 327686, 0, 131074, 327687, 0, 131074, 327688, 0, 131074, 327689, 0, 131074, 327690, 0, 131074, 327691, 0, 131074, 327692, 0, 131074, 327693, 0, 131074, 327694, 0, 131074, 327695, 0, 131074, 327696, 0, 131075, 327697, 0, 0, 327698, 0, 0, 327699, 0, 0, 327700, 0, 0, 327701, 0, 0, 327702, 0, 0, 327703, 0, 131073, 327704, 0, 131074, 327705, 0, 131074, 327706, 0, 131074, 327707, 0, 131074, 327708, 0, 131074, 327709, 0, 131074, 327710, 0, 131074, 327711, 0, 131074, 327712, 0, 131074, 327713, 0, 131074, 327714, 0, 131074, 327715, 0, 131074, 327716, 0, 131074, 327717, 0, 131074, 327718, 0, 131074, 327719, 0, 131074, 393216, 0, 196610, 393217, 0, 196610, 393218, 0, 196610, 393219, 0, 196610, 393220, 0, 196610, 393221, 0, 196610, 393222, 0, 196610, 393223, 0, 196610, 393224, 0, 196610, 393225, 0, 196610, 393226, 0, 196610, 393227, 0, 196610, 393228, 0, 196610, 393229, 0, 196610, 393230, 0, 196610, 393231, 0, 196610, 393232, 0, 196611, 393233, 0, 0, 393234, 0, 0, 393235, 0, 0, 393236, 0, 0, 393237, 0, 0, 393238, 0, 0, 393239, 0, 196609, 393240, 0, 196610, 393241, 0, 196610, 393242, 0, 196610, 393243, 0, 196610, 393244, 0, 196610, 393245, 0, 196610, 393246, 0, 196610, 393247, 0, 196610, 393248, 0, 196610, 393249, 0, 196610, 393250, 0, 196610, 393251, 0, 196610, 393252, 0, 196610, 393253, 0, 196610, 393254, 0, 196610, 393255, 0, 196610, 458752, 0, 0, 458753, 0, 0, 458754, 0, 0, 458755, 0, 0, 458756, 0, 0, 458757, 0, 0, 458758, 0, 0, 458759, 0, 0, 458760, 0, 0, 458761, 0, 0, 458762, 0, 0, 458763, 0, 0, 458764, 0, 0, 458765, 0, 0, 458766, 0, 0, 458767, 0, 0, 458768, 0, 0, 458769, 0, 0, 458770, 0, 0, 458771, 0, 0, 458772, 0, 0, 458773, 0, 0, 458774, 0, 0, 458775, 0, 0, 458776, 0, 0, 458777, 0, 0, 458778, 0, 0, 458779, 0, 0, 458780, 0, 0, 458781, 0, 0, 458782, 0, 0, 458783, 0, 0, 458784, 0, 0, 458785, 0, 0, 458786, 0, 0, 458787, 0, 0, 458788, 0, 0, 458789, 0, 0, 458790, 0, 0, 458791, 0, 0, 524288, 0, 0, 524289, 0, 0, 524290, 0, 0, 524291, 0, 0, 524292, 0, 0, 524293, 0, 0, 524294, 0, 0, 524295, 0, 0, 524296, 0, 0, 524297, 0, 0, 524298, 0, 0, 524299, 0, 0, 524300, 0, 0, 524301, 0, 0, 524302, 0, 0, 524303, 0, 0, 524304, 0, 0, 524305, 0, 0, 524306, 0, 0, 524307, 0, 0, 524308, 0, 0, 524309, 0, 0, 524310, 0, 0, 524311, 0, 0, 524312, 0, 0, 524313, 0, 0, 524314, 0, 0, 524315, 0, 0, 524316, 0, 0, 524317, 0, 0, 524318, 0, 0, 524319, 0, 0, 524320, 0, 0, 524321, 0, 0, 524322, 0, 0, 524323, 0, 0, 524324, 0, 0, 524325, 0, 0, 524326, 0, 0, 524327, 0, 0, 589824, 0, 0, 589825, 0, 0, 589826, 0, 0, 589827, 0, 0, 589828, 0, 0, 589829, 0, 0, 589830, 0, 0, 589831, 0, 0, 589832, 0, 0, 589833, 0, 0, 589834, 0, 0, 589835, 0, 0, 589836, 0, 0, 589837, 0, 0, 589838, 0, 0, 589839, 0, 0, 589840, 0, 0, 589841, 0, 0, 589842, 0, 0, 589843, 0, 0, 589844, 0, 0, 589845, 0, 0, 589846, 0, 0, 589847, 0, 0, 589848, 0, 0, 589849, 0, 0, 589850, 0, 0, 589851, 0, 0, 589852, 0, 0, 589853, 0, 0, 589854, 0, 0, 589855, 0, 0, 589856, 0, 0, 589857, 0, 0, 589858, 0, 0, 589859, 0, 0, 589860, 0, 0, 589861, 0, 0, 589862, 0, 0, 589863, 0, 0, 655360, 0, 0, 655361, 0, 0, 655362, 0, 0, 655363, 0, 0, 655364, 0, 0, 655365, 0, 0, 655366, 0, 0, 655367, 0, 0, 655368, 0, 0, 655369, 0, 0, 655370, 0, 0, 655371, 0, 0, 655372, 0, 0, 655373, 0, 0, 655374, 0, 0, 655375, 0, 0, 655376, 0, 0, 655377, 0, 0, 655378, 0, 0, 655379, 0, 0, 655380, 0, 0, 655381, 0, 0, 655382, 0, 0, 655383, 0, 0, 655384, 0, 0, 655385, 0, 0, 655386, 0, 0, 655387, 0, 0, 655388, 0, 0, 655389, 0, 0, 655390, 0, 0, 655391, 0, 0, 655392, 0, 0, 655393, 0, 0, 655394, 0, 0, 655395, 0, 0, 655396, 0, 0, 655397, 0, 0, 655398, 0, 0, 655399, 0, 0, 720896, 0, 0, 720897, 0, 0, 720898, 0, 0, 720899, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 720912, 0, 0, 720913, 0, 0, 720914, 0, 0, 720915, 0, 0, 720916, 0, 0, 720917, 0, 0, 720918, 0, 0, 720919, 0, 0, 720920, 0, 0, 720921, 0, 0, 720922, 0, 0, 720923, 0, 0, 720924, 0, 0, 720925, 0, 0, 720926, 0, 0, 720927, 0, 0, 720928, 0, 0, 720929, 0, 0, 720930, 0, 0, 720931, 0, 0, 720932, 0, 0, 720933, 0, 0, 720934, 0, 0, 720935, 0, 0, 786432, 0, 0, 786433, 0, 0, 786434, 0, 0, 786435, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786445, 0, 0, 786446, 0, 0, 786447, 0, 0, 786448, 0, 0, 786449, 0, 0, 786450, 0, 0, 786451, 0, 0, 786452, 0, 0, 786453, 0, 0, 786454, 0, 0, 786455, 0, 0, 786456, 0, 0, 786457, 0, 0, 786458, 0, 0, 786459, 0, 0, 786460, 0, 0, 786461, 0, 0, 786462, 0, 0, 786463, 0, 0, 786464, 0, 0, 786465, 0, 0, 786466, 0, 0, 786467, 0, 0, 786468, 0, 0, 786469, 0, 0, 786470, 0, 0, 786471, 0, 0, 851968, 0, 65538, 851969, 0, 65538, 851970, 0, 65538, 851971, 0, 65538, 851972, 0, 65538, 851973, 0, 65538, 851974, 0, 65538, 851975, 0, 65538, 851976, 0, 65538, 851977, 0, 65538, 851978, 0, 65538, 851979, 0, 65538, 851980, 0, 65538, 851981, 0, 65538, 851982, 0, 65538, 851983, 0, 65538, 851984, 0, 65539, 851985, 0, 0, 851986, 0, 0, 851987, 0, 0, 851988, 0, 0, 851989, 0, 0, 851990, 0, 0, 851991, 0, 65537, 851992, 0, 65538, 851993, 0, 65538, 851994, 0, 65538, 851995, 0, 65538, 851996, 0, 65538, 851997, 0, 65538, 851998, 0, 65538, 851999, 0, 65538, 852000, 0, 65538, 852001, 0, 65538, 852002, 0, 65538, 852003, 0, 65538, 852004, 0, 65538, 852005, 0, 65538, 852006, 0, 65538, 852007, 0, 65538, 917504, 0, 131074, 917505, 0, 131074, 917506, 0, 131074, 917507, 0, 131074, 917508, 0, 131074, 917509, 0, 131074, 917510, 0, 131074, 917511, 0, 131074, 917512, 0, 131074, 917513, 0, 131074, 917514, 0, 131074, 917515, 0, 131074, 917516, 0, 131074, 917517, 0, 131074, 917518, 0, 131074, 917519, 0, 131074, 917520, 0, 131075, 917521, 0, 0, 917522, 0, 0, 917523, 0, 0, 917524, 0, 0, 917525, 0, 0, 917526, 0, 0, 917527, 0, 131073, 917528, 0, 131074, 917529, 0, 131074, 917530, 0, 131074, 917531, 0, 131074, 917532, 0, 131074, 917533, 0, 131074, 917534, 0, 131074, 917535, 0, 131074, 917536, 0, 131074, 917537, 0, 131074, 917538, 0, 131074, 917539, 0, 131074, 917540, 0, 131074, 917541, 0, 131074, 917542, 0, 131074, 917543, 0, 131074, 983040, 0, 131074, 983041, 0, 131074, 983042, 0, 131074, 983043, 0, 131074, 983044, 0, 131074, 983045, 0, 131074, 983046, 0, 131074, 983047, 0, 131074, 983048, 0, 131074, 983049, 0, 131074, 983050, 0, 131074, 983051, 0, 131074, 983052, 0, 131074, 983053, 0, 131074, 983054, 0, 131074, 983055, 0, 131074, 983056, 0, 131075, 983057, 0, 0, 983058, 0, 0, 983059, 0, 0, 983060, 0, 0, 983061, 0, 0, 983062, 0, 0, 983063, 0, 131073, 983064, 0, 131074, 983065, 0, 131074, 983066, 0, 131074, 983067, 0, 131074, 983068, 0, 131074, 983069, 0, 131074, 983070, 0, 131074, 983071, 0, 131074, 983072, 0, 131074, 983073, 0, 131074, 983074, 0, 131074, 983075, 0, 131074, 983076, 0, 131074, 983077, 0, 131074, 983078, 0, 131074, 983079, 0, 131074, 1048576, 0, 131074, 1048577, 0, 131074, 1048578, 0, 131074, 1048579, 0, 131074, 1048580, 0, 131074, 1048581, 0, 131074, 1048582, 0, 131074, 1048583, 0, 131074, 1048584, 0, 131074, 1048585, 0, 131074, 1048586, 0, 131074, 1048587, 0, 131074, 1048588, 0, 131074, 1048589, 0, 131074, 1048590, 0, 131074, 1048591, 0, 131074, 1048592, 0, 131075, 1048593, 0, 0, 1048594, 0, 0, 1048595, 0, 0, 1048596, 0, 0, 1048597, 0, 0, 1048598, 0, 0, 1048599, 0, 131073, 1048600, 0, 131074, 1048601, 0, 131074, 1048602, 0, 131074, 1048603, 0, 131074, 1048604, 0, 131074, 1048605, 0, 131074, 1048606, 0, 131074, 1048607, 0, 131074, 1048608, 0, 131074, 1048609, 0, 131074, 1048610, 0, 131074, 1048611, 0, 131074, 1048612, 0, 131074, 1048613, 0, 131074, 1048614, 0, 131074, 1048615, 0, 131074, 1114112, 0, 131074, 1114113, 0, 131074, 1114114, 0, 131074, 1114115, 0, 131074, 1114116, 0, 131074, 1114117, 0, 131074, 1114118, 0, 131074, 1114119, 0, 131074, 1114120, 0, 131074, 1114121, 0, 131074, 1114122, 0, 131074, 1114123, 0, 131074, 1114124, 0, 131074, 1114125, 0, 131074, 1114126, 0, 131074, 1114127, 0, 131074, 1114128, 0, 131075, 1114129, 0, 0, 1114130, 0, 0, 1114131, 0, 0, 1114132, 0, 0, 1114133, 0, 0, 1114134, 0, 0, 1114135, 0, 131073, 1114136, 0, 131074, 1114137, 0, 131074, 1114138, 0, 131074, 1114139, 0, 131074, 1114140, 0, 131074, 1114141, 0, 131074, 1114142, 0, 131074, 1114143, 0, 131074, 1114144, 0, 131074, 1114145, 0, 131074, 1114146, 0, 131074, 1114147, 0, 131074, 1114148, 0, 131074, 1114149, 0, 131074, 1114150, 0, 131074, 1114151, 0, 131074, 1179648, 0, 131074, 1179649, 0, 131074, 1179650, 0, 131074, 1179651, 0, 131074, 1179652, 0, 131074, 1179653, 0, 131074, 1179654, 0, 131074, 1179655, 0, 131074, 1179656, 0, 131074, 1179657, 0, 131074, 1179658, 0, 131074, 1179659, 0, 131074, 1179660, 0, 131074, 1179661, 0, 131074, 1179662, 0, 131074, 1179663, 0, 131074, 1179664, 0, 131075, 1179665, 0, 0, 1179666, 0, 0, 1179667, 0, 0, 1179668, 0, 0, 1179669, 0, 0, 1179670, 0, 0, 1179671, 0, 131073, 1179672, 0, 131074, 1179673, 0, 131074, 1179674, 0, 131074, 1179675, 0, 131074, 1179676, 0, 131074, 1179677, 0, 131074, 1179678, 0, 131074, 1179679, 0, 131074, 1179680, 0, 131074, 1179681, 0, 131074, 1179682, 0, 131074, 1179683, 0, 131074, 1179684, 0, 131074, 1179685, 0, 131074, 1179686, 0, 131074, 1179687, 0, 131074, 1245184, 0, 131074, 1245185, 0, 131074, 1245186, 0, 131074, 1245187, 0, 131074, 1245188, 0, 131074, 1245189, 0, 131074, 1245190, 0, 131074, 1245191, 0, 131074, 1245192, 0, 131074, 1245193, 0, 131074, 1245194, 0, 131074, 1245195, 0, 131074, 1245196, 0, 131074, 1245197, 0, 131074, 1245198, 0, 131074, 1245199, 0, 131074, 1245200, 0, 131075, 1245201, 0, 0, 1245202, 0, 0, 1245203, 0, 0, 1245204, 0, 0, 1245205, 0, 0, 1245206, 0, 0, 1245207, 0, 131073, 1245208, 0, 131074, 1245209, 0, 131074, 1245210, 0, 131074, 1245211, 0, 131074, 1245212, 0, 131074, 1245213, 0, 131074, 1245214, 0, 131074, 1245215, 0, 131074, 1245216, 0, 131074, 1245217, 0, 131074, 1245218, 0, 131074, 1245219, 0, 131074, 1245220, 0, 131074, 1245221, 0, 131074, 1245222, 0, 131074, 1245223, 0, 131074 ) - -[node name="Darkness" parent="PhaseOne/Entities" instance=ExtResource( 2 )] - -[node name="PhaseOnePlayer" parent="PhaseOne/Entities" instance=ExtResource( 4 )] -position = Vector2( 596, 268 ) - -[node name="Fire" parent="PhaseOne/Entities" instance=ExtResource( 3 )] -position = Vector2( 640, 319 ) -intensity = 0.5 - -[node name="Pickups" type="Node" parent="PhaseOne/Entities"] - -[node name="BranchPickup" parent="PhaseOne/Entities/Pickups" instance=ExtResource( 16 )] -position = Vector2( 590, 366 ) - -[node name="BranchPickup5" parent="PhaseOne/Entities/Pickups" instance=ExtResource( 16 )] -position = Vector2( 566, 321 ) - -[node name="BranchPickup6" parent="PhaseOne/Entities/Pickups" instance=ExtResource( 16 )] -position = Vector2( 714, 350 ) - -[node name="BranchPickup7" parent="PhaseOne/Entities/Pickups" instance=ExtResource( 16 )] -position = Vector2( 775, 318 ) - -[node name="BranchPickup2" parent="PhaseOne/Entities/Pickups" instance=ExtResource( 16 )] -position = Vector2( 680, 404 ) - -[node name="BranchPickup3" parent="PhaseOne/Entities/Pickups" instance=ExtResource( 16 )] -position = Vector2( 731, 289 ) - -[node name="BranchPickup4" parent="PhaseOne/Entities/Pickups" instance=ExtResource( 16 )] -position = Vector2( 643, 264 ) - -[node name="Bullets" type="Node" parent="PhaseOne/Entities"] - -[node name="Enemies" type="Node" parent="PhaseOne/Entities"] - -[node name="ScreenEdgeSpawner" parent="PhaseOne/Entities/Enemies" instance=ExtResource( 13 )] -spawning = ExtResource( 14 ) -bounds = Vector2( 1280, 640 ) -period_secs = 0.5 - -[node name="SetSpawnedGoalTo" parent="PhaseOne/Entities/Enemies/ScreenEdgeSpawner" instance=ExtResource( 15 )] -goal_path = NodePath("../../../Fire") - -[node name="SetGoalReachedConsequences" parent="PhaseOne/Entities/Enemies/ScreenEdgeSpawner" instance=ExtResource( 17 )] - -[node name="ScreenEdgeSpawner2" parent="PhaseOne/Entities/Enemies" instance=ExtResource( 13 )] -scale = Vector2( 0.998195, 1 ) -spawning = ExtResource( 14 ) -bounds = Vector2( 1280, 640 ) -period_secs = 0.5 - -[node name="SetSpawnedGoalTo" parent="PhaseOne/Entities/Enemies/ScreenEdgeSpawner2" instance=ExtResource( 15 )] -goal_path = NodePath("../../../PhaseOnePlayer") - -[node name="SetGoalReachedConsequences" parent="PhaseOne/Entities/Enemies/ScreenEdgeSpawner2" instance=ExtResource( 17 )] - -[node name="UserInterface" type="CanvasLayer" parent="."] - -[node name="TheDarkNightUI" parent="UserInterface" instance=ExtResource( 8 )] -anchor_left = 0.0 -anchor_right = 1.0 -margin_left = 0.0 -margin_right = 0.0 - -[node name="Panel" type="Panel" parent="UserInterface/TheDarkNightUI"] -anchor_right = 1.0 -anchor_bottom = 1.0 - -[node name="UIBar" type="Sprite" parent="UserInterface/TheDarkNightUI/Panel"] -position = Vector2( 640, 40 ) -texture = ExtResource( 7 ) - -[node name="TimeSurvived" type="Label" parent="UserInterface/TheDarkNightUI/Panel"] -anchor_bottom = 1.0 -margin_left = 600.0 -margin_top = 16.0 -margin_right = 680.0 -margin_bottom = -12.0 -grow_horizontal = 0 -grow_vertical = 2 -text = "00:00.000" -align = 2 -valign = 1 -script = SubResource( 1 ) - -[node name="TextureProgress" type="TextureProgress" parent="UserInterface/TheDarkNightUI/Panel"] -margin_left = 15.0 -margin_top = 15.0 -margin_right = 317.0 -margin_bottom = -15.0 -value = 50.0 -texture_under = ExtResource( 10 ) -texture_progress = ExtResource( 9 ) -texture_progress_offset = Vector2( 10, 5 ) - -[node name="MuteButton" type="Button" parent="UserInterface/TheDarkNightUI/Panel"] -anchor_left = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = -100.0 -margin_top = 10.0 -margin_right = -50.0 -margin_bottom = -10.0 -flat = true - -[node name="Sprite" type="Sprite" parent="UserInterface/TheDarkNightUI/Panel/MuteButton"] -position = Vector2( 25, 30 ) -texture = ExtResource( 12 ) - -[connection signal="intensity_changed" from="PhaseOne/Entities/Fire" to="PhaseOne/Music" method="_on_Fire_intensity_changed"] -[connection signal="intensity_reached_min" from="PhaseOne/Entities/Fire" to="." method="_on_Fire_intensity_reached_min"] -[connection signal="spawned" from="PhaseOne/Entities/Enemies/ScreenEdgeSpawner" to="PhaseOne/Entities/Enemies/ScreenEdgeSpawner/SetSpawnedGoalTo" method="set_goal"] -[connection signal="goal_reached" from="PhaseOne/Entities/Enemies/ScreenEdgeSpawner/SetGoalReachedConsequences" to="PhaseOne/Entities/Fire" method="_on_Enemy_goal_reached"] -[connection signal="spawned" from="PhaseOne/Entities/Enemies/ScreenEdgeSpawner2" to="PhaseOne/Entities/Enemies/ScreenEdgeSpawner2/SetSpawnedGoalTo" method="set_goal"] -[connection signal="pressed" from="UserInterface/TheDarkNightUI/Panel/MuteButton" to="PhaseOne/Music" method="_on_MuteButton_pressed"] +[node name="BossGuitar" type="AudioStreamPlayer" parent="Music"] +stream = ExtResource( 7 ) +volume_db = -80.0 +autoplay = true diff --git a/src/levels/MainMenu.gd b/src/levels/MainMenu.gd deleted file mode 100644 index 7300b29..0000000 --- a/src/levels/MainMenu.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends Node2D - - -func _ready(): - for child in get_children(): - if child.name == "Play": - get_node(child.name).connect("pressed", self, "change_scn") - -func change_scn(): - get_tree().change_scene("res://src/levels/Game.tscn") - diff --git a/src/levels/MainMenu.tscn b/src/levels/MainMenu.tscn deleted file mode 100644 index f276e72..0000000 --- a/src/levels/MainMenu.tscn +++ /dev/null @@ -1,36 +0,0 @@ -[gd_scene load_steps=7 format=2] - -[ext_resource path="res://src/levels/MainMenu.gd" type="Script" id=1] -[ext_resource path="res://src/ui/Title.png" type="Texture" id=2] -[ext_resource path="res://src/ui/PlayButton.png" type="Texture" id=3] -[ext_resource path="res://src/ui/fonts/SourceSerifPro-Light.ttf" type="DynamicFontData" id=4] -[ext_resource path="res://src/entities/fire/Fire.tscn" type="PackedScene" id=5] - -[sub_resource type="DynamicFont" id=1] -size = 70 -font_data = ExtResource( 4 ) - -[node name="MainMenu" type="Node2D"] -script = ExtResource( 1 ) - -[node name="Panel" type="Panel" parent="."] -margin_right = 1280.0 -margin_bottom = 720.0 - -[node name="Sprite" type="Sprite" parent="Panel"] -position = Vector2( 640.881, 360.696 ) -texture = ExtResource( 2 ) - -[node name="Fire" parent="Panel" instance=ExtResource( 5 )] -position = Vector2( 421, 365 ) -scale = Vector2( 4, 4 ) - -[node name="Play" type="Button" parent="."] -margin_left = 944.0 -margin_top = 489.0 -margin_right = 1210.0 -margin_bottom = 615.0 -custom_fonts/font = SubResource( 1 ) -text = "Play" -icon = ExtResource( 3 ) -flat = true diff --git a/src/levels/PhaseOneMusic.gd b/src/levels/Music.gd similarity index 70% rename from src/levels/PhaseOneMusic.gd rename to src/levels/Music.gd index 490d7a8..858699a 100644 --- a/src/levels/PhaseOneMusic.gd +++ b/src/levels/Music.gd @@ -1,4 +1,5 @@ extends Node +class_name Music export var choir_min: float = 0.05 @@ -10,15 +11,8 @@ export var drum_max: float = 0.80 export var muted: bool setget set_mute, get_mute -func _on_Fire_intensity_changed(value): - $Choir.volume_db = (smoothstep(choir_min, choir_max, value) - 1) * 60 - $Choir.bus = "Master" if $Choir.volume_db > -60 else "Mute" - - $Bell.volume_db = (smoothstep(bell_min, bell_max, value) - 1) * 60 - $Bell.bus = "Master" if $Bell.volume_db > -60 else "Mute" - - $Drum.volume_db = (smoothstep(drum_min, drum_max, value) - 1) * 60 - $Drum.bus = "Master" if $Drum.volume_db > -60 else "Mute" +func _ready(): + update_state() func set_mute(value): @@ -30,5 +24,21 @@ func get_mute(): return AudioServer.is_bus_mute(index) -func _on_MuteButton_pressed(): - set_mute(not get_mute()) +func update_state(): + $Choir.bus = "Master" if $Choir.volume_db > -60 else "Mute" + $Bell.bus = "Master" if $Bell.volume_db > -60 else "Mute" + $Drum.bus = "Master" if $Drum.volume_db > -60 else "Mute" + $BossDrum.bus = "Master" if $BossDrum.volume_db > -60 else "Mute" + $BossGuitar.bus = "Master" if $BossGuitar.volume_db > -60 else "Mute" + + + +func _on_Fire_intensity_changed(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 + update_state() + + +func _on_MuteButton_toggled(button_pressed): + set_mute(button_pressed) diff --git a/src/levels/mainmenu/MainMenu.gd b/src/levels/mainmenu/MainMenu.gd new file mode 100644 index 0000000..0d452ea --- /dev/null +++ b/src/levels/mainmenu/MainMenu.gd @@ -0,0 +1,11 @@ +extends Node2D + + +func change_scn(): + var result = get_tree().change_scene("res://src/levels/Game.tscn") + if result != OK: + push_error("Could not change scene: %d" % [result]) + + +func _on_Play_pressed(): + change_scn() diff --git a/src/levels/mainmenu/MainMenu.tscn b/src/levels/mainmenu/MainMenu.tscn new file mode 100644 index 0000000..da452e7 --- /dev/null +++ b/src/levels/mainmenu/MainMenu.tscn @@ -0,0 +1,60 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://src/ui/fonts/SourceSerifPro-Light.ttf" type="DynamicFontData" id=1] +[ext_resource path="res://src/levels/ui/ui/Title.png" type="Texture" id=2] +[ext_resource path="res://src/levels/ui/PlayButton.png" type="Texture" id=3] +[ext_resource path="res://src/entities/fire/Fire.tscn" type="PackedScene" id=4] +[ext_resource path="res://src/levels/ui/fonts/SourceSerifPro-Regular.ttf" type="DynamicFontData" id=5] + +[sub_resource type="DynamicFont" id=1] +size = 22 +font_data = ExtResource( 5 ) + +[sub_resource type="Theme" id=2] +default_font = SubResource( 1 ) + +[sub_resource type="DynamicFont" id=3] +size = 70 +font_data = ExtResource( 1 ) + +[node name="MainMenu" type="CanvasLayer"] + +[node name="TheDarkNightUI" type="Control" parent="."] +light_mask = 2 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -640.0 +margin_top = -80.0 +margin_right = 640.0 +theme = SubResource( 2 ) + +[node name="Sprite" type="Sprite" parent="TheDarkNightUI"] +position = Vector2( 640.881, -279.304 ) +texture = ExtResource( 2 ) + +[node name="MenuFire" parent="TheDarkNightUI" instance=ExtResource( 4 )] +position = Vector2( 421, -275 ) +scale = Vector2( 4, 4 ) + +[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 +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = -202.0 +margin_top = -190.0 +margin_right = -64.0 +margin_bottom = -64.0 +grow_horizontal = 0 +grow_vertical = 0 +custom_fonts/font = SubResource( 3 ) +text = "Play" +icon = ExtResource( 3 ) +flat = true + +[editable path="TheDarkNightUI/MenuFire"] diff --git a/src/levels/phaseone/PhaseOne.gd b/src/levels/phaseone/PhaseOne.gd new file mode 100644 index 0000000..a321ef5 --- /dev/null +++ b/src/levels/phaseone/PhaseOne.gd @@ -0,0 +1,16 @@ +extends CanvasLayer + + +signal survival_seconds_updated(origin, value) + + +var survival_seconds = 0 setget set_survival_seconds + + +func set_survival_seconds(value): + survival_seconds = value + emit_signal("survival_seconds_updated", self, value) + + +func _process(delta): + set_survival_seconds(survival_seconds + delta) diff --git a/src/levels/phaseone/PhaseOne.tscn b/src/levels/phaseone/PhaseOne.tscn new file mode 100644 index 0000000..8da0421 --- /dev/null +++ b/src/levels/phaseone/PhaseOne.tscn @@ -0,0 +1,93 @@ +[gd_scene load_steps=13 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] +[ext_resource path="res://src/entities/fire/Fire.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/behaviours/spawning/SpawnEveryPeriod.tscn" type="PackedScene" id=4] +[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/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] +[ext_resource path="res://src/entities/players/PhaseOnePlayer.tscn" type="PackedScene" id=17] +[ext_resource path="res://src/levels/phaseone/PhaseOne.gd" type="Script" id=18] + +[sub_resource type="TileSet" id=1] +0/name = "GrassDirtTileset.png 0" +0/texture = ExtResource( 2 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 160, 160 ) +0/tile_mode = 2 +0/autotile/icon_coordinate = Vector2( 0, 0 ) +0/autotile/tile_size = Vector2( 32, 32 ) +0/autotile/spacing = 0 +0/autotile/occluder_map = [ ] +0/autotile/navpoly_map = [ ] +0/autotile/priority_map = [ ] +0/autotile/z_index_map = [ ] +0/occluder_offset = Vector2( 0, 0 ) +0/navigation_offset = Vector2( 0, 0 ) +0/shape_offset = Vector2( 0, 0 ) +0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 ) +0/shape_one_way = false +0/shape_one_way_margin = 0.0 +0/shapes = [ ] +0/z_index = 0 + +[node name="PhaseOne" type="CanvasLayer"] +layer = 0 +script = ExtResource( 18 ) + +[node name="Background" parent="." instance=ExtResource( 14 )] +tile_set = SubResource( 1 ) +tile_data = PoolIntArray( 0, 0, 131074, 1, 0, 131074, 2, 0, 131074, 3, 0, 131074, 4, 0, 131074, 5, 0, 131074, 6, 0, 131074, 7, 0, 131074, 8, 0, 131074, 9, 0, 131074, 10, 0, 131074, 11, 0, 131074, 12, 0, 131074, 13, 0, 131074, 14, 0, 131074, 15, 0, 131074, 16, 0, 131075, 17, 0, 0, 18, 0, 0, 19, 0, 0, 20, 0, 0, 21, 0, 0, 22, 0, 0, 23, 0, 131073, 24, 0, 131074, 25, 0, 131074, 26, 0, 131074, 27, 0, 131074, 28, 0, 131074, 29, 0, 131074, 30, 0, 131074, 31, 0, 131074, 32, 0, 131074, 33, 0, 131074, 34, 0, 131074, 35, 0, 131074, 36, 0, 131074, 37, 0, 131074, 38, 0, 131074, 39, 0, 131074, 65536, 0, 131074, 65537, 0, 131074, 65538, 0, 131074, 65539, 0, 131074, 65540, 0, 131074, 65541, 0, 131074, 65542, 0, 131074, 65543, 0, 131074, 65544, 0, 131074, 65545, 0, 131074, 65546, 0, 131074, 65547, 0, 131074, 65548, 0, 131074, 65549, 0, 131074, 65550, 0, 131074, 65551, 0, 131074, 65552, 0, 131075, 65553, 0, 0, 65554, 0, 0, 65555, 0, 0, 65556, 0, 0, 65557, 0, 0, 65558, 0, 0, 65559, 0, 131073, 65560, 0, 131074, 65561, 0, 131074, 65562, 0, 131074, 65563, 0, 131074, 65564, 0, 131074, 65565, 0, 131074, 65566, 0, 131074, 65567, 0, 131074, 65568, 0, 131074, 65569, 0, 131074, 65570, 0, 131074, 65571, 0, 131074, 65572, 0, 131074, 65573, 0, 131074, 65574, 0, 131074, 65575, 0, 131074, 131072, 0, 131074, 131073, 0, 131074, 131074, 0, 131074, 131075, 0, 131074, 131076, 0, 131074, 131077, 0, 131074, 131078, 0, 131074, 131079, 0, 131074, 131080, 0, 131074, 131081, 0, 131074, 131082, 0, 131074, 131083, 0, 131074, 131084, 0, 131074, 131085, 0, 131074, 131086, 0, 131074, 131087, 0, 131074, 131088, 0, 131075, 131089, 0, 0, 131090, 0, 0, 131091, 0, 0, 131092, 0, 0, 131093, 0, 0, 131094, 0, 0, 131095, 0, 131073, 131096, 0, 131074, 131097, 0, 131074, 131098, 0, 131074, 131099, 0, 131074, 131100, 0, 131074, 131101, 0, 131074, 131102, 0, 131074, 131103, 0, 131074, 131104, 0, 131074, 131105, 0, 131074, 131106, 0, 131074, 131107, 0, 131074, 131108, 0, 131074, 131109, 0, 131074, 131110, 0, 131074, 131111, 0, 131074, 196608, 0, 131074, 196609, 0, 131074, 196610, 0, 131074, 196611, 0, 131074, 196612, 0, 131074, 196613, 0, 131074, 196614, 0, 131074, 196615, 0, 131074, 196616, 0, 131074, 196617, 0, 131074, 196618, 0, 131074, 196619, 0, 131074, 196620, 0, 131074, 196621, 0, 131074, 196622, 0, 131074, 196623, 0, 131074, 196624, 0, 131075, 196625, 0, 0, 196626, 0, 0, 196627, 0, 0, 196628, 0, 0, 196629, 0, 0, 196630, 0, 0, 196631, 0, 131073, 196632, 0, 131074, 196633, 0, 131074, 196634, 0, 131074, 196635, 0, 131074, 196636, 0, 131074, 196637, 0, 131074, 196638, 0, 131074, 196639, 0, 131074, 196640, 0, 131074, 196641, 0, 131074, 196642, 0, 131074, 196643, 0, 131074, 196644, 0, 131074, 196645, 0, 131074, 196646, 0, 131074, 196647, 0, 131074, 262144, 0, 131074, 262145, 0, 131074, 262146, 0, 131074, 262147, 0, 131074, 262148, 0, 131074, 262149, 0, 131074, 262150, 0, 131074, 262151, 0, 131074, 262152, 0, 131074, 262153, 0, 131074, 262154, 0, 131074, 262155, 0, 131074, 262156, 0, 131074, 262157, 0, 131074, 262158, 0, 131074, 262159, 0, 131074, 262160, 0, 131075, 262161, 0, 0, 262162, 0, 0, 262163, 0, 0, 262164, 0, 0, 262165, 0, 0, 262166, 0, 0, 262167, 0, 131073, 262168, 0, 131074, 262169, 0, 131074, 262170, 0, 131074, 262171, 0, 131074, 262172, 0, 131074, 262173, 0, 131074, 262174, 0, 131074, 262175, 0, 131074, 262176, 0, 131074, 262177, 0, 131074, 262178, 0, 131074, 262179, 0, 131074, 262180, 0, 131074, 262181, 0, 131074, 262182, 0, 131074, 262183, 0, 131074, 327680, 0, 131074, 327681, 0, 131074, 327682, 0, 131074, 327683, 0, 131074, 327684, 0, 131074, 327685, 0, 131074, 327686, 0, 131074, 327687, 0, 131074, 327688, 0, 131074, 327689, 0, 131074, 327690, 0, 131074, 327691, 0, 131074, 327692, 0, 131074, 327693, 0, 131074, 327694, 0, 131074, 327695, 0, 131074, 327696, 0, 131075, 327697, 0, 0, 327698, 0, 0, 327699, 0, 0, 327700, 0, 0, 327701, 0, 0, 327702, 0, 0, 327703, 0, 131073, 327704, 0, 131074, 327705, 0, 131074, 327706, 0, 131074, 327707, 0, 131074, 327708, 0, 131074, 327709, 0, 131074, 327710, 0, 131074, 327711, 0, 131074, 327712, 0, 131074, 327713, 0, 131074, 327714, 0, 131074, 327715, 0, 131074, 327716, 0, 131074, 327717, 0, 131074, 327718, 0, 131074, 327719, 0, 131074, 393216, 0, 196610, 393217, 0, 196610, 393218, 0, 196610, 393219, 0, 196610, 393220, 0, 196610, 393221, 0, 196610, 393222, 0, 196610, 393223, 0, 196610, 393224, 0, 196610, 393225, 0, 196610, 393226, 0, 196610, 393227, 0, 196610, 393228, 0, 196610, 393229, 0, 196610, 393230, 0, 196610, 393231, 0, 196610, 393232, 0, 196611, 393233, 0, 0, 393234, 0, 0, 393235, 0, 0, 393236, 0, 0, 393237, 0, 0, 393238, 0, 0, 393239, 0, 196609, 393240, 0, 196610, 393241, 0, 196610, 393242, 0, 196610, 393243, 0, 196610, 393244, 0, 196610, 393245, 0, 196610, 393246, 0, 196610, 393247, 0, 196610, 393248, 0, 196610, 393249, 0, 196610, 393250, 0, 196610, 393251, 0, 196610, 393252, 0, 196610, 393253, 0, 196610, 393254, 0, 196610, 393255, 0, 196610, 458752, 0, 0, 458753, 0, 0, 458754, 0, 0, 458755, 0, 0, 458756, 0, 0, 458757, 0, 0, 458758, 0, 0, 458759, 0, 0, 458760, 0, 0, 458761, 0, 0, 458762, 0, 0, 458763, 0, 0, 458764, 0, 0, 458765, 0, 0, 458766, 0, 0, 458767, 0, 0, 458768, 0, 0, 458769, 0, 0, 458770, 0, 0, 458771, 0, 0, 458772, 0, 0, 458773, 0, 0, 458774, 0, 0, 458775, 0, 0, 458776, 0, 0, 458777, 0, 0, 458778, 0, 0, 458779, 0, 0, 458780, 0, 0, 458781, 0, 0, 458782, 0, 0, 458783, 0, 0, 458784, 0, 0, 458785, 0, 0, 458786, 0, 0, 458787, 0, 0, 458788, 0, 0, 458789, 0, 0, 458790, 0, 0, 458791, 0, 0, 524288, 0, 0, 524289, 0, 0, 524290, 0, 0, 524291, 0, 0, 524292, 0, 0, 524293, 0, 0, 524294, 0, 0, 524295, 0, 0, 524296, 0, 0, 524297, 0, 0, 524298, 0, 0, 524299, 0, 0, 524300, 0, 0, 524301, 0, 0, 524302, 0, 0, 524303, 0, 0, 524304, 0, 0, 524305, 0, 0, 524306, 0, 0, 524307, 0, 0, 524308, 0, 0, 524309, 0, 0, 524310, 0, 0, 524311, 0, 0, 524312, 0, 0, 524313, 0, 0, 524314, 0, 0, 524315, 0, 0, 524316, 0, 0, 524317, 0, 0, 524318, 0, 0, 524319, 0, 0, 524320, 0, 0, 524321, 0, 0, 524322, 0, 0, 524323, 0, 0, 524324, 0, 0, 524325, 0, 0, 524326, 0, 0, 524327, 0, 0, 589824, 0, 0, 589825, 0, 0, 589826, 0, 0, 589827, 0, 0, 589828, 0, 0, 589829, 0, 0, 589830, 0, 0, 589831, 0, 0, 589832, 0, 0, 589833, 0, 0, 589834, 0, 0, 589835, 0, 0, 589836, 0, 0, 589837, 0, 0, 589838, 0, 0, 589839, 0, 0, 589840, 0, 0, 589841, 0, 0, 589842, 0, 0, 589843, 0, 0, 589844, 0, 0, 589845, 0, 0, 589846, 0, 0, 589847, 0, 0, 589848, 0, 0, 589849, 0, 0, 589850, 0, 0, 589851, 0, 0, 589852, 0, 0, 589853, 0, 0, 589854, 0, 0, 589855, 0, 0, 589856, 0, 0, 589857, 0, 0, 589858, 0, 0, 589859, 0, 0, 589860, 0, 0, 589861, 0, 0, 589862, 0, 0, 589863, 0, 0, 655360, 0, 0, 655361, 0, 0, 655362, 0, 0, 655363, 0, 0, 655364, 0, 0, 655365, 0, 0, 655366, 0, 0, 655367, 0, 0, 655368, 0, 0, 655369, 0, 0, 655370, 0, 0, 655371, 0, 0, 655372, 0, 0, 655373, 0, 0, 655374, 0, 0, 655375, 0, 0, 655376, 0, 0, 655377, 0, 0, 655378, 0, 0, 655379, 0, 0, 655380, 0, 0, 655381, 0, 0, 655382, 0, 0, 655383, 0, 0, 655384, 0, 0, 655385, 0, 0, 655386, 0, 0, 655387, 0, 0, 655388, 0, 0, 655389, 0, 0, 655390, 0, 0, 655391, 0, 0, 655392, 0, 0, 655393, 0, 0, 655394, 0, 0, 655395, 0, 0, 655396, 0, 0, 655397, 0, 0, 655398, 0, 0, 655399, 0, 0, 720896, 0, 0, 720897, 0, 0, 720898, 0, 0, 720899, 0, 0, 720900, 0, 0, 720901, 0, 0, 720902, 0, 0, 720903, 0, 0, 720904, 0, 0, 720905, 0, 0, 720906, 0, 0, 720907, 0, 0, 720908, 0, 0, 720909, 0, 0, 720910, 0, 0, 720911, 0, 0, 720912, 0, 0, 720913, 0, 0, 720914, 0, 0, 720915, 0, 0, 720916, 0, 0, 720917, 0, 0, 720918, 0, 0, 720919, 0, 0, 720920, 0, 0, 720921, 0, 0, 720922, 0, 0, 720923, 0, 0, 720924, 0, 0, 720925, 0, 0, 720926, 0, 0, 720927, 0, 0, 720928, 0, 0, 720929, 0, 0, 720930, 0, 0, 720931, 0, 0, 720932, 0, 0, 720933, 0, 0, 720934, 0, 0, 720935, 0, 0, 786432, 0, 0, 786433, 0, 0, 786434, 0, 0, 786435, 0, 0, 786436, 0, 0, 786437, 0, 0, 786438, 0, 0, 786439, 0, 0, 786440, 0, 0, 786441, 0, 0, 786442, 0, 0, 786443, 0, 0, 786444, 0, 0, 786445, 0, 0, 786446, 0, 0, 786447, 0, 0, 786448, 0, 0, 786449, 0, 0, 786450, 0, 0, 786451, 0, 0, 786452, 0, 0, 786453, 0, 0, 786454, 0, 0, 786455, 0, 0, 786456, 0, 0, 786457, 0, 0, 786458, 0, 0, 786459, 0, 0, 786460, 0, 0, 786461, 0, 0, 786462, 0, 0, 786463, 0, 0, 786464, 0, 0, 786465, 0, 0, 786466, 0, 0, 786467, 0, 0, 786468, 0, 0, 786469, 0, 0, 786470, 0, 0, 786471, 0, 0, 851968, 0, 65538, 851969, 0, 65538, 851970, 0, 65538, 851971, 0, 65538, 851972, 0, 65538, 851973, 0, 65538, 851974, 0, 65538, 851975, 0, 65538, 851976, 0, 65538, 851977, 0, 65538, 851978, 0, 65538, 851979, 0, 65538, 851980, 0, 65538, 851981, 0, 65538, 851982, 0, 65538, 851983, 0, 65538, 851984, 0, 65539, 851985, 0, 0, 851986, 0, 0, 851987, 0, 0, 851988, 0, 0, 851989, 0, 0, 851990, 0, 0, 851991, 0, 65537, 851992, 0, 65538, 851993, 0, 65538, 851994, 0, 65538, 851995, 0, 65538, 851996, 0, 65538, 851997, 0, 65538, 851998, 0, 65538, 851999, 0, 65538, 852000, 0, 65538, 852001, 0, 65538, 852002, 0, 65538, 852003, 0, 65538, 852004, 0, 65538, 852005, 0, 65538, 852006, 0, 65538, 852007, 0, 65538, 917504, 0, 131074, 917505, 0, 131074, 917506, 0, 131074, 917507, 0, 131074, 917508, 0, 131074, 917509, 0, 131074, 917510, 0, 131074, 917511, 0, 131074, 917512, 0, 131074, 917513, 0, 131074, 917514, 0, 131074, 917515, 0, 131074, 917516, 0, 131074, 917517, 0, 131074, 917518, 0, 131074, 917519, 0, 131074, 917520, 0, 131075, 917521, 0, 0, 917522, 0, 0, 917523, 0, 0, 917524, 0, 0, 917525, 0, 0, 917526, 0, 0, 917527, 0, 131073, 917528, 0, 131074, 917529, 0, 131074, 917530, 0, 131074, 917531, 0, 131074, 917532, 0, 131074, 917533, 0, 131074, 917534, 0, 131074, 917535, 0, 131074, 917536, 0, 131074, 917537, 0, 131074, 917538, 0, 131074, 917539, 0, 131074, 917540, 0, 131074, 917541, 0, 131074, 917542, 0, 131074, 917543, 0, 131074, 983040, 0, 131074, 983041, 0, 131074, 983042, 0, 131074, 983043, 0, 131074, 983044, 0, 131074, 983045, 0, 131074, 983046, 0, 131074, 983047, 0, 131074, 983048, 0, 131074, 983049, 0, 131074, 983050, 0, 131074, 983051, 0, 131074, 983052, 0, 131074, 983053, 0, 131074, 983054, 0, 131074, 983055, 0, 131074, 983056, 0, 131075, 983057, 0, 0, 983058, 0, 0, 983059, 0, 0, 983060, 0, 0, 983061, 0, 0, 983062, 0, 0, 983063, 0, 131073, 983064, 0, 131074, 983065, 0, 131074, 983066, 0, 131074, 983067, 0, 131074, 983068, 0, 131074, 983069, 0, 131074, 983070, 0, 131074, 983071, 0, 131074, 983072, 0, 131074, 983073, 0, 131074, 983074, 0, 131074, 983075, 0, 131074, 983076, 0, 131074, 983077, 0, 131074, 983078, 0, 131074, 983079, 0, 131074, 1048576, 0, 131074, 1048577, 0, 131074, 1048578, 0, 131074, 1048579, 0, 131074, 1048580, 0, 131074, 1048581, 0, 131074, 1048582, 0, 131074, 1048583, 0, 131074, 1048584, 0, 131074, 1048585, 0, 131074, 1048586, 0, 131074, 1048587, 0, 131074, 1048588, 0, 131074, 1048589, 0, 131074, 1048590, 0, 131074, 1048591, 0, 131074, 1048592, 0, 131075, 1048593, 0, 0, 1048594, 0, 0, 1048595, 0, 0, 1048596, 0, 0, 1048597, 0, 0, 1048598, 0, 0, 1048599, 0, 131073, 1048600, 0, 131074, 1048601, 0, 131074, 1048602, 0, 131074, 1048603, 0, 131074, 1048604, 0, 131074, 1048605, 0, 131074, 1048606, 0, 131074, 1048607, 0, 131074, 1048608, 0, 131074, 1048609, 0, 131074, 1048610, 0, 131074, 1048611, 0, 131074, 1048612, 0, 131074, 1048613, 0, 131074, 1048614, 0, 131074, 1048615, 0, 131074, 1114112, 0, 131074, 1114113, 0, 131074, 1114114, 0, 131074, 1114115, 0, 131074, 1114116, 0, 131074, 1114117, 0, 131074, 1114118, 0, 131074, 1114119, 0, 131074, 1114120, 0, 131074, 1114121, 0, 131074, 1114122, 0, 131074, 1114123, 0, 131074, 1114124, 0, 131074, 1114125, 0, 131074, 1114126, 0, 131074, 1114127, 0, 131074, 1114128, 0, 131075, 1114129, 0, 0, 1114130, 0, 0, 1114131, 0, 0, 1114132, 0, 0, 1114133, 0, 0, 1114134, 0, 0, 1114135, 0, 131073, 1114136, 0, 131074, 1114137, 0, 131074, 1114138, 0, 131074, 1114139, 0, 131074, 1114140, 0, 131074, 1114141, 0, 131074, 1114142, 0, 131074, 1114143, 0, 131074, 1114144, 0, 131074, 1114145, 0, 131074, 1114146, 0, 131074, 1114147, 0, 131074, 1114148, 0, 131074, 1114149, 0, 131074, 1114150, 0, 131074, 1114151, 0, 131074, 1179648, 0, 131074, 1179649, 0, 131074, 1179650, 0, 131074, 1179651, 0, 131074, 1179652, 0, 131074, 1179653, 0, 131074, 1179654, 0, 131074, 1179655, 0, 131074, 1179656, 0, 131074, 1179657, 0, 131074, 1179658, 0, 131074, 1179659, 0, 131074, 1179660, 0, 131074, 1179661, 0, 131074, 1179662, 0, 131074, 1179663, 0, 131074, 1179664, 0, 131075, 1179665, 0, 0, 1179666, 0, 0, 1179667, 0, 0, 1179668, 0, 0, 1179669, 0, 0, 1179670, 0, 0, 1179671, 0, 131073, 1179672, 0, 131074, 1179673, 0, 131074, 1179674, 0, 131074, 1179675, 0, 131074, 1179676, 0, 131074, 1179677, 0, 131074, 1179678, 0, 131074, 1179679, 0, 131074, 1179680, 0, 131074, 1179681, 0, 131074, 1179682, 0, 131074, 1179683, 0, 131074, 1179684, 0, 131074, 1179685, 0, 131074, 1179686, 0, 131074, 1179687, 0, 131074, 1245184, 0, 131074, 1245185, 0, 131074, 1245186, 0, 131074, 1245187, 0, 131074, 1245188, 0, 131074, 1245189, 0, 131074, 1245190, 0, 131074, 1245191, 0, 131074, 1245192, 0, 131074, 1245193, 0, 131074, 1245194, 0, 131074, 1245195, 0, 131074, 1245196, 0, 131074, 1245197, 0, 131074, 1245198, 0, 131074, 1245199, 0, 131074, 1245200, 0, 131075, 1245201, 0, 0, 1245202, 0, 0, 1245203, 0, 0, 1245204, 0, 0, 1245205, 0, 0, 1245206, 0, 0, 1245207, 0, 131073, 1245208, 0, 131074, 1245209, 0, 131074, 1245210, 0, 131074, 1245211, 0, 131074, 1245212, 0, 131074, 1245213, 0, 131074, 1245214, 0, 131074, 1245215, 0, 131074, 1245216, 0, 131074, 1245217, 0, 131074, 1245218, 0, 131074, 1245219, 0, 131074, 1245220, 0, 131074, 1245221, 0, 131074, 1245222, 0, 131074, 1245223, 0, 131074 ) + +[node name="Darkness" parent="." instance=ExtResource( 13 )] + +[node name="Entities" type="Node" parent="."] + +[node name="PhaseOnePlayer" parent="Entities" instance=ExtResource( 17 )] +position = Vector2( 596, 268 ) + +[node name="Fire" parent="Entities" instance=ExtResource( 3 )] +position = Vector2( 640, 319 ) + +[node name="Containers" type="Node" parent="Entities"] + +[node name="Bullets" type="Node" parent="Entities/Containers"] + +[node name="Enemies" type="Node" parent="Entities/Containers"] + +[node name="TowardsFireSpawner" type="Node2D" parent="Entities/Containers/Enemies"] + +[node name="SpawnEveryPeriod" parent="Entities/Containers/Enemies/TowardsFireSpawner" instance=ExtResource( 4 )] +spawning = ExtResource( 5 ) +container_name = "Enemies" + +[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 )] + +[node name="Pickups" type="Node" parent="Entities/Containers"] + +[node name="BranchPickup" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )] +position = Vector2( 574, 344 ) + +[node name="BranchPickup2" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )] +position = Vector2( 769, 320 ) + +[node name="BranchPickup3" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )] +position = Vector2( 618, 497 ) + +[node name="BranchPickup4" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )] +position = Vector2( 354, 309 ) + +[node name="BranchPickup5" parent="Entities/Containers/Pickups" instance=ExtResource( 1 )] +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"] + +[editable path="Entities/Containers/Enemies/TowardsFireSpawner/SpawnEveryPeriod"] diff --git a/src/levels/ui/LifeBarBg.png b/src/levels/ui/LifeBarBg.png new file mode 100644 index 0000000..6eacdbc --- /dev/null +++ b/src/levels/ui/LifeBarBg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b243a9925328813a8760796fa5e14072d91573b9ed0728d0618792e92970aaac +size 5254 diff --git a/src/ui/Music_off.png.import b/src/levels/ui/LifeBarBg.png.import similarity index 71% rename from src/ui/Music_off.png.import rename to src/levels/ui/LifeBarBg.png.import index 55fbcab..7960083 100644 --- a/src/ui/Music_off.png.import +++ b/src/levels/ui/LifeBarBg.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/Music_off.png-27b13d35b03a178cf5a3bbf66101607e.stex" +path="res://.import/LifeBarBg.png-92e27c6c8c2b2c98514ee58be3531b57.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/ui/Music_off.png" -dest_files=[ "res://.import/Music_off.png-27b13d35b03a178cf5a3bbf66101607e.stex" ] +source_file="res://src/levels/ui/LifeBarBg.png" +dest_files=[ "res://.import/LifeBarBg.png-92e27c6c8c2b2c98514ee58be3531b57.stex" ] [params] diff --git a/src/levels/ui/LifeBarFg.png b/src/levels/ui/LifeBarFg.png new file mode 100644 index 0000000..fb5f87e --- /dev/null +++ b/src/levels/ui/LifeBarFg.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dd30be1538773c916fa6350976a10cc1ecd325bd928896036a88cd840e134df +size 10200 diff --git a/src/ui/LifeBarFg.png.import b/src/levels/ui/LifeBarFg.png.import similarity index 71% rename from src/ui/LifeBarFg.png.import rename to src/levels/ui/LifeBarFg.png.import index a53dd13..2158b3d 100644 --- a/src/ui/LifeBarFg.png.import +++ b/src/levels/ui/LifeBarFg.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/LifeBarFg.png-0d39793826fe9b1367d14793755cf28a.stex" +path="res://.import/LifeBarFg.png-28ea90fdcf238c170621d71fd7364d9c.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/ui/LifeBarFg.png" -dest_files=[ "res://.import/LifeBarFg.png-0d39793826fe9b1367d14793755cf28a.stex" ] +source_file="res://src/levels/ui/LifeBarFg.png" +dest_files=[ "res://.import/LifeBarFg.png-28ea90fdcf238c170621d71fd7364d9c.stex" ] [params] diff --git a/src/ui/Music_off.png b/src/levels/ui/MusicOff.png similarity index 100% rename from src/ui/Music_off.png rename to src/levels/ui/MusicOff.png diff --git a/src/ui/Music_on.png.import b/src/levels/ui/MusicOff.png.import similarity index 72% rename from src/ui/Music_on.png.import rename to src/levels/ui/MusicOff.png.import index bac75f4..0baf50c 100644 --- a/src/ui/Music_on.png.import +++ b/src/levels/ui/MusicOff.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/Music_on.png-a4e74b2de0c60b71ef58425ddb79e339.stex" +path="res://.import/MusicOff.png-3d7a249e16e0845cbf72a491bcf78f89.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/ui/Music_on.png" -dest_files=[ "res://.import/Music_on.png-a4e74b2de0c60b71ef58425ddb79e339.stex" ] +source_file="res://src/levels/ui/MusicOff.png" +dest_files=[ "res://.import/MusicOff.png-3d7a249e16e0845cbf72a491bcf78f89.stex" ] [params] diff --git a/src/ui/Music_on.png b/src/levels/ui/MusicOn.png similarity index 100% rename from src/ui/Music_on.png rename to src/levels/ui/MusicOn.png diff --git a/src/ui/LifeBarBg.png.import b/src/levels/ui/MusicOn.png.import similarity index 71% rename from src/ui/LifeBarBg.png.import rename to src/levels/ui/MusicOn.png.import index 664c35f..8d3a631 100644 --- a/src/ui/LifeBarBg.png.import +++ b/src/levels/ui/MusicOn.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/LifeBarBg.png-99f7fc4234c2ec6ac697cc824f58880b.stex" +path="res://.import/MusicOn.png-f3bda32dfd5085be5d85bd799f5e477a.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/ui/LifeBarBg.png" -dest_files=[ "res://.import/LifeBarBg.png-99f7fc4234c2ec6ac697cc824f58880b.stex" ] +source_file="res://src/levels/ui/MusicOn.png" +dest_files=[ "res://.import/MusicOn.png-f3bda32dfd5085be5d85bd799f5e477a.stex" ] [params] diff --git a/src/levels/ui/MuteButton.gd b/src/levels/ui/MuteButton.gd new file mode 100644 index 0000000..abf530e --- /dev/null +++ b/src/levels/ui/MuteButton.gd @@ -0,0 +1,10 @@ +extends Button +class_name MuteButton + + +export(Texture) var on_sprite +export(Texture) var off_sprite + + +func _on_MuteButton_toggled(button_pressed): + $Sprite.texture = on_sprite if button_pressed else off_sprite diff --git a/src/ui/PlayButton.png b/src/levels/ui/PlayButton.png similarity index 100% rename from src/ui/PlayButton.png rename to src/levels/ui/PlayButton.png diff --git a/src/ui/PlayButton.png.import b/src/levels/ui/PlayButton.png.import similarity index 70% rename from src/ui/PlayButton.png.import rename to src/levels/ui/PlayButton.png.import index c44bc8e..daefa88 100644 --- a/src/ui/PlayButton.png.import +++ b/src/levels/ui/PlayButton.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/PlayButton.png-bbb75720f98ee0da7cc56e3bae2f00bf.stex" +path="res://.import/PlayButton.png-e039009d0149a660666f12aa55641bfc.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/ui/PlayButton.png" -dest_files=[ "res://.import/PlayButton.png-bbb75720f98ee0da7cc56e3bae2f00bf.stex" ] +source_file="res://src/levels/ui/PlayButton.png" +dest_files=[ "res://.import/PlayButton.png-e039009d0149a660666f12aa55641bfc.stex" ] [params] diff --git a/src/ui/TimeSurvived.gd b/src/levels/ui/TimeSurvived.gd similarity index 61% rename from src/ui/TimeSurvived.gd rename to src/levels/ui/TimeSurvived.gd index 6defab7..553618d 100644 --- a/src/ui/TimeSurvived.gd +++ b/src/levels/ui/TimeSurvived.gd @@ -1,12 +1,7 @@ extends Label -func _ready(): - var game = get_tree().root.get_node("Game") - game.connect("survival_seconds_updated", self, "_on_survival_seconds_updated") - - -func _on_survival_seconds_updated(value: float): +func _on_PhaseOne_survival_seconds_updated(_origin, value): # warning-ignore:NARROWING_CONVERSION var minutes: int = floor(value / 60) var seconds_and_millis: float = value - minutes * 60 diff --git a/src/levels/ui/Title.png b/src/levels/ui/Title.png new file mode 100644 index 0000000..011df7b --- /dev/null +++ b/src/levels/ui/Title.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9166dfac6cbc0cb2fc4bd877a88efd4414a0c515e7988725c8646679a8094b62 +size 220905 diff --git a/src/ui/Title.png.import b/src/levels/ui/Title.png.import similarity index 72% rename from src/ui/Title.png.import rename to src/levels/ui/Title.png.import index 43eb17c..19eb7d8 100644 --- a/src/ui/Title.png.import +++ b/src/levels/ui/Title.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/Title.png-eddaf0247c16f2cd01805f96e728b10b.stex" +path="res://.import/Title.png-7e1407f721da11d4fb44afc739066a3c.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/ui/Title.png" -dest_files=[ "res://.import/Title.png-eddaf0247c16f2cd01805f96e728b10b.stex" ] +source_file="res://src/levels/ui/Title.png" +dest_files=[ "res://.import/Title.png-7e1407f721da11d4fb44afc739066a3c.stex" ] [params] diff --git a/src/levels/ui/UIBar.png b/src/levels/ui/UIBar.png new file mode 100644 index 0000000..ee2fcf7 --- /dev/null +++ b/src/levels/ui/UIBar.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abede14f1b7d7a9f1c10d0e41af3027e6b423d71a99ca9baf603b3af25ed4859 +size 85907 diff --git a/src/ui/UIBar.png.import b/src/levels/ui/UIBar.png.import similarity index 72% rename from src/ui/UIBar.png.import rename to src/levels/ui/UIBar.png.import index 4f6ca3b..f71d448 100644 --- a/src/ui/UIBar.png.import +++ b/src/levels/ui/UIBar.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/UIBar.png-1a0464279903795260a97a88d660c35b.stex" +path="res://.import/UIBar.png-52cf3d006ccfd901972f38b7c438639b.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/ui/UIBar.png" -dest_files=[ "res://.import/UIBar.png-1a0464279903795260a97a88d660c35b.stex" ] +source_file="res://src/levels/ui/UIBar.png" +dest_files=[ "res://.import/UIBar.png-52cf3d006ccfd901972f38b7c438639b.stex" ] [params] diff --git a/src/levels/ui/UserInterface.tscn b/src/levels/ui/UserInterface.tscn new file mode 100644 index 0000000..e347c03 --- /dev/null +++ b/src/levels/ui/UserInterface.tscn @@ -0,0 +1,78 @@ +[gd_scene load_steps=10 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] +[ext_resource path="res://src/levels/ui/LifeBarFg.png" type="Texture" id=3] +[ext_resource path="res://src/levels/ui/TimeSurvived.gd" type="Script" id=4] +[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] + +[sub_resource type="DynamicFont" id=3] +size = 22 +font_data = ExtResource( 6 ) + +[sub_resource type="Theme" id=2] +default_font = SubResource( 3 ) + +[node name="UserInterface" type="CanvasLayer"] + +[node name="TheDarkNightUI" type="Control" parent="."] +light_mask = 2 +anchor_left = 0.5 +anchor_top = 1.0 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -640.0 +margin_top = -80.0 +margin_right = 640.0 +theme = SubResource( 2 ) + +[node name="UIBar" type="Sprite" parent="TheDarkNightUI"] +position = Vector2( 640, 40 ) +texture = ExtResource( 2 ) + +[node name="TimeSurvived" type="Label" parent="TheDarkNightUI"] +anchor_bottom = 1.0 +margin_left = 589.0 +margin_top = 16.0 +margin_right = 680.0 +margin_bottom = -12.0 +grow_horizontal = 0 +grow_vertical = 2 +text = "00:00.000" +align = 2 +valign = 1 +script = ExtResource( 4 ) + +[node name="TextureProgress" type="TextureProgress" parent="TheDarkNightUI"] +margin_left = 15.0 +margin_top = 15.0 +margin_right = 365.0 +margin_bottom = 65.0 +value = 50.0 +texture_under = ExtResource( 5 ) +texture_progress = ExtResource( 3 ) +texture_progress_offset = Vector2( 10, 5 ) + +[node name="MuteButton" type="Button" parent="TheDarkNightUI"] +anchor_left = 1.0 +anchor_top = 0.5 +anchor_right = 1.0 +anchor_bottom = 0.5 +margin_left = -64.0 +margin_top = -25.0 +margin_bottom = 25.0 +grow_horizontal = 0 +grow_vertical = 2 +size_flags_horizontal = 2 +size_flags_vertical = 2 +toggle_mode = true +flat = true +script = ExtResource( 7 ) + +[node name="Sprite" type="Sprite" parent="TheDarkNightUI/MuteButton"] +texture = ExtResource( 1 ) +centered = false + +[connection signal="toggled" from="TheDarkNightUI/MuteButton" to="TheDarkNightUI/MuteButton" method="_on_MuteButton_toggled"] diff --git a/src/ui/fonts/SourceSerifPro-Regular.ttf b/src/levels/ui/fonts/SourceSerifPro-Regular.ttf similarity index 100% rename from src/ui/fonts/SourceSerifPro-Regular.ttf rename to src/levels/ui/fonts/SourceSerifPro-Regular.ttf diff --git a/src/ui/CrossbowBar.gd b/src/levels/ui/ui/CrossbowBar.gd similarity index 100% rename from src/ui/CrossbowBar.gd rename to src/levels/ui/ui/CrossbowBar.gd diff --git a/src/ui/CrossbowBar.tscn b/src/levels/ui/ui/CrossbowBar.tscn similarity index 69% rename from src/ui/CrossbowBar.tscn rename to src/levels/ui/ui/CrossbowBar.tscn index 7bd6b9c..9699dce 100644 --- a/src/ui/CrossbowBar.tscn +++ b/src/levels/ui/ui/CrossbowBar.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://src/ui/LifeBarBg.png" type="Texture" id=1] +[ext_resource path="res://src/levels/ui/ui/LifeBarBg.png" type="Texture" id=1] [ext_resource path="res://src/pickups/WeaponCrossbow.png" type="Texture" id=2] -[ext_resource path="res://src/ui/LifeBarFg.png" type="Texture" id=3] -[ext_resource path="res://src/ui/CrossbowBar.gd" type="Script" id=4] +[ext_resource path="res://src/levels/ui/ui/LifeBarFg.png" type="Texture" id=3] +[ext_resource path="res://src/levels/ui/ui/CrossbowBar.gd" type="Script" id=4] [node name="CrossbowBar" type="Node"] script = ExtResource( 4 ) diff --git a/src/ui/LifeBarBg.png b/src/levels/ui/ui/LifeBarBg.png similarity index 100% rename from src/ui/LifeBarBg.png rename to src/levels/ui/ui/LifeBarBg.png diff --git a/src/levels/ui/ui/LifeBarBg.png.import b/src/levels/ui/ui/LifeBarBg.png.import new file mode 100644 index 0000000..9268b85 --- /dev/null +++ b/src/levels/ui/ui/LifeBarBg.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/LifeBarBg.png-d71b079c37d64cced487d360afc4c7ba.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/levels/ui/ui/LifeBarBg.png" +dest_files=[ "res://.import/LifeBarBg.png-d71b079c37d64cced487d360afc4c7ba.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/src/ui/LifeBarFg.png b/src/levels/ui/ui/LifeBarFg.png similarity index 100% rename from src/ui/LifeBarFg.png rename to src/levels/ui/ui/LifeBarFg.png diff --git a/src/levels/ui/ui/LifeBarFg.png.import b/src/levels/ui/ui/LifeBarFg.png.import new file mode 100644 index 0000000..0a9dae5 --- /dev/null +++ b/src/levels/ui/ui/LifeBarFg.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/LifeBarFg.png-b0ac7e8ba66eed8291352f0882a46c4e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/levels/ui/ui/LifeBarFg.png" +dest_files=[ "res://.import/LifeBarFg.png-b0ac7e8ba66eed8291352f0882a46c4e.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/src/ui/Title.png b/src/levels/ui/ui/Title.png similarity index 100% rename from src/ui/Title.png rename to src/levels/ui/ui/Title.png diff --git a/src/levels/ui/ui/Title.png.import b/src/levels/ui/ui/Title.png.import new file mode 100644 index 0000000..38007dc --- /dev/null +++ b/src/levels/ui/ui/Title.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/Title.png-94ff37ec420aec401cb4863338e48dea.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/levels/ui/ui/Title.png" +dest_files=[ "res://.import/Title.png-94ff37ec420aec401cb4863338e48dea.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/src/ui/UIBar.png b/src/levels/ui/ui/UIBar.png similarity index 100% rename from src/ui/UIBar.png rename to src/levels/ui/ui/UIBar.png diff --git a/src/levels/ui/ui/UIBar.png.import b/src/levels/ui/ui/UIBar.png.import new file mode 100644 index 0000000..f4bbc45 --- /dev/null +++ b/src/levels/ui/ui/UIBar.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/UIBar.png-115d86e0d213dad70a8a39ba5bb9e894.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://src/levels/ui/ui/UIBar.png" +dest_files=[ "res://.import/UIBar.png-115d86e0d213dad70a8a39ba5bb9e894.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/src/pickups/BranchPickup.tscn b/src/pickups/BranchPickup.tscn index 0b0e6f2..20cdf38 100644 --- a/src/pickups/BranchPickup.tscn +++ b/src/pickups/BranchPickup.tscn @@ -5,12 +5,15 @@ [node name="BranchPickup" instance=ExtResource( 2 )] scale = Vector2( 0.5, 0.5 ) -duration_seconds = 0.4 -despawn_seconds = 15.0 + +[node name="Duration" parent="." index="1"] +wait_time = 0.4 [node name="Despawn" parent="." index="2"] +wait_time = 10.0 autostart = true [node name="ChangeFireIntensity" parent="." index="3" instance=ExtResource( 1 )] +amount_per_second = 20.0 [connection signal="picked_up" from="." to="ChangeFireIntensity" method="_on_picked_up"] diff --git a/src/pickups/Pickup.gd b/src/pickups/Pickup.gd index 36d5c48..4262669 100644 --- a/src/pickups/Pickup.gd +++ b/src/pickups/Pickup.gd @@ -1,50 +1,36 @@ extends Area2D -export var duration_seconds: float setget set_duration, get_duration -export var despawn_seconds: float setget set_despawn, get_despawn - signal picked_up signal expired signal despawned -func _ready(): - set_duration(duration_seconds) - set_despawn(despawn_seconds) +var active = true setget set_active -func set_duration(value): - if value > 0: - $Duration.wait_time = value - -func get_duration(): - return $Duration.wait_time - func _on_Duration_timeout(): emit_signal("expired") queue_free() -func set_despawn(value): - if value > 0: - $Despawn.wait_time = value - -func get_despawn(): - return $Despawn.wait_time - func _on_Despawn_timeout(): - if $Shape.visible: + if active: emit_signal("despawned") queue_free() func pick_up(): - $Shape.visible = false + active = false $Duration.start() emit_signal("picked_up") -func _on_body_entered(_other: RigidBody2D): - # TODO: check that it was the player who entered - if $Shape.visible: +func _on_body_entered(_other): + if active: pick_up() + + +func set_active(value): + active = value + $Shape.visible = value + $Shape.disabled = not value diff --git a/src/pickups/effects/ChangeFireIntensity.gd b/src/pickups/effects/ChangeFireIntensity.gd index 2ff6c5e..7e603e7 100644 --- a/src/pickups/effects/ChangeFireIntensity.gd +++ b/src/pickups/effects/ChangeFireIntensity.gd @@ -1,10 +1,14 @@ extends Node +class_name ChangeFireIntensity export var amount_per_second: float = 0.2 -onready var target = get_tree().root.find_node("Fire", true, false) + + +onready var target = get_tree().root.find_node("Fire", true, false).get_node("Damageable") onready var pickup: Area2D = get_parent() + var active = false @@ -14,4 +18,4 @@ func _on_picked_up(): func _process(delta): if active: - target.intensity += delta * amount_per_second + target.health += delta * amount_per_second diff --git a/src/pickups/effects/RapidFire.gd b/src/pickups/effects/RapidFire.gd index 64afd92..0222eb3 100644 --- a/src/pickups/effects/RapidFire.gd +++ b/src/pickups/effects/RapidFire.gd @@ -2,14 +2,13 @@ extends Node class_name RapidFire -export var new_cooldown: float - -onready var target = get_tree().root.find_node("PhaseOnePlayer", true, false) +onready var target = get_tree().root.find_node("PhaseOnePlayer", true, false).get_node("ShootOnClick") onready var pickup: Area2D = get_parent() func _on_picked_up(): - var shoot = target.get_node("SpawnOnShoot") - shoot.cooldown = new_cooldown - shoot.rapid_fire = true + target.rapid_fire_instances += 1 + +func _on_expired(): + target.rapid_fire_instances -= 1 diff --git a/src/ui/TheDarkNightUI.tscn b/src/ui/TheDarkNightUI.tscn deleted file mode 100644 index eaa41c2..0000000 --- a/src/ui/TheDarkNightUI.tscn +++ /dev/null @@ -1,21 +0,0 @@ -[gd_scene load_steps=4 format=2] - -[ext_resource path="res://src/ui/fonts/SourceSerifPro-Regular.ttf" type="DynamicFontData" id=4] - -[sub_resource type="DynamicFont" id=1] -size = 22 -font_data = ExtResource( 4 ) - -[sub_resource type="Theme" id=2] -default_font = SubResource( 1 ) - -[node name="TheDarkNightUI" type="Control"] -light_mask = 2 -anchor_left = 0.5 -anchor_top = 1.0 -anchor_right = 0.5 -anchor_bottom = 1.0 -margin_left = -640.0 -margin_top = -80.0 -margin_right = 640.0 -theme = SubResource( 2 ) diff --git a/src/ui/fonts/SourceSerifPro-Black.ttf b/src/ui/fonts/SourceSerifPro-Black.ttf deleted file mode 100644 index 8c13ab6..0000000 --- a/src/ui/fonts/SourceSerifPro-Black.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dd297e356657db18cd449e49724711a8d2d987104680bcf84d8eb9aa689f228f -size 228660 diff --git a/src/ui/fonts/SourceSerifPro-BlackItalic.ttf b/src/ui/fonts/SourceSerifPro-BlackItalic.ttf deleted file mode 100644 index 020ae0a..0000000 --- a/src/ui/fonts/SourceSerifPro-BlackItalic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a20de81d644d3af3e3aa80bc69d7956c1cc3a15a84fc16fab919114036c2627d -size 169668 diff --git a/src/ui/fonts/SourceSerifPro-Bold.ttf b/src/ui/fonts/SourceSerifPro-Bold.ttf deleted file mode 100644 index eee5029..0000000 --- a/src/ui/fonts/SourceSerifPro-Bold.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6be2d091a0f086841dcb34bf9c922072e9652f8248607ccb2e013ce4175ea3d8 -size 229740 diff --git a/src/ui/fonts/SourceSerifPro-BoldItalic.ttf b/src/ui/fonts/SourceSerifPro-BoldItalic.ttf deleted file mode 100644 index abe334d..0000000 --- a/src/ui/fonts/SourceSerifPro-BoldItalic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:43e70ba803cf61744a169ef1568b553a1fc10eb990f4b7dff049946dda4170ee -size 172748 diff --git a/src/ui/fonts/SourceSerifPro-ExtraLight.ttf b/src/ui/fonts/SourceSerifPro-ExtraLight.ttf deleted file mode 100644 index 4b0cae7..0000000 --- a/src/ui/fonts/SourceSerifPro-ExtraLight.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dba160c89fdfe42d9b461f4c65e35f68c3e5e2cf9f8208f4c1b01f23dcf60bd6 -size 223716 diff --git a/src/ui/fonts/SourceSerifPro-ExtraLightItalic.ttf b/src/ui/fonts/SourceSerifPro-ExtraLightItalic.ttf deleted file mode 100644 index 4a9b45d..0000000 --- a/src/ui/fonts/SourceSerifPro-ExtraLightItalic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d1303a8bf404ff9db79c9b6c263112d6f767035addf45b960ce242f481bf7447 -size 168132 diff --git a/src/ui/fonts/SourceSerifPro-Italic.ttf b/src/ui/fonts/SourceSerifPro-Italic.ttf deleted file mode 100644 index 48806b7..0000000 --- a/src/ui/fonts/SourceSerifPro-Italic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c056c97c8b54ad366863a9253204161ae18688f8f8031c08375e06fb4eedc881 -size 169568 diff --git a/src/ui/fonts/SourceSerifPro-Light.ttf b/src/ui/fonts/SourceSerifPro-Light.ttf deleted file mode 100644 index a4c52b7..0000000 --- a/src/ui/fonts/SourceSerifPro-Light.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:352d64bde73f62b168b65aa62e28a2e3216cd27ba4e309a2b64e88e22e9834a0 -size 227764 diff --git a/src/ui/fonts/SourceSerifPro-LightItalic.ttf b/src/ui/fonts/SourceSerifPro-LightItalic.ttf deleted file mode 100644 index c0f664e..0000000 --- a/src/ui/fonts/SourceSerifPro-LightItalic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ae2e944444867252225a2088b50bdc6eecbdf46e41d0ba361efcb18703d01a7 -size 171544 diff --git a/src/ui/fonts/SourceSerifPro-SemiBold.ttf b/src/ui/fonts/SourceSerifPro-SemiBold.ttf deleted file mode 100644 index 4beb4fa..0000000 --- a/src/ui/fonts/SourceSerifPro-SemiBold.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5e882aa501fc59d21c36a95ae8effe19fd0863106a66c39d793951b7788acd24 -size 229596 diff --git a/src/ui/fonts/SourceSerifPro-SemiBoldItalic.ttf b/src/ui/fonts/SourceSerifPro-SemiBoldItalic.ttf deleted file mode 100644 index a7b66c7..0000000 --- a/src/ui/fonts/SourceSerifPro-SemiBoldItalic.ttf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cec0aed1f4bd5c3885d035acee305ddc89998130b5bcadf6c496dab1da0c92bf -size 172816