diff --git a/FireExtinguisherEnemy.gd b/FireExtinguisherEnemy.gd new file mode 100644 index 0000000..d3c05d6 --- /dev/null +++ b/FireExtinguisherEnemy.gd @@ -0,0 +1,7 @@ +extends KinematicBody2D +class_name FireExtinguisherEnemy + + +func _ready(): + $AttractedToMovement.goal = get_tree().root.find_node("*/Fire") + diff --git a/project.godot b/project.godot index 7a6d7ad..0126a26 100644 --- a/project.godot +++ b/project.godot @@ -12,7 +12,7 @@ _global_script_classes=[ { "base": "Node", "class": "Alliance", "language": "GDScript", -"path": "res://src/behaviours/Alliance.gd" +"path": "res://src/behaviours/damage/Alliance.gd" }, { "base": "Node", "class": "AttractedToMovement", @@ -20,14 +20,80 @@ _global_script_classes=[ { "path": "res://src/behaviours/movement/AttractedToMovement.gd" }, { "base": "Node", +"class": "BulletMovement", +"language": "GDScript", +"path": "res://src/behaviours/movement/BulletMovement.gd" +}, { +"base": "Node", +"class": "Damaging", +"language": "GDScript", +"path": "res://src/behaviours/damage/Damaging.gd" +}, { +"base": "Node", +"class": "DropLoot", +"language": "GDScript", +"path": "res://src/behaviours/spawning/DropLoot.gd" +}, { +"base": "Node", +"class": "ErraticMovement", +"language": "GDScript", +"path": "res://src/behaviours/movement/ErraticMovement.gd" +}, { +"base": "KinematicBody2D", +"class": "FireExtinguisherEnemy", +"language": "GDScript", +"path": "res://FireExtinguisherEnemy.gd" +}, { +"base": "Node", "class": "Ownership", "language": "GDScript", -"path": "res://src/behaviours/Ownership.gd" +"path": "res://src/behaviours/damage/Ownership.gd" +}, { +"base": "Node", +"class": "PlayerMovement", +"language": "GDScript", +"path": "res://src/behaviours/movement/PlayerMovement.gd" +}, { +"base": "Node", +"class": "RNG", +"language": "GDScript", +"path": "res://src/mechanics/RNG.gd" +}, { +"base": "Node", +"class": "RandomRotationOnReady", +"language": "GDScript", +"path": "res://src/behaviours/RandomRotationOnReady.gd" +}, { +"base": "Node", +"class": "SetSpawnedGoalTo", +"language": "GDScript", +"path": "res://src/behaviours/targeting/SetSpawnedGoalTo.gd" +}, { +"base": "Node2D", +"class": "SpawnEveryPeriod", +"language": "GDScript", +"path": "res://src/behaviours/spawning/SpawnEveryPeriod.gd" +}, { +"base": "Node", +"class": "TeleportToScreenEdge", +"language": "GDScript", +"path": "res://src/behaviours/movement/TeleportToScreenEdge.gd" } ] _global_script_class_icons={ "Alliance": "", "AttractedToMovement": "", -"Ownership": "" +"BulletMovement": "", +"Damaging": "", +"DropLoot": "", +"ErraticMovement": "", +"FireExtinguisherEnemy": "", +"Ownership": "", +"PlayerMovement": "", +"RNG": "", +"RandomRotationOnReady": "", +"SetSpawnedGoalTo": "", +"SpawnEveryPeriod": "", +"TeleportToScreenEdge": "" } [application] diff --git a/src/behaviours/BranchSpawn.gd b/src/behaviours/BranchSpawn.gd deleted file mode 100644 index f867ff6..0000000 --- a/src/behaviours/BranchSpawn.gd +++ /dev/null @@ -1,16 +0,0 @@ -extends Node - -# TODO - -export var branch: PackedScene -export var branch_container_node_path: NodePath - - -onready var branch_container_node: Node = get_node(branch_container_node_path) -onready var source: Node2D = get_parent() - - -func _ready(): - var new_branch = branch.instance() - new_branch.set_position(source.global_position) - branch_container_node.add_child(new_branch) diff --git a/src/behaviours/BranchSpawn.tscn b/src/behaviours/BranchSpawn.tscn deleted file mode 100644 index bb53b87..0000000 --- a/src/behaviours/BranchSpawn.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/BranchSpawn.gd" type="Script" id=1] - -[node name="BranchSpawn" type="Node"] -script = ExtResource( 1 ) diff --git a/src/behaviours/Damageable.tscn b/src/behaviours/Damageable.tscn deleted file mode 100644 index b4dcdbd..0000000 --- a/src/behaviours/Damageable.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/Damageable.gd" type="Script" id=1] - -[node name="Damageable" type="Node"] -script = ExtResource( 1 ) diff --git a/src/behaviours/EnemySpawn.gd b/src/behaviours/EnemySpawn.gd deleted file mode 100644 index 91fb264..0000000 --- a/src/behaviours/EnemySpawn.gd +++ /dev/null @@ -1,34 +0,0 @@ -extends Node - -# Items -export var enemy: PackedScene = preload("res://src/entities/Enemy.tscn") -export var bullet_container_node_path: String = "../.." -onready var bullet_container_node: Node = get_node(bullet_container_node_path) - -var _timer : Timer = null -var rng : RandomNumberGenerator = RandomNumberGenerator.new() - -func _ready(): - _timer = Timer.new() - add_child(_timer) - - _timer.connect("timeout", self, "_on_Timer_timeout") - _timer.set_wait_time(1.5) - _timer.set_one_shot(false) # Make sure it loops - _timer.start() - - rng.randomize() - - -func _on_Timer_timeout(): - var position = Vector2(0, 0) - var new_enemy = enemy.instance() - - var random = rng.randi_range(1, 4) - if random == 1: position = Vector2(0, rng.randf_range(0, 640)) - elif random == 2: position = Vector2(1280, rng.randf_range(0, 640)) - elif random == 3: position = Vector2(rng.randf_range(0, 1280), 0) - else: position = Vector2(rng.randf_range(0, 640), 640) - - new_enemy.set_position(position) - bullet_container_node.add_child(new_enemy) diff --git a/src/behaviours/ErraticMovement.tscn b/src/behaviours/ErraticMovement.tscn deleted file mode 100644 index fb37d54..0000000 --- a/src/behaviours/ErraticMovement.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/ErraticMovement.gd" type="Script" id=1] - -[node name="ErraticMovement" type="Node"] -script = ExtResource( 1 ) diff --git a/src/behaviours/Ownership.tscn b/src/behaviours/Ownership.tscn deleted file mode 100644 index 387bcb3..0000000 --- a/src/behaviours/Ownership.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/Ownership.gd" type="Script" id=1] - -[node name="Ownership" type="Node"] -script = ExtResource( 1 ) diff --git a/src/behaviours/PlayerMovement.tscn b/src/behaviours/PlayerMovement.tscn deleted file mode 100644 index d5f8184..0000000 --- a/src/behaviours/PlayerMovement.tscn +++ /dev/null @@ -1,6 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://src/behaviours/PlayerMovement.gd" type="Script" id=1] - -[node name="PlayerMovement" type="Node"] -script = ExtResource( 1 ) diff --git a/src/behaviours/RandomRotationOnReady.gd b/src/behaviours/RandomRotationOnReady.gd new file mode 100644 index 0000000..e813607 --- /dev/null +++ b/src/behaviours/RandomRotationOnReady.gd @@ -0,0 +1,10 @@ +extends Node +class_name RandomRotationOnReady + + +onready var parent: Node2D = get_parent() +onready var rng: RandomNumberGenerator = get_tree().root.get_node("Game/RNG").rng + + +func _ready(): + parent.rotate(rng.randf() * 2 * PI) diff --git a/src/behaviours/RandomRotationOnReady.tscn b/src/behaviours/RandomRotationOnReady.tscn new file mode 100644 index 0000000..d1c11bd --- /dev/null +++ b/src/behaviours/RandomRotationOnReady.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/RandomRotationOnReady.gd" type="Script" id=1] + +[node name="RandomRotationOnReady" type="Node"] +script = ExtResource( 1 ) +__meta__ = { +"_editor_description_": "Rotates the parent Node2D randomly when the node is ready." +} diff --git a/src/behaviours/Alliance.gd b/src/behaviours/damage/Alliance.gd similarity index 100% rename from src/behaviours/Alliance.gd rename to src/behaviours/damage/Alliance.gd diff --git a/src/behaviours/Alliance.tscn b/src/behaviours/damage/Alliance.tscn similarity index 71% rename from src/behaviours/Alliance.tscn rename to src/behaviours/damage/Alliance.tscn index 55cfd3e..8a6fc79 100644 --- a/src/behaviours/Alliance.tscn +++ b/src/behaviours/damage/Alliance.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://src/behaviours/Alliance.gd" type="Script" id=1] +[ext_resource path="res://src/behaviours/damage/Alliance.gd" type="Script" id=1] [node name="Alliance" type="Node"] script = ExtResource( 1 ) diff --git a/src/behaviours/Damageable.gd b/src/behaviours/damage/Damageable.gd similarity index 100% rename from src/behaviours/Damageable.gd rename to src/behaviours/damage/Damageable.gd diff --git a/src/behaviours/damage/Damageable.tscn b/src/behaviours/damage/Damageable.tscn new file mode 100644 index 0000000..a7af621 --- /dev/null +++ b/src/behaviours/damage/Damageable.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/damage/Damageable.gd" type="Script" id=1] + +[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 new file mode 100644 index 0000000..632af5c --- /dev/null +++ b/src/behaviours/damage/Damaging.gd @@ -0,0 +1,28 @@ +extends Node +class_name Damaging + + +export var damage: int +export var destroy_on_damage: bool +export var friendly_fire: bool + + +onready var parent: Node2D = get_parent() + + +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 + # 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: + queue_free() diff --git a/src/behaviours/damage/Damaging.tscn b/src/behaviours/damage/Damaging.tscn new file mode 100644 index 0000000..0681ac7 --- /dev/null +++ b/src/behaviours/damage/Damaging.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/damage/Damaging.gd" type="Script" id=1] + +[node name="Damaging" type="Node"] +script = ExtResource( 1 ) +__meta__ = { +"_editor_description_": "Allows the object to damage Damageable nodes." +} +damage = 1 +destroy_on_damage = true diff --git a/src/behaviours/Ownership.gd b/src/behaviours/damage/Ownership.gd similarity index 100% rename from src/behaviours/Ownership.gd rename to src/behaviours/damage/Ownership.gd diff --git a/src/behaviours/damage/Ownership.tscn b/src/behaviours/damage/Ownership.tscn new file mode 100644 index 0000000..2c8c01c --- /dev/null +++ b/src/behaviours/damage/Ownership.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/damage/Ownership.gd" type="Script" id=1] + +[node name="Ownership" type="Node"] +script = ExtResource( 1 ) +__meta__ = { +"_editor_description_": "Determines which node \"owns\" the parent instance, allowing for Alliance comparisions." +} diff --git a/src/behaviours/movement/AttractedToMovement.tscn b/src/behaviours/movement/AttractedToMovement.tscn index 23a796c..367cf5c 100644 --- a/src/behaviours/movement/AttractedToMovement.tscn +++ b/src/behaviours/movement/AttractedToMovement.tscn @@ -1,9 +1,11 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://src/entities/behaviours/AttractedToMovement.gd" type="Script" id=1] +[ext_resource path="res://src/behaviours/movement/AttractedToMovement.gd" type="Script" id=1] [node name="AttractedToMovement" type="Node"] script = ExtResource( 1 ) __meta__ = { -"_editor_description_": "Moves the parent KinematicBody2D towards the specified goal." +"_editor_description_": "Moves the parent KinematicBody2D towards the specified goal. +It does not automatically set a goal!" } +movement_per_second = 32.0 diff --git a/src/behaviours/BulletMovement.gd b/src/behaviours/movement/BulletMovement.gd similarity index 93% rename from src/behaviours/BulletMovement.gd rename to src/behaviours/movement/BulletMovement.gd index 1c1b317..649446c 100644 --- a/src/behaviours/BulletMovement.gd +++ b/src/behaviours/movement/BulletMovement.gd @@ -1,4 +1,5 @@ extends Node +class_name BulletMovement signal hit(collision) diff --git a/src/behaviours/movement/BulletMovement.tscn b/src/behaviours/movement/BulletMovement.tscn new file mode 100644 index 0000000..eff2d8d --- /dev/null +++ b/src/behaviours/movement/BulletMovement.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/movement/BulletMovement.gd" type="Script" id=1] + +[node name="BulletMovement" type="Node"] +script = ExtResource( 1 ) diff --git a/src/behaviours/ErraticMovement.gd b/src/behaviours/movement/ErraticMovement.gd similarity index 66% rename from src/behaviours/ErraticMovement.gd rename to src/behaviours/movement/ErraticMovement.gd index 653fa5c..99f0ccd 100644 --- a/src/behaviours/ErraticMovement.gd +++ b/src/behaviours/movement/ErraticMovement.gd @@ -1,19 +1,14 @@ extends Node +class_name ErraticMovement -export var movement_per_second: float = 16.0 +export var movement_per_second: float onready var target: KinematicBody2D = get_parent() -var rng: RandomNumberGenerator - - -func _ready(): - rng = RandomNumberGenerator.new() - rng.randomize() +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) - \ No newline at end of file diff --git a/src/behaviours/movement/ErraticMovement.tscn b/src/behaviours/movement/ErraticMovement.tscn new file mode 100644 index 0000000..1cd7d6b --- /dev/null +++ b/src/behaviours/movement/ErraticMovement.tscn @@ -0,0 +1,7 @@ +[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/PlayerMovement.gd b/src/behaviours/movement/PlayerMovement.gd similarity index 76% rename from src/behaviours/PlayerMovement.gd rename to src/behaviours/movement/PlayerMovement.gd index 210e7e1..f6ac92b 100644 --- a/src/behaviours/PlayerMovement.gd +++ b/src/behaviours/movement/PlayerMovement.gd @@ -1,10 +1,11 @@ extends Node +class_name PlayerMovement -export var movement_per_second: float = 96.0 +export var movement_per_second: float -onready var target: KinematicBody2D = get_parent() +onready var parent: KinematicBody2D = get_parent() func _physics_process(_delta): @@ -18,4 +19,4 @@ func _physics_process(_delta): if direction.length() > 1: direction.normalized() - var _motion: Vector2 = target.move_and_slide(direction * movement_per_second, Vector2.ZERO) + var _motion: Vector2 = parent.move_and_slide(direction * movement_per_second, Vector2.ZERO) diff --git a/src/behaviours/movement/PlayerMovement.tscn b/src/behaviours/movement/PlayerMovement.tscn new file mode 100644 index 0000000..dc29e58 --- /dev/null +++ b/src/behaviours/movement/PlayerMovement.tscn @@ -0,0 +1,7 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/movement/PlayerMovement.gd" type="Script" id=1] + +[node name="PlayerMovement" type="Node"] +script = ExtResource( 1 ) +movement_per_second = 96.0 diff --git a/src/behaviours/movement/TeleportToScreenEdge.gd b/src/behaviours/movement/TeleportToScreenEdge.gd new file mode 100644 index 0000000..425faa3 --- /dev/null +++ b/src/behaviours/movement/TeleportToScreenEdge.gd @@ -0,0 +1,35 @@ +extends Node +class_name TeleportToScreenEdge + + +signal teleported(to) + + +export var bounds: Vector2 + + +onready var parent = get_parent() +onready var rng = get_tree().root.get_node("Game/RNG").rng + + +func teleport(): + var random = rng.randi_range(1, 4) + + var new_position + if random == 1: + # Left + new_position = Vector2(0, rng.randf_range(0, bounds.y)) + elif random == 2: + # Right + new_position = Vector2(bounds.x, rng.randf_range(0, bounds.y)) + elif random == 3: + # Top + new_position = Vector2(rng.randf_range(0, bounds.x), 0) + else: + # Bottom + new_position = Vector2(rng.randf_range(0, bounds.y), bounds.y) + + print("Moving to to %s" % new_position) + parent.set_position(new_position) + + emit_signal("teleported", parent.position) diff --git a/src/behaviours/movement/TeleportToScreenEdge.tscn b/src/behaviours/movement/TeleportToScreenEdge.tscn new file mode 100644 index 0000000..a1becce --- /dev/null +++ b/src/behaviours/movement/TeleportToScreenEdge.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/movement/TeleportToScreenEdge.gd" type="Script" id=1] + +[node name="TeleportToScreenEdge" type="Node"] +script = ExtResource( 1 ) diff --git a/src/behaviours/spawning/DropLoot.gd b/src/behaviours/spawning/DropLoot.gd new file mode 100644 index 0000000..c86d670 --- /dev/null +++ b/src/behaviours/spawning/DropLoot.gd @@ -0,0 +1,47 @@ +extends Node +class_name DropLoot + + +export(Array, PackedScene) var loot_types +export(Array, float) var loot_weights + + +# 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 + + +func _ready(): + if len(loot_types) != len(loot_weights): + push_error("The amount of loot types and loot weights is different!") + + +func select_drop() -> PackedScene: + var total_weights: float = 0.0 + for weight in loot_weights: + total_weights += weight + + var result = rng.randf_range(0.0, total_weights) + + for i in range(loot_types.len()): + var loot_type = loot_types[i] + var loot_weight = loot_weights[i] + result -= loot_weight + if result <= 0: + return loot_type + + push_error("Couldn't select loot type; something went wrong during the calculation!") + return null + + +func create_drop() -> Node: + 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) + return node diff --git a/src/behaviours/spawning/DropLoot.tscn b/src/behaviours/spawning/DropLoot.tscn new file mode 100644 index 0000000..2f844e9 --- /dev/null +++ b/src/behaviours/spawning/DropLoot.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/spawning/DropLoot.gd" type="Script" id=1] + +[node name="DropLoot" type="Node"] +script = ExtResource( 1 ) diff --git a/src/behaviours/spawning/SpawnEveryPeriod.gd b/src/behaviours/spawning/SpawnEveryPeriod.gd new file mode 100644 index 0000000..2ae3539 --- /dev/null +++ b/src/behaviours/spawning/SpawnEveryPeriod.gd @@ -0,0 +1,36 @@ +extends Node2D +class_name SpawnEveryPeriod + + +signal spawned(node) + + +export var spawning: PackedScene +export var bounds: Vector2 setget set_bounds, get_bounds +export var period_secs: float setget set_period, get_period + + +onready var container = get_parent() + + +func spawn(): + if spawning == null: + return + var node: Node2D = 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 diff --git a/src/behaviours/spawning/SpawnEveryPeriod.tscn b/src/behaviours/spawning/SpawnEveryPeriod.tscn new file mode 100644 index 0000000..75b250e --- /dev/null +++ b/src/behaviours/spawning/SpawnEveryPeriod.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/spawning/SpawnEveryPeriod.gd" type="Script" id=1] + +[node name="SpawnEveryPeriod" type="Node2D"] +script = ExtResource( 1 ) + +[node name="Period" type="Timer" parent="."] +autostart = true + +[connection signal="timeout" from="Period" to="." method="spawn"] diff --git a/src/behaviours/targeting/SetSpawnedGoalTo.gd b/src/behaviours/targeting/SetSpawnedGoalTo.gd new file mode 100644 index 0000000..8d6001d --- /dev/null +++ b/src/behaviours/targeting/SetSpawnedGoalTo.gd @@ -0,0 +1,10 @@ +extends Node +class_name SetSpawnedGoalTo + + +export var goal_path: NodePath + + +func set_goal(node): + var movement = node.get_node("AttractedToMovement") + movement.goal = get_node(goal_path) diff --git a/src/behaviours/targeting/SetSpawnedGoalTo.tscn b/src/behaviours/targeting/SetSpawnedGoalTo.tscn new file mode 100644 index 0000000..817d80f --- /dev/null +++ b/src/behaviours/targeting/SetSpawnedGoalTo.tscn @@ -0,0 +1,6 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/behaviours/targeting/SetSpawnedGoalTo.gd" type="Script" id=1] + +[node name="SetSpawnedGoalTo" type="Node"] +script = ExtResource( 1 ) diff --git a/src/entities/AbstractEntity.tscn b/src/entities/AbstractEntity.tscn index b24332b..9859ae5 100644 --- a/src/entities/AbstractEntity.tscn +++ b/src/entities/AbstractEntity.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://src/behaviours/Damageable.tscn" type="PackedScene" id=1] -[ext_resource path="res://src/behaviours/Alliance.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/behaviours/damage/Damageable.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/behaviours/damage/Alliance.tscn" type="PackedScene" id=2] [node name="AbstractEntity" type="KinematicBody2D"] collision_layer = 3 diff --git a/src/entities/Bullet.gd b/src/entities/Bullet.gd deleted file mode 100644 index 9e41186..0000000 --- a/src/entities/Bullet.gd +++ /dev/null @@ -1,21 +0,0 @@ -extends KinematicBody2D - - -export var damage: int = 1 - - -func _on_BulletMovement_hit(collision: KinematicCollision2D): - # Find the owner of this bullet - var bullet_owner = Ownership.get_value(self) - # Check if the bullet should do damage - var same_alliance = Alliance.compare(bullet_owner, collision.collider) - if same_alliance: - return - # Check if it is possible to damage the collider - var damageable = collision.collider.get_node("Damageable") - if damageable == null: - return - # Damage the collider! - damageable.health -= damage - # Alas, destroy self - queue_free() diff --git a/src/entities/Bullet.tscn b/src/entities/Bullet.tscn deleted file mode 100644 index 9f9754f..0000000 --- a/src/entities/Bullet.tscn +++ /dev/null @@ -1,33 +0,0 @@ -[gd_scene load_steps=7 format=2] - -[ext_resource path="res://src/mechanics/Arrow.png" type="Texture" id=1] -[ext_resource path="res://src/behaviours/BulletMovement.gd" type="Script" id=2] -[ext_resource path="res://src/behaviours/Ownership.tscn" type="PackedScene" id=3] -[ext_resource path="res://src/entities/Bullet.gd" type="Script" id=4] -[ext_resource path="res://src/sounds/Arrow.mp3" type="AudioStream" id=5] - -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 16, 3 ) - -[node name="Bullet" type="KinematicBody2D"] -collision_layer = 4 -collision_mask = 2 -script = ExtResource( 4 ) - -[node name="Shape" type="CollisionShape2D" parent="."] -shape = SubResource( 1 ) - -[node name="Sprite" type="Sprite" parent="Shape"] -scale = Vector2( 1, 0.5 ) -texture = ExtResource( 1 ) - -[node name="BulletMovement" type="Node" parent="."] -script = ExtResource( 2 ) - -[node name="Ownership" parent="." instance=ExtResource( 3 )] - -[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 5 ) -autoplay = true - -[connection signal="hit" from="BulletMovement" to="." method="_on_BulletMovement_hit"] diff --git a/src/entities/Enemy.gd b/src/entities/Enemy.gd deleted file mode 100644 index 1ae739a..0000000 --- a/src/entities/Enemy.gd +++ /dev/null @@ -1,8 +0,0 @@ -extends KinematicBody2D - - -func _on_Damageable_dead(): - for child in get_children(): - if child.name == "BranchSpawn": - child.BranchSpawn() - queue_free() diff --git a/src/entities/Enemy.tscn b/src/entities/Enemy.tscn deleted file mode 100644 index b99e93c..0000000 --- a/src/entities/Enemy.tscn +++ /dev/null @@ -1,36 +0,0 @@ -[gd_scene load_steps=9 format=2] - -[ext_resource path="res://src/mechanics/Black.png" type="Texture" id=1] -[ext_resource path="res://src/behaviours/ErraticMovement.tscn" type="PackedScene" id=2] -[ext_resource path="res://src/behaviours/movement/AttractedToMovement.tscn" type="PackedScene" id=3] -[ext_resource path="res://src/behaviours/Damageable.tscn" type="PackedScene" id=4] -[ext_resource path="res://src/behaviours/Alliance.tscn" type="PackedScene" id=5] -[ext_resource path="res://src/entities/Enemy.gd" type="Script" id=6] -[ext_resource path="res://src/behaviours/BranchSpawn.gd" type="Script" id=7] - -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 16, 16 ) - -[node name="Enemy" type="KinematicBody2D"] -collision_layer = 3 -script = ExtResource( 6 ) - -[node name="Shape" type="CollisionShape2D" parent="."] -shape = SubResource( 1 ) - -[node name="Sprite" type="Sprite" parent="Shape"] -texture = ExtResource( 1 ) - -[node name="AttractedTo" parent="." instance=ExtResource( 3 )] - -[node name="ErraticMovement" parent="." instance=ExtResource( 2 )] - -[node name="Damageable" parent="." instance=ExtResource( 4 )] - -[node name="Alliance" parent="." instance=ExtResource( 5 )] -alliance = -1 - -[node name="BranchSpawn" type="Node" parent="."] -script = ExtResource( 7 ) - -[connection signal="dead" from="Damageable" to="." method="_on_Damageable_dead"] diff --git a/src/entities/FireConcept.png.import b/src/entities/FireConcept.png.import index 3f6293d..dcb2790 100644 --- a/src/entities/FireConcept.png.import +++ b/src/entities/FireConcept.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -28,6 +28,7 @@ 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 diff --git a/src/entities/Player.tscn b/src/entities/Player.tscn deleted file mode 100644 index 2b35a63..0000000 --- a/src/entities/Player.tscn +++ /dev/null @@ -1,18 +0,0 @@ -[gd_scene load_steps=5 format=2] - -[ext_resource path="res://src/mechanics/White.png" type="Texture" id=1] -[ext_resource path="res://src/behaviours/PlayerMovement.tscn" type="PackedScene" id=2] -[ext_resource path="res://src/entities/AbstractEntity.tscn" type="PackedScene" id=3] - -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 16, 16 ) - -[node name="Player" 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( 1 ) - -[node name="PlayerMovement" parent="." index="1" instance=ExtResource( 2 )] diff --git a/src/entities/bullets/AbstractBullet.tscn b/src/entities/bullets/AbstractBullet.tscn new file mode 100644 index 0000000..cf23b94 --- /dev/null +++ b/src/entities/bullets/AbstractBullet.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://src/behaviours/movement/BulletMovement.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/behaviours/damage/Ownership.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/behaviours/damage/Damaging.tscn" type="PackedScene" id=3] + +[node name="AbstractBullet" type="KinematicBody2D"] +collision_layer = 4 +collision_mask = 2 + +[node name="BulletMovement" parent="." instance=ExtResource( 1 )] + +[node name="Ownership" parent="." instance=ExtResource( 2 )] + +[node name="Damaging" parent="." instance=ExtResource( 3 )] diff --git a/src/mechanics/Arrow.png b/src/entities/bullets/Arrow.png similarity index 100% rename from src/mechanics/Arrow.png rename to src/entities/bullets/Arrow.png diff --git a/src/mechanics/Arrow.png.import b/src/entities/bullets/Arrow.png.import similarity index 64% rename from src/mechanics/Arrow.png.import rename to src/entities/bullets/Arrow.png.import index e6919df..8b33f22 100644 --- a/src/mechanics/Arrow.png.import +++ b/src/entities/bullets/Arrow.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/Arrow.png-c74a2890a5d000583b97def8c477171b.stex" +path="res://.import/Arrow.png-f36200d9da913e07d0ffb1a2717b8b5c.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/mechanics/Arrow.png" -dest_files=[ "res://.import/Arrow.png-c74a2890a5d000583b97def8c477171b.stex" ] +source_file="res://src/entities/bullets/Arrow.png" +dest_files=[ "res://.import/Arrow.png-f36200d9da913e07d0ffb1a2717b8b5c.stex" ] [params] @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -28,6 +28,7 @@ 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 diff --git a/src/entities/bullets/Arrow.tscn b/src/entities/bullets/Arrow.tscn new file mode 100644 index 0000000..7d87965 --- /dev/null +++ b/src/entities/bullets/Arrow.tscn @@ -0,0 +1,18 @@ +[gd_scene load_steps=4 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] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 16, 6 ) + +[node name="Arrow" instance=ExtResource( 1 )] + +[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="BulletMovement" parent="." index="1"] +movement_per_second = 400.0 diff --git a/src/entities/enemies/AbstractEnemy.tscn b/src/entities/enemies/AbstractEnemy.tscn new file mode 100644 index 0000000..500bd27 --- /dev/null +++ b/src/entities/enemies/AbstractEnemy.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://src/behaviours/spawning/DropLoot.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/entities/AbstractEntity.tscn" type="PackedScene" id=2] + +[node name="AbstractEnemy" instance=ExtResource( 2 )] + +[node name="Alliance" parent="." index="0"] +alliance = -1 + +[node name="DropLoot" parent="." index="2" instance=ExtResource( 1 )] diff --git a/src/entities/enemies/FireExtinguisherEnemy.tscn b/src/entities/enemies/FireExtinguisherEnemy.tscn new file mode 100644 index 0000000..733b319 --- /dev/null +++ b/src/entities/enemies/FireExtinguisherEnemy.tscn @@ -0,0 +1,23 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://src/mechanics/White.png" type="Texture" id=1] +[ext_resource path="res://src/behaviours/movement/ErraticMovement.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/behaviours/movement/AttractedToMovement.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/entities/enemies/AbstractEnemy.tscn" type="PackedScene" id=4] +[ext_resource path="res://FireExtinguisherEnemy.gd" type="Script" id=5] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 16, 16 ) + +[node name="FireExtinguisherEnemy" instance=ExtResource( 4 )] +script = ExtResource( 5 ) + +[node name="Shape" type="CollisionShape2D" parent="." index="0"] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="Shape" index="0"] +texture = ExtResource( 1 ) + +[node name="ErraticMovement" parent="." index="4" instance=ExtResource( 2 )] + +[node name="AttractedToMovement" parent="." index="5" instance=ExtResource( 3 )] diff --git a/src/entities/players/AbstractPlayer.tscn b/src/entities/players/AbstractPlayer.tscn new file mode 100644 index 0000000..284ed62 --- /dev/null +++ b/src/entities/players/AbstractPlayer.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://src/behaviours/movement/PlayerMovement.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/entities/AbstractEntity.tscn" type="PackedScene" id=3] + +[node name="AbstractPlayer" instance=ExtResource( 3 )] + +[node name="PlayerMovement" parent="." index="2" instance=ExtResource( 2 )] diff --git a/src/entities/players/PhaseOnePlayer.tscn b/src/entities/players/PhaseOnePlayer.tscn new file mode 100644 index 0000000..bbd8839 --- /dev/null +++ b/src/entities/players/PhaseOnePlayer.tscn @@ -0,0 +1,15 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://src/entities/players/AbstractPlayer.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/mechanics/White.png" type="Texture" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 16, 16 ) + +[node name="PhaseOnePlayer" instance=ExtResource( 1 )] + +[node name="Shape" type="CollisionShape2D" parent="." index="0"] +shape = SubResource( 1 ) + +[node name="Sprite" type="Sprite" parent="Shape" index="0"] +texture = ExtResource( 2 ) diff --git a/src/levels/Game.tscn b/src/levels/Game.tscn index 9dfb021..d42ac96 100644 --- a/src/levels/Game.tscn +++ b/src/levels/Game.tscn @@ -1,80 +1,75 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=13 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.tscn" type="PackedScene" id=3] -[ext_resource path="res://src/entities/Player.tscn" type="PackedScene" id=4] +[ext_resource path="res://src/entities/players/PhaseOnePlayer.tscn" type="PackedScene" id=4] +[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/TimeSurvived.tscn" type="PackedScene" id=7] -[ext_resource path="res://src/entities/Pickup.tscn" type="PackedScene" id=8] -[ext_resource path="res://src/entities/pickupeffects/ChangeFireIntensity.tscn" type="PackedScene" id=9] -[ext_resource path="res://src/behaviours/EnemySpawn.gd" type="Script" id=10] +[ext_resource path="res://src/mechanics/ScreenEdgeSpawner.tscn" type="PackedScene" id=8] +[ext_resource path="res://src/entities/enemies/FireExtinguisherEnemy.tscn" type="PackedScene" id=9] +[ext_resource path="res://src/behaviours/targeting/SetSpawnedGoalTo.tscn" type="PackedScene" id=10] [ext_resource path="res://src/levels/PhaseOneMusic.gd" type="Script" id=11] [ext_resource path="res://src/ui/HealthBar.tscn" type="PackedScene" id=14] [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="PhaseOneMusic" type="Node" parent="PhaseOne"] +[node name="Music" type="Node" parent="PhaseOne"] script = ExtResource( 11 ) -fire_path = NodePath("../PhaseOneContainer/Fire") -[node name="Bell" type="AudioStreamPlayer" parent="PhaseOne/PhaseOneMusic"] +[node name="Bell" type="AudioStreamPlayer" parent="PhaseOne/Music"] volume_db = -80.0 autoplay = true -[node name="Choir" type="AudioStreamPlayer" parent="PhaseOne/PhaseOneMusic"] +[node name="Choir" type="AudioStreamPlayer" parent="PhaseOne/Music"] volume_db = -80.0 autoplay = true -[node name="Drum" type="AudioStreamPlayer" parent="PhaseOne/PhaseOneMusic"] +[node name="Drum" type="AudioStreamPlayer" parent="PhaseOne/Music"] volume_db = -80.0 autoplay = true -[node name="PhaseOneContainer" type="Node2D" parent="PhaseOne"] +[node name="Entities" type="Node2D" parent="PhaseOne"] -[node name="Background" parent="PhaseOne/PhaseOneContainer" instance=ExtResource( 1 )] +[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/PhaseOneContainer" instance=ExtResource( 2 )] +[node name="Darkness" parent="PhaseOne/Entities" instance=ExtResource( 2 )] position = Vector2( 553, 296 ) -[node name="Player" parent="PhaseOne/PhaseOneContainer" instance=ExtResource( 4 )] -position = Vector2( 500, 438 ) +[node name="PhaseOnePlayer" parent="PhaseOne/Entities" instance=ExtResource( 4 )] +position = Vector2( 596, 268 ) -[node name="EnemySpawner" type="Node" parent="PhaseOne/PhaseOneContainer"] -script = ExtResource( 10 ) - -[node name="Fire" parent="PhaseOne/PhaseOneContainer" instance=ExtResource( 3 )] +[node name="Fire" parent="PhaseOne/Entities" instance=ExtResource( 3 )] position = Vector2( 640, 320 ) -intensity = 0.3 +intensity = 1.0 -[node name="Pickup" parent="PhaseOne/PhaseOneContainer" instance=ExtResource( 8 )] -position = Vector2( 618, 360 ) -duration_seconds = nan +[node name="Pickups" type="Node" parent="PhaseOne/Entities"] -[node name="ChangeFireIntensity" parent="PhaseOne/PhaseOneContainer/Pickup" instance=ExtResource( 9 )] +[node name="Enemies" type="Node" parent="PhaseOne/Entities"] -[node name="Pickup4" parent="PhaseOne/PhaseOneContainer" instance=ExtResource( 8 )] -position = Vector2( 612, 230 ) -duration_seconds = nan +[node name="ScreenEdgeSpawner" parent="PhaseOne/Entities/Enemies" instance=ExtResource( 8 )] +spawning = ExtResource( 9 ) +bounds = Vector2( 1280, 640 ) +period_secs = 1.0 -[node name="ChangeFireIntensity" parent="PhaseOne/PhaseOneContainer/Pickup4" instance=ExtResource( 9 )] +[node name="SetSpawnedGoalTo" parent="PhaseOne/Entities/Enemies/ScreenEdgeSpawner" instance=ExtResource( 10 )] +goal_path = NodePath("../../../Fire") -[node name="Pickup2" parent="PhaseOne/PhaseOneContainer" instance=ExtResource( 8 )] -position = Vector2( 343, 287 ) -duration_seconds = nan +[node name="ScreenEdgeSpawner2" parent="PhaseOne/Entities/Enemies" instance=ExtResource( 8 )] +spawning = ExtResource( 9 ) +bounds = Vector2( 1280, 640 ) +period_secs = 1.0 -[node name="ChangeFireIntensity" parent="PhaseOne/PhaseOneContainer/Pickup2" instance=ExtResource( 9 )] - -[node name="Pickup3" parent="PhaseOne/PhaseOneContainer" instance=ExtResource( 8 )] -position = Vector2( 451, 148 ) -duration_seconds = nan - -[node name="ChangeFireIntensity" parent="PhaseOne/PhaseOneContainer/Pickup3" instance=ExtResource( 9 )] +[node name="SetSpawnedGoalTo" parent="PhaseOne/Entities/Enemies/ScreenEdgeSpawner2" instance=ExtResource( 10 )] +goal_path = NodePath("../../../PhaseOnePlayer") [node name="UserInterface" type="CanvasLayer" parent="."] @@ -92,3 +87,7 @@ margin_right = 640.0 [node name="HealthBar" parent="UserInterface/UserIntefaceContainer" instance=ExtResource( 14 )] margin_left = 14.0 + +[connection signal="intensity_changed" from="PhaseOne/Entities/Fire" to="PhaseOne/Music" method="_on_Fire_intensity_changed"] +[connection signal="spawned" from="PhaseOne/Entities/Enemies/ScreenEdgeSpawner" to="PhaseOne/Entities/Enemies/ScreenEdgeSpawner/SetSpawnedGoalTo" method="set_goal"] +[connection signal="spawned" from="PhaseOne/Entities/Enemies/ScreenEdgeSpawner2" to="PhaseOne/Entities/Enemies/ScreenEdgeSpawner2/SetSpawnedGoalTo" method="set_goal"] diff --git a/src/levels/PhaseOneMusic.gd b/src/levels/PhaseOneMusic.gd index dbd8d33..9a771ac 100644 --- a/src/levels/PhaseOneMusic.gd +++ b/src/levels/PhaseOneMusic.gd @@ -1,6 +1,5 @@ extends Node -export var fire_path: NodePath export var choir_min: float = 0.05 export var choir_max: float = 0.30 @@ -10,12 +9,7 @@ export var drum_min: float = 0.40 export var drum_max: float = 0.80 -func _ready(): - var fire = get_node(fire_path) - fire.connect("intensity_changed", self, "_on_fire_intensity_changed") - - -func _on_fire_intensity_changed(value): +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" diff --git a/src/mechanics/Black.png.import b/src/mechanics/Black.png.import index fb608a7..935f753 100644 --- a/src/mechanics/Black.png.import +++ b/src/mechanics/Black.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -28,6 +28,7 @@ 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 diff --git a/src/mechanics/GimpWood.png.import b/src/mechanics/GimpWood.png.import index 7391d93..3d2809b 100644 --- a/src/mechanics/GimpWood.png.import +++ b/src/mechanics/GimpWood.png.import @@ -28,6 +28,7 @@ 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 diff --git a/src/mechanics/GrassDirtTileset.png.import b/src/mechanics/GrassDirtTileset.png.import index 3d18c24..ced61ac 100644 --- a/src/mechanics/GrassDirtTileset.png.import +++ b/src/mechanics/GrassDirtTileset.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -28,6 +28,7 @@ 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 diff --git a/src/mechanics/Light.png.import b/src/mechanics/Light.png.import index 23e8036..71c6704 100644 --- a/src/mechanics/Light.png.import +++ b/src/mechanics/Light.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -28,6 +28,7 @@ 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 diff --git a/src/behaviours/SpriteRandomRotation.gd b/src/mechanics/RNG.gd similarity index 66% rename from src/behaviours/SpriteRandomRotation.gd rename to src/mechanics/RNG.gd index 5a94ccb..5234c9f 100644 --- a/src/behaviours/SpriteRandomRotation.gd +++ b/src/mechanics/RNG.gd @@ -1,8 +1,10 @@ -extends Sprite +extends Node +class_name RNG + var rng: RandomNumberGenerator + func _ready(): rng = RandomNumberGenerator.new() rng.randomize() - self.rotate(rng.randf() * 2 * PI) diff --git a/src/mechanics/RNG.tscn b/src/mechanics/RNG.tscn new file mode 100644 index 0000000..c2d66f5 --- /dev/null +++ b/src/mechanics/RNG.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/mechanics/RNG.gd" type="Script" id=1] + +[node name="RNG" type="Node"] +script = ExtResource( 1 ) +__meta__ = { +"_editor_description_": "Global random number generator that can be accessed by any script at $/Game/RNG." +} diff --git a/src/mechanics/ScreenEdgeSpawner.tscn b/src/mechanics/ScreenEdgeSpawner.tscn new file mode 100644 index 0000000..ad1194f --- /dev/null +++ b/src/mechanics/ScreenEdgeSpawner.tscn @@ -0,0 +1,10 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://src/behaviours/spawning/SpawnEveryPeriod.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/behaviours/movement/TeleportToScreenEdge.tscn" type="PackedScene" id=2] + +[node name="ScreenEdgeSpawner" instance=ExtResource( 1 )] + +[node name="TeleportToScreenEdge" parent="." index="1" instance=ExtResource( 2 )] + +[connection signal="timeout" from="Period" to="TeleportToScreenEdge" method="teleport"] diff --git a/src/mechanics/White.png.import b/src/mechanics/White.png.import index 480fcca..4730e5a 100644 --- a/src/mechanics/White.png.import +++ b/src/mechanics/White.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -28,6 +28,7 @@ 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 diff --git a/src/mechanics/Branch1.png b/src/pickups/Branch1.png similarity index 100% rename from src/mechanics/Branch1.png rename to src/pickups/Branch1.png diff --git a/src/mechanics/Branch1.png.import b/src/pickups/Branch1.png.import similarity index 65% rename from src/mechanics/Branch1.png.import rename to src/pickups/Branch1.png.import index ce02367..854a111 100644 --- a/src/mechanics/Branch1.png.import +++ b/src/pickups/Branch1.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/Branch1.png-99f09072e85d1a5bd66b495d591945f1.stex" +path="res://.import/Branch1.png-7e27ca4a6b40f6dab201183aecab63ec.stex" metadata={ "vram_texture": false } [deps] -source_file="res://src/mechanics/Branch1.png" -dest_files=[ "res://.import/Branch1.png-99f09072e85d1a5bd66b495d591945f1.stex" ] +source_file="res://src/pickups/Branch1.png" +dest_files=[ "res://.import/Branch1.png-7e27ca4a6b40f6dab201183aecab63ec.stex" ] [params] @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 @@ -28,6 +28,7 @@ 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 diff --git a/src/entities/Pickup.gd b/src/pickups/Pickup.gd similarity index 100% rename from src/entities/Pickup.gd rename to src/pickups/Pickup.gd diff --git a/src/entities/Pickup.tscn b/src/pickups/Pickup.tscn similarity index 76% rename from src/entities/Pickup.tscn rename to src/pickups/Pickup.tscn index 60c2dd6..07f7196 100644 --- a/src/entities/Pickup.tscn +++ b/src/pickups/Pickup.tscn @@ -1,28 +1,29 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://src/mechanics/Branch1.png" type="Texture" id=1] -[ext_resource path="res://src/entities/Pickup.gd" type="Script" id=2] -[ext_resource path="res://src/behaviours/SpriteRandomRotation.gd" type="Script" id=3] +[ext_resource path="res://src/entities/behaviours/SpriteRandomRotation.gd" type="Script" id=1] +[ext_resource path="res://src/pickups/Branch1.png" type="Texture" id=2] +[ext_resource path="res://src/entities/Pickup.gd" type="Script" id=3] [sub_resource type="RectangleShape2D" id=1] extents = Vector2( 16, 16 ) [node name="Pickup" type="Area2D"] input_pickable = false -script = ExtResource( 2 ) +script = ExtResource( 3 ) [node name="Shape" type="CollisionShape2D" parent="."] shape = SubResource( 1 ) [node name="Sprite" type="Sprite" parent="Shape"] -texture = ExtResource( 1 ) -script = ExtResource( 3 ) +texture = ExtResource( 2 ) +script = ExtResource( 1 ) [node name="Duration" type="Timer" parent="."] one_shot = true [node name="Despawn" type="Timer" parent="."] one_shot = true + [connection signal="body_entered" from="." to="." method="_on_body_entered"] [connection signal="timeout" from="Duration" to="." method="_on_Duration_timeout"] [connection signal="timeout" from="Despawn" to="." method="_on_Despawn_timeout"] diff --git a/src/entities/pickupeffects/ChangeFireIntensity.gd b/src/pickups/effects/ChangeFireIntensity.gd similarity index 100% rename from src/entities/pickupeffects/ChangeFireIntensity.gd rename to src/pickups/effects/ChangeFireIntensity.gd diff --git a/src/entities/pickupeffects/ChangeFireIntensity.tscn b/src/pickups/effects/ChangeFireIntensity.tscn similarity index 52% rename from src/entities/pickupeffects/ChangeFireIntensity.tscn rename to src/pickups/effects/ChangeFireIntensity.tscn index 6af9b1a..9176d47 100644 --- a/src/entities/pickupeffects/ChangeFireIntensity.tscn +++ b/src/pickups/effects/ChangeFireIntensity.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://src/entities/pickupeffects/ChangeFireIntensity.gd" type="Script" id=1] +[ext_resource path="res://src/pickups/effects/ChangeFireIntensity.gd" type="Script" id=1] [node name="ChangeFireIntensity" type="Node"] script = ExtResource( 1 )