Merged with main and fixed merge conflicts

This commit is contained in:
VoidTwo
2021-11-29 13:53:26 -06:00
161 changed files with 2347 additions and 778 deletions

6
Levels/Hub World.gd Normal file
View File

@@ -0,0 +1,6 @@
extends Node2D
func _ready() -> void:
$YSort/Player.load_hud($HUD)
return

18
Levels/Hub World.tscn Normal file
View File

@@ -0,0 +1,18 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://Levels/Hub World.gd" type="Script" id=2]
[ext_resource path="res://GUI/HUD.tscn" type="PackedScene" id=3]
[ext_resource path="res://GUI/Pause Screen.tscn" type="PackedScene" id=4]
[node name="Hub World" type="Node2D"]
script = ExtResource( 2 )
[node name="YSort" type="YSort" parent="."]
[node name="Player" parent="YSort" instance=ExtResource( 1 )]
position = Vector2( 160, 90 )
[node name="HUD" parent="." instance=ExtResource( 3 )]
[node name="Pause Screen" parent="." instance=ExtResource( 4 )]

6
Levels/Level 2.gd Normal file
View File

@@ -0,0 +1,6 @@
extends Node2D
func _ready() -> void:
$YSort/Player.position = get_viewport_rect().size / 2
$YSort/Player.load_hud($HUD)
return

198
Levels/Level 2.tscn Normal file

File diff suppressed because one or more lines are too long

6
Levels/Level 5.gd Normal file
View File

@@ -0,0 +1,6 @@
extends Node2D
func _ready() -> void:
$YSort/Player.load_hud($HUD)
return

71
Levels/Level 5.tscn Normal file

File diff suppressed because one or more lines are too long

20
Levels/Objects/Tree.tscn Normal file
View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Sprites/Assets/forestTreeBig.png" type="Texture" id=1]
[sub_resource type="CapsuleShape2D" id=1]
radius = 6.0
height = 10.0
[node name="Tree" type="Node2D"]
[node name="Sprite" type="Sprite" parent="."]
modulate = Color( 0.870588, 0.215686, 0.215686, 1 )
texture = ExtResource( 1 )
offset = Vector2( 0, -5 )
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
rotation = 1.5708
shape = SubResource( 1 )

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Sprites/Assets/Dead_Tree.png" type="Texture" id=1]
[sub_resource type="CapsuleShape2D" id=1]
radius = 3.0
height = 4.0
[node name="Dead Tree" type="Node2D"]
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -1.93028 )
scale = Vector2( 1, 1.48257 )
texture = ExtResource( 1 )
offset = Vector2( -1, -5 )
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource( 1 )

View File

@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Sprites/Assets/forestHouse.png" type="Texture" id=1]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 13, 10 )
[node name="forestHouse" type="Node2D"]
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
offset = Vector2( 0, -8 )
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource( 1 )

View File

@@ -0,0 +1,18 @@
extends Area2D
export var enemy_path: String = 'res://Enemies/ENEMY.tscn'
export var relative_x_tiles: int
export var relative_y_tiles: int
func _on_spawn_trap_area_entered(_area: Area2D) -> void:
set_deferred('monitoring', false)
$Tile.set_deferred('disabled', true)
var enemy: KinematicBody2D = load(enemy_path).instance()
enemy.position.x = position.x + (relative_x_tiles * 16 + 8)
enemy.position.y = position.y + (relative_y_tiles * 16 + 8)
var enemies: YSort = get_tree().get_current_scene().get_node('YSort/Enemies')
enemies.call_deferred('add_child', enemy)
return

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Levels/Traps/Spawn Trap.gd" type="Script" id=1]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 8, 8 )
[node name="Spawn Trap" type="Area2D"]
light_mask = 0
collision_layer = 0
collision_mask = 2
input_pickable = false
monitorable = false
script = ExtResource( 1 )
[node name="Tile" type="CollisionShape2D" parent="."]
position = Vector2( 8, 8 )
shape = SubResource( 1 )
[connection signal="area_entered" from="." to="." method="_on_spawn_trap_area_entered"]