Compare commits

...

10 Commits

Author SHA1 Message Date
VoidTwo
219e55c860 Implemented credits scene 2021-12-13 02:15:01 -06:00
VoidTwo
c00ddd741c Added font credits 2021-12-13 01:06:16 -06:00
VoidTwo
c10acf2469 Added Hub World floor tileset credit 2021-12-13 01:00:31 -06:00
VoidTwo
ef5ce684eb Fixed debugger errors in many files and optimized some scenes/code 2021-12-12 23:55:59 -06:00
fc6dfdef4d updated credits 2021-12-12 19:30:33 -06:00
877648dbc2 added music/sounds 2021-12-12 16:44:25 -06:00
Jasmine Hyder
2c65c5f4b6 haha 2021-12-10 15:38:00 -06:00
VoidTwo
6bfbfd7989 Merged with previous commit 2021-12-10 15:05:49 -06:00
VoidTwo
494f8e60b2 Optimized png files 2021-12-10 15:05:37 -06:00
c64401aaac updated l4 boss area, timeout on level end 2021-12-10 14:49:18 -06:00
104 changed files with 855 additions and 441 deletions

View File

@@ -6,6 +6,50 @@
[ext_resource path="res://Sprites/Enemies/Demon_Slime_Spritesheet.png" type="Texture" id=5] [ext_resource path="res://Sprites/Enemies/Demon_Slime_Spritesheet.png" type="Texture" id=5]
[ext_resource path="res://Sprites/Enemies/Chasing_Glowing_Ghost.png" type="Texture" id=7] [ext_resource path="res://Sprites/Enemies/Chasing_Glowing_Ghost.png" type="Texture" id=7]
[sub_resource type="AtlasTexture" id=37]
atlas = ExtResource( 5 )
region = Rect2( 0, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=38]
atlas = ExtResource( 5 )
region = Rect2( 288, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=39]
atlas = ExtResource( 5 )
region = Rect2( 576, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=40]
atlas = ExtResource( 5 )
region = Rect2( 864, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=41]
atlas = ExtResource( 5 )
region = Rect2( 1152, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=42]
atlas = ExtResource( 5 )
region = Rect2( 1440, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=58]
atlas = ExtResource( 5 )
region = Rect2( 0, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=59]
atlas = ExtResource( 5 )
region = Rect2( 288, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=60]
atlas = ExtResource( 5 )
region = Rect2( 576, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=61]
atlas = ExtResource( 5 )
region = Rect2( 864, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=62]
atlas = ExtResource( 5 )
region = Rect2( 1152, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=3] [sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 5 ) atlas = ExtResource( 5 )
region = Rect2( 0, 640, 288, 160 ) region = Rect2( 0, 640, 288, 160 )
@@ -94,6 +138,54 @@ region = Rect2( 5760, 640, 288, 160 )
atlas = ExtResource( 5 ) atlas = ExtResource( 5 )
region = Rect2( 6048, 640, 288, 160 ) region = Rect2( 6048, 640, 288, 160 )
[sub_resource type="AtlasTexture" id=25]
atlas = ExtResource( 5 )
region = Rect2( 0, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=26]
atlas = ExtResource( 5 )
region = Rect2( 288, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=27]
atlas = ExtResource( 5 )
region = Rect2( 576, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=28]
atlas = ExtResource( 5 )
region = Rect2( 864, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=29]
atlas = ExtResource( 5 )
region = Rect2( 1152, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=30]
atlas = ExtResource( 5 )
region = Rect2( 1440, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=31]
atlas = ExtResource( 5 )
region = Rect2( 1728, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=32]
atlas = ExtResource( 5 )
region = Rect2( 2016, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=33]
atlas = ExtResource( 5 )
region = Rect2( 2304, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=34]
atlas = ExtResource( 5 )
region = Rect2( 2592, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=35]
atlas = ExtResource( 5 )
region = Rect2( 2880, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=36]
atlas = ExtResource( 5 )
region = Rect2( 3168, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=43] [sub_resource type="AtlasTexture" id=43]
atlas = ExtResource( 5 ) atlas = ExtResource( 5 )
region = Rect2( 0, 320, 288, 160 ) region = Rect2( 0, 320, 288, 160 )
@@ -154,124 +246,32 @@ region = Rect2( 3744, 320, 288, 160 )
atlas = ExtResource( 5 ) atlas = ExtResource( 5 )
region = Rect2( 4032, 320, 288, 160 ) region = Rect2( 4032, 320, 288, 160 )
[sub_resource type="AtlasTexture" id=58]
atlas = ExtResource( 5 )
region = Rect2( 0, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=59]
atlas = ExtResource( 5 )
region = Rect2( 288, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=60]
atlas = ExtResource( 5 )
region = Rect2( 576, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=61]
atlas = ExtResource( 5 )
region = Rect2( 864, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=62]
atlas = ExtResource( 5 )
region = Rect2( 1152, 480, 288, 160 )
[sub_resource type="AtlasTexture" id=25]
atlas = ExtResource( 5 )
region = Rect2( 0, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=26]
atlas = ExtResource( 5 )
region = Rect2( 288, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=27]
atlas = ExtResource( 5 )
region = Rect2( 576, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=28]
atlas = ExtResource( 5 )
region = Rect2( 864, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=29]
atlas = ExtResource( 5 )
region = Rect2( 1152, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=30]
atlas = ExtResource( 5 )
region = Rect2( 1440, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=31]
atlas = ExtResource( 5 )
region = Rect2( 1728, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=32]
atlas = ExtResource( 5 )
region = Rect2( 2016, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=33]
atlas = ExtResource( 5 )
region = Rect2( 2304, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=34]
atlas = ExtResource( 5 )
region = Rect2( 2592, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=35]
atlas = ExtResource( 5 )
region = Rect2( 2880, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=36]
atlas = ExtResource( 5 )
region = Rect2( 3168, 160, 288, 160 )
[sub_resource type="AtlasTexture" id=37]
atlas = ExtResource( 5 )
region = Rect2( 0, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=38]
atlas = ExtResource( 5 )
region = Rect2( 288, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=39]
atlas = ExtResource( 5 )
region = Rect2( 576, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=40]
atlas = ExtResource( 5 )
region = Rect2( 864, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=41]
atlas = ExtResource( 5 )
region = Rect2( 1152, 0, 288, 160 )
[sub_resource type="AtlasTexture" id=42]
atlas = ExtResource( 5 )
region = Rect2( 1440, 0, 288, 160 )
[sub_resource type="SpriteFrames" id=63] [sub_resource type="SpriteFrames" id=63]
animations = [ { animations = [ {
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ) ], "frames": [ SubResource( 37 ), SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ) ],
"loop": true, "loop": true,
"name": "Death", "name": "Idle",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 56 ), SubResource( 57 ) ],
"loop": true,
"name": "Attack",
"speed": 15.0
}, {
"frames": [ SubResource( 58 ), SubResource( 59 ), SubResource( 60 ), SubResource( 61 ), SubResource( 62 ) ], "frames": [ SubResource( 58 ), SubResource( 59 ), SubResource( 60 ), SubResource( 61 ), SubResource( 62 ) ],
"loop": true, "loop": true,
"name": "Hit", "name": "Hit",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ) ],
"loop": true,
"name": "Death",
"speed": 5.0
}, {
"frames": [ SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ), SubResource( 34 ), SubResource( 35 ), SubResource( 36 ) ], "frames": [ SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ), SubResource( 34 ), SubResource( 35 ), SubResource( 36 ) ],
"loop": true, "loop": true,
"name": "Walk", "name": "Walk",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 37 ), SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ) ], "frames": [ SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 56 ), SubResource( 57 ) ],
"loop": true, "loop": true,
"name": "Idle", "name": "Attack",
"speed": 5.0 "speed": 15.0
} ] } ]
[sub_resource type="CapsuleShape2D" id=64] [sub_resource type="CapsuleShape2D" id=64]
@@ -299,7 +299,7 @@ position = Vector2( 2, -15 )
scale = Vector2( 0.5, 0.5 ) scale = Vector2( 0.5, 0.5 )
frames = SubResource( 63 ) frames = SubResource( 63 )
animation = "Idle" animation = "Idle"
frame = 5 frame = 1
playing = true playing = true
[node name="Sprite" type="Sprite" parent="."] [node name="Sprite" type="Sprite" parent="."]

61
Enemies/Ghost Enemy.gd Normal file
View File

@@ -0,0 +1,61 @@
extends KinematicBody2D
export var fireball: PackedScene
var player: KinematicBody2D = null
var move: Vector2 = Vector2.ZERO
const SPEED: int = 50
var counter: int = 0
var velocity: Vector2 = Vector2.ZERO
var health: int = 4
func _ready() -> void:
visible = false
return
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
if player and position.distance_to(player.position) > 1:
velocity = position.direction_to(player.position).normalized() * SPEED
velocity = move_and_slide(velocity)
return
func _on_Area2D_body_entered(body: Node) -> void:
if body.is_in_group('player'):
player = body
if counter == 0:
self.visible = true
$AnimatedSprite.play('appear')
counter = 1
return
func _on_AnimatedSprite_animation_finished() -> void:
$AnimatedSprite.play('idle')
return
func _on_Hitbox_area_entered(area: Area2D) -> void:
if area.is_in_group('player_weapon_1'):
health -= 1
elif area.is_in_group('player_weapon_2'):
health -= 2
if health <= 0:
$AnimatedSprite.play('vanish')
yield($AnimatedSprite, 'animation_finished')
call_deferred('queue_free')
return
func _on_Projectile_Timer_timeout() -> void:
if player:
var projectile: Node = fireball.instance()
projectile.init($AnimatedSprite.global_position, player.position)
get_tree().get_current_scene().get_node('Projectiles').add_child(projectile)
$AnimatedSprite.play('shriek')
return

View File

@@ -4,7 +4,7 @@
[ext_resource path="res://Sprites/Assets/ghost-idle.png" type="Texture" id=2] [ext_resource path="res://Sprites/Assets/ghost-idle.png" type="Texture" id=2]
[ext_resource path="res://Sprites/Assets/ghost-shriek.png" type="Texture" id=3] [ext_resource path="res://Sprites/Assets/ghost-shriek.png" type="Texture" id=3]
[ext_resource path="res://Sprites/Assets/ghost-vanish.png" type="Texture" id=4] [ext_resource path="res://Sprites/Assets/ghost-vanish.png" type="Texture" id=4]
[ext_resource path="res://Enemies/Ghost_Enemy.gd" type="Script" id=5] [ext_resource path="res://Enemies/Ghost Enemy.gd" type="Script" id=5]
[ext_resource path="res://Enemies/Projectiles/Fireball.tscn" type="PackedScene" id=6] [ext_resource path="res://Enemies/Projectiles/Fireball.tscn" type="PackedScene" id=6]
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_14.png" type="Texture" id=7] [ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_14.png" type="Texture" id=7]
@@ -36,29 +36,21 @@ region = Rect2( 320, 0, 64, 80 )
atlas = ExtResource( 2 ) atlas = ExtResource( 2 )
region = Rect2( 384, 0, 64, 80 ) region = Rect2( 384, 0, 64, 80 )
[sub_resource type="AtlasTexture" id=8] [sub_resource type="AtlasTexture" id=23]
atlas = ExtResource( 1 ) atlas = ExtResource( 3 )
region = Rect2( 0, 0, 64, 48 ) region = Rect2( 128, 0, 64, 80 )
[sub_resource type="AtlasTexture" id=9] [sub_resource type="AtlasTexture" id=24]
atlas = ExtResource( 1 ) atlas = ExtResource( 3 )
region = Rect2( 64, 0, 64, 48 ) region = Rect2( 192, 0, 64, 80 )
[sub_resource type="AtlasTexture" id=10] [sub_resource type="AtlasTexture" id=22]
atlas = ExtResource( 1 ) atlas = ExtResource( 3 )
region = Rect2( 128, 0, 64, 48 ) region = Rect2( 64, 0, 64, 80 )
[sub_resource type="AtlasTexture" id=11] [sub_resource type="AtlasTexture" id=21]
atlas = ExtResource( 1 ) atlas = ExtResource( 3 )
region = Rect2( 192, 0, 64, 48 ) region = Rect2( 0, 0, 64, 80 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 1 )
region = Rect2( 256, 0, 64, 48 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 1 )
region = Rect2( 320, 0, 64, 48 )
[sub_resource type="AtlasTexture" id=14] [sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 4 ) atlas = ExtResource( 4 )
@@ -88,21 +80,29 @@ region = Rect2( 320, 0, 64, 64 )
atlas = ExtResource( 4 ) atlas = ExtResource( 4 )
region = Rect2( 384, 0, 64, 64 ) region = Rect2( 384, 0, 64, 64 )
[sub_resource type="AtlasTexture" id=23] [sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 3 ) atlas = ExtResource( 1 )
region = Rect2( 128, 0, 64, 80 ) region = Rect2( 0, 0, 64, 48 )
[sub_resource type="AtlasTexture" id=24] [sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 3 ) atlas = ExtResource( 1 )
region = Rect2( 192, 0, 64, 80 ) region = Rect2( 64, 0, 64, 48 )
[sub_resource type="AtlasTexture" id=22] [sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 3 ) atlas = ExtResource( 1 )
region = Rect2( 64, 0, 64, 80 ) region = Rect2( 128, 0, 64, 48 )
[sub_resource type="AtlasTexture" id=21] [sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 3 ) atlas = ExtResource( 1 )
region = Rect2( 0, 0, 64, 80 ) region = Rect2( 192, 0, 64, 48 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 1 )
region = Rect2( 256, 0, 64, 48 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 1 )
region = Rect2( 320, 0, 64, 48 )
[sub_resource type="SpriteFrames" id=25] [sub_resource type="SpriteFrames" id=25]
animations = [ { animations = [ {
@@ -111,9 +111,9 @@ animations = [ {
"name": "idle", "name": "idle",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ) ], "frames": [ SubResource( 23 ), SubResource( 24 ), SubResource( 22 ), SubResource( 21 ) ],
"loop": true, "loop": true,
"name": "appear", "name": "shriek",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ], "frames": [ SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ) ],
@@ -121,9 +121,9 @@ animations = [ {
"name": "vanish", "name": "vanish",
"speed": 5.0 "speed": 5.0
}, { }, {
"frames": [ SubResource( 23 ), SubResource( 24 ), SubResource( 22 ), SubResource( 21 ) ], "frames": [ SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ) ],
"loop": true, "loop": true,
"name": "shriek", "name": "appear",
"speed": 5.0 "speed": 5.0
} ] } ]
@@ -144,10 +144,10 @@ orbit_velocity_random = 0.0
color = Color( 0.729412, 0, 0, 1 ) color = Color( 0.729412, 0, 0, 1 )
hue_variation = 1.0 hue_variation = 1.0
[node name="KinematicBody2D" type="KinematicBody2D"] [node name="Ghost Enemy" type="KinematicBody2D"]
z_index = 2 z_index = 2
script = ExtResource( 5 ) script = ExtResource( 5 )
Fireball = ExtResource( 6 ) fireball = ExtResource( 6 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."] [node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 25 ) frames = SubResource( 25 )
@@ -165,9 +165,7 @@ shape = SubResource( 26 )
position = Vector2( 0.530334, 11.3032 ) position = Vector2( 0.530334, 11.3032 )
shape = SubResource( 27 ) shape = SubResource( 27 )
[node name="Hitbox" type="Area2D" parent="." groups=[ [node name="Hitbox" type="Area2D" parent="." groups=["enemy_hitbox_1"]]
"enemy_hitbox_1",
]]
light_mask = 0 light_mask = 0
collision_layer = 4 collision_layer = 4
collision_mask = 2 collision_mask = 2

View File

@@ -1,61 +0,0 @@
extends KinematicBody2D
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
export var Fireball: PackedScene
onready var player = null
var move = Vector2.ZERO
var SPEED = 50
var counter = 0
var velocity: Vector2 = Vector2.ZERO
var health: int = 4
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
self.visible = false
func _physics_process(delta):
velocity = Vector2.ZERO
if player and position.distance_to(player.position) > 1:
velocity = position.direction_to(player.position).normalized() * SPEED
velocity = move_and_slide(velocity)
func _on_Area2D_body_entered(body):
if body.is_in_group('player'):
player = body
if counter == 0:
self.visible = true
$AnimatedSprite.play("appear")
counter = 1
func _on_AnimatedSprite_animation_finished():
$AnimatedSprite.play("idle")
func _on_Hitbox_area_entered(area):
if area.is_in_group('player_weapon_1'):
health -= 1
elif area.is_in_group('player_weapon_2'):
health -= 2
if health <= 0:
$AnimatedSprite.play("vanish")
yield($AnimatedSprite, "animation_finished")
call_deferred('queue_free')
return
func _on_Projectile_Timer_timeout():
if player:
var projectile: Node = Fireball.instance()
projectile.init($AnimatedSprite.global_position, player.position)
get_tree().get_current_scene().get_node('Projectiles').add_child(projectile)
$AnimatedSprite.play("shriek")

View File

@@ -1,47 +1,49 @@
extends KinematicBody2D extends KinematicBody2D
onready var SNOWBALL_BLUE_SCENE = preload("res://Enemies/Snowball Blue.tscn") onready var SNOWBALL_BLUE_SCENE: Resource = preload('res://Enemies/Snowball Blue.tscn')
var player = null var player: KinematicBody2D = null
var move = Vector2.ZERO var velocity: Vector2 = Vector2.ZERO
var speed = .5 const SPEED: int = 50
var health: int = 2 var health: int = 2
func _physics_process(delta: float) -> void: func _physics_process(_delta: float) -> void:
move = Vector2.ZERO velocity = Vector2.ZERO
if player != null: if player and position.distance_to(player.position) > 1:
move = position.direction_to(player.position) * speed velocity = position.direction_to(player.position).normalized() * SPEED
else:
move = Vector2.ZERO
move = move.normalized()
move = move_and_collide(move)
velocity = move_and_slide(velocity)
return
func _on_Area2D_body_entered(body: Node) -> void: func _on_Area2D_body_entered(body: Node) -> void:
if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")): if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
player = body player = body
return
func _on_Area2D_body_exited(body: Node) -> void: func _on_Area2D_body_exited(body: Node) -> void:
if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")): if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
player = null player = null
return
func fire(): func fire() -> void:
var snowball = SNOWBALL_BLUE_SCENE.instance() var snowball = SNOWBALL_BLUE_SCENE.instance()
snowball.position = get_global_position() snowball.position = get_global_position()
snowball.player = player snowball.player = player
get_parent().add_child(snowball) get_parent().add_child(snowball)
$Timer.set_wait_time(1) $Timer.set_wait_time(1)
return
func _on_Timer_timeout() -> void: func _on_Timer_timeout() -> void:
if player != null: if player != null:
fire() fire()
return
func _on_player_detector_area_entered(area: Area2D) -> void: func _on_player_detector_area_entered(area: Area2D) -> void:
if area.get_parent().name == 'Player': if area.get_parent().name == 'Player':
@@ -49,10 +51,11 @@ func _on_player_detector_area_entered(area: Area2D) -> void:
return return
func _on_player_detector_area_exited(_area: Area2D): func _on_player_detector_area_exited(_area: Area2D) -> void:
player = null player = null
return return
func _on_hitbox_area_entered(area: Area2D) -> void: func _on_hitbox_area_entered(area: Area2D) -> void:
if area.is_in_group('player_weapon_1'): if area.is_in_group('player_weapon_1'):
health -= 1 health -= 1

View File

@@ -1,47 +1,48 @@
extends KinematicBody2D extends KinematicBody2D
onready var SNOWBALL_SCENE = preload("res://Enemies/Snowball.tscn") onready var SNOWBALL_SCENE: Resource = preload('res://Enemies/Snowball.tscn')
var player = null var player: KinematicBody2D = null
var move = Vector2.ZERO var velocity: Vector2 = Vector2.ZERO
var speed = .5 const SPEED: int = 50
var health: int = 2 var health: int = 2
func _physics_process(delta: float) -> void: func _physics_process(_delta: float) -> void:
move = Vector2.ZERO velocity = Vector2.ZERO
if player != null: if player and position.distance_to(player.position) > 1:
move = position.direction_to(player.position) * speed velocity = position.direction_to(player.position).normalized() * SPEED
else:
move = Vector2.ZERO
move = move.normalized()
move = move_and_collide(move)
velocity = move_and_slide(velocity)
return
func _on_Area2D_body_entered(body: Node) -> void: func _on_Area2D_body_entered(body: Node) -> void:
if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")): if body != self && !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
player = body player = body
return
func _on_Area2D_body_exited(body: Node) -> void: func _on_Area2D_body_exited(body: Node) -> void:
if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")): if !(body.name.begins_with("tree")) && !(body.name.begins_with("snowmen_enemy")) && !(body.name.begins_with("wall")):
player = null player = null
return
func fire(): func fire() -> void:
var snowball = SNOWBALL_SCENE.instance() var snowball = SNOWBALL_SCENE.instance()
snowball.position = get_global_position() snowball.position = get_global_position()
snowball.player = player snowball.player = player
get_parent().add_child(snowball) get_parent().add_child(snowball)
$Timer.set_wait_time(1) $Timer.set_wait_time(1)
return
func _on_Timer_timeout() -> void: func _on_Timer_timeout() -> void:
if player != null: if player != null:
fire() fire()
return
func _on_player_detector_area_entered(area: Area2D) -> void: func _on_player_detector_area_entered(area: Area2D) -> void:
@@ -50,12 +51,12 @@ func _on_player_detector_area_entered(area: Area2D) -> void:
return return
func _on_player_detector_area_exited(_area: Area2D): func _on_player_detector_area_exited(_area: Area2D) -> void:
player = null player = null
return return
func _on_hitbox_area_entered(area: Area2D) -> void: func _on_hitbox_area_entered(area: Area2D) -> void:
print("HIT")
if area.is_in_group('player_weapon_1'): if area.is_in_group('player_weapon_1'):
health -= 1 health -= 1
elif area.is_in_group('player_weapon_2'): elif area.is_in_group('player_weapon_2'):

View File

@@ -1,6 +1,6 @@
extends Label extends Label
signal timer_end signal timer_out
func _process(_delta: float) -> void: func _process(_delta: float) -> void:
@@ -8,5 +8,5 @@ func _process(_delta: float) -> void:
set_text('%02d:%02d' % [time_seconds, int(($Timer.get_time_left() - time_seconds) * 100)]) set_text('%02d:%02d' % [time_seconds, int(($Timer.get_time_left() - time_seconds) * 100)])
if $Timer.get_time_left() == 0: if $Timer.get_time_left() == 0:
get_tree().change_scene('res://Levels/Hub World.tscn') emit_signal('timer_out')
return return

35
GUI/Credits.gd Normal file
View File

@@ -0,0 +1,35 @@
extends CanvasLayer
export var credits_path: String = 'res://credits.txt'
func _ready() -> void:
_load_credits()
return
func _load_credits() -> void:
var credits_file: File = File.new()
assert(credits_file.file_exists(credits_path), 'Credits file does not exist')
assert(credits_file.open(credits_path, File.READ) == OK, 'Credits file failed to open')
while not credits_file.eof_reached():
var line: String = credits_file.get_line()
if line == '':
continue
var label: Label = Label.new()
label.set_custom_minimum_size(Vector2(3200, 0))
label.set_align(Label.ALIGN_CENTER)
label.set_valign(Label.VALIGN_CENTER)
label.set_autowrap(true)
label.set_text(line)
$'Credits/Credits Items'.add_child(label)
credits_file.close()
return
func _input(event: InputEvent) -> void:
if event.is_action_pressed('ui_cancel'):
queue_free()
return

43
GUI/Credits.tscn Normal file
View File

@@ -0,0 +1,43 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1]
[ext_resource path="res://GUI/Credits.gd" type="Script" id=2]
[ext_resource path="res://Fonts/TheLittleBonjour.ttf" type="DynamicFontData" id=3]
[sub_resource type="DynamicFont" id=1]
size = 60
extra_spacing_top = 30
extra_spacing_bottom = 30
extra_spacing_char = 2
font_data = ExtResource( 3 )
[sub_resource type="Theme" id=2]
default_font = SubResource( 1 )
[node name="Credits" type="CanvasLayer"]
script = ExtResource( 2 )
[node name="Background" type="TextureRect" parent="."]
light_mask = 0
margin_right = 40.0
margin_bottom = 40.0
rect_min_size = Vector2( 320, 180 )
texture = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Credits" type="ScrollContainer" parent="."]
rect_min_size = Vector2( 3200, 1800 )
rect_scale = Vector2( 0.1, 0.1 )
scroll_horizontal_enabled = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Credits Items" type="VBoxContainer" parent="Credits"]
light_mask = 0
margin_right = 3200.0
margin_bottom = 1800.0
rect_min_size = Vector2( 3200, 1800 )
theme = SubResource( 2 )

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=15 format=2] [gd_scene load_steps=16 format=2]
[ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1] [ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1]
[ext_resource path="res://GUI/Level Ending.gd" type="Script" id=2] [ext_resource path="res://GUI/Level Ending.gd" type="Script" id=2]
[ext_resource path="res://Resources/Ash.tres" type="DynamicFontData" id=3] [ext_resource path="res://Resources/Ash.tres" type="DynamicFontData" id=3]
[ext_resource path="res://Sprites/Assets/Smol_P.png" type="Texture" id=4] [ext_resource path="res://Sprites/Assets/Smol_P.png" type="Texture" id=4]
[ext_resource path="res://Music/Level_Complete.mp3" type="AudioStream" id=5]
[sub_resource type="DynamicFont" id=1] [sub_resource type="DynamicFont" id=1]
font_data = ExtResource( 3 ) font_data = ExtResource( 3 )
@@ -82,6 +83,7 @@ __meta__ = {
[node name="AnimatedSprite" type="AnimatedSprite" parent="."] [node name="AnimatedSprite" type="AnimatedSprite" parent="."]
position = Vector2( 160, 120 ) position = Vector2( 160, 120 )
frames = SubResource( 10 ) frames = SubResource( 10 )
frame = 6
playing = true playing = true
[node name="Timer" type="Timer" parent="."] [node name="Timer" type="Timer" parent="."]
@@ -89,4 +91,9 @@ wait_time = 4.0
one_shot = true one_shot = true
autostart = true autostart = true
[node name="BGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 5 )
volume_db = -10.0
autoplay = true
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] [connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View File

@@ -1,9 +1,10 @@
[gd_scene load_steps=15 format=2] [gd_scene load_steps=16 format=2]
[ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1] [ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1]
[ext_resource path="res://GUI/Level Ending.gd" type="Script" id=2] [ext_resource path="res://GUI/Level Ending.gd" type="Script" id=2]
[ext_resource path="res://Resources/Ash.tres" type="DynamicFontData" id=3] [ext_resource path="res://Resources/Ash.tres" type="DynamicFontData" id=3]
[ext_resource path="res://Sprites/Assets/Smol_P.png" type="Texture" id=4] [ext_resource path="res://Sprites/Assets/Smol_P.png" type="Texture" id=4]
[ext_resource path="res://Music/Level_Failed.wav" type="AudioStream" id=5]
[sub_resource type="DynamicFont" id=1] [sub_resource type="DynamicFont" id=1]
font_data = ExtResource( 3 ) font_data = ExtResource( 3 )
@@ -82,7 +83,7 @@ __meta__ = {
[node name="AnimatedSprite" type="AnimatedSprite" parent="."] [node name="AnimatedSprite" type="AnimatedSprite" parent="."]
position = Vector2( 160, 120 ) position = Vector2( 160, 120 )
frames = SubResource( 10 ) frames = SubResource( 10 )
frame = 7 frame = 5
playing = true playing = true
[node name="Timer" type="Timer" parent="."] [node name="Timer" type="Timer" parent="."]
@@ -90,4 +91,9 @@ wait_time = 4.0
one_shot = true one_shot = true
autostart = true autostart = true
[node name="BGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 5 )
volume_db = -10.0
autoplay = true
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] [connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View File

@@ -2,12 +2,20 @@ extends CanvasLayer
signal complete(option) signal complete(option)
export var credits_scene_path: String = 'res://GUI/Credits.tscn'
func _on_new_game_button_pressed() -> void: func _on_new_game_button_pressed() -> void:
emit_signal('complete', 'new game') emit_signal('complete', 'new game')
return return
func _on_credits_button_pressed() -> void:
var credits_scene: Node = load(credits_scene_path).instance()
add_child(credits_scene)
return
func _on_quit_button_pressed() -> void: func _on_quit_button_pressed() -> void:
get_tree().quit() get_tree().quit()
return return

View File

@@ -139,5 +139,6 @@ volume_db = -16.0
[connection signal="pressed" from="Menu/Menu Elements/Menu Options/New Game/New Game Button" to="." method="_on_new_game_button_pressed"] [connection signal="pressed" from="Menu/Menu Elements/Menu Options/New Game/New Game Button" to="." method="_on_new_game_button_pressed"]
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Settings/Settings Button" to="." method="_on_settings_button_mouse_entered"] [connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Settings/Settings Button" to="." method="_on_settings_button_mouse_entered"]
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Credits/Credits Button" to="." method="_on_credits_button_mouse_entered"] [connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Credits/Credits Button" to="." method="_on_credits_button_mouse_entered"]
[connection signal="pressed" from="Menu/Menu Elements/Menu Options/Credits/Credits Button" to="." method="_on_credits_button_pressed"]
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_mouse_entered"] [connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_mouse_entered"]
[connection signal="pressed" from="Menu/Menu Elements/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_pressed"] [connection signal="pressed" from="Menu/Menu Elements/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_pressed"]

View File

@@ -1,21 +0,0 @@
extends Area2D
onready var portal = get_node("../PortalDarkForest")
onready var shape = portal.get_child(0)
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
shape.set_deferred("disabled",true)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
func _on_ChestDetection_body_entered(body: Node) -> void:
shape.set_deferred("disabled",false)

View File

@@ -1,25 +1,13 @@
extends Camera2D extends Camera2D
signal enter_portal
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time. func _on_PortalDarkForest_body_entered(_body: Node) -> void:
func _ready() -> void: limit_bottom = -224
pass # Replace with function body. limit_top = -736
limit_left = -32
limit_right = 448
# Called every frame. 'delta' is the elapsed time since the previous frame. get_parent().position = Vector2(256, -232)
#func _process(delta: float) -> void: emit_signal('enter_portal')
# pass return
func _on_PortalDarkForest_body_entered(body: Node) -> void:
self.limit_bottom = -224
self.limit_top = -736
self.limit_left = -32
self.limit_right = 448
var player = get_parent()
player.position = Vector2(256,-232)

15
Levels/Chest Detection.gd Normal file
View File

@@ -0,0 +1,15 @@
extends Area2D
onready var portal = get_node('../PortalDarkForest')
onready var shape = portal.get_child(0)
func _ready() -> void:
shape.set_deferred('disabled', true)
return
func _on_chest_detection_body_entered(body: Node) -> void:
if body.is_in_group('player'):
shape.set_deferred('disabled', false)
return

6
Levels/Collectible.gd Normal file
View File

@@ -0,0 +1,6 @@
extends Node2D
var dialog = get_parent().get_node('HUD/Control')
func _on_Area2D_body_entered(body):
dialog.visible = true

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=2] [gd_scene load_steps=12 format=2]
[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1] [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://Levels/Hub World.gd" type="Script" id=2]
@@ -7,6 +7,7 @@
[ext_resource path="res://Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png" type="Texture" id=5] [ext_resource path="res://Sprites/Levels/Tilesets/Hub_World_Grass_Atlas.png" type="Texture" id=5]
[ext_resource path="res://Sprites/Assets/Black_Tile.png" type="Texture" id=6] [ext_resource path="res://Sprites/Assets/Black_Tile.png" type="Texture" id=6]
[ext_resource path="res://Levels/Interactables/Level Portal.tscn" type="PackedScene" id=7] [ext_resource path="res://Levels/Interactables/Level Portal.tscn" type="PackedScene" id=7]
[ext_resource path="res://Music/Hub_World.mp3" type="AudioStream" id=8]
[sub_resource type="ConvexPolygonShape2D" id=2] [sub_resource type="ConvexPolygonShape2D" id=2]
points = PoolVector2Array( 0, 0, 2, 0, 2, 2, 0, 2 ) points = PoolVector2Array( 0, 0, 2, 0, 2, 2, 0, 2 )
@@ -125,3 +126,8 @@ level_path = "res://Levels/Level 5.tscn"
[node name="Pause Screen" parent="." instance=ExtResource( 4 )] [node name="Pause Screen" parent="." instance=ExtResource( 4 )]
disable_back_to_hub = true disable_back_to_hub = true
[node name="BGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 )
volume_db = -10.0
autoplay = true

View File

@@ -3,8 +3,8 @@ extends Area2D
signal coin_grabbed signal coin_grabbed
func _on_Node2D_body_entered(body: Node) -> void: func _on_coin_body_entered(body: Node) -> void:
if body.get_name() == 'Player': if body.is_in_group('player'):
emit_signal("coin_grabbed") emit_signal('coin_grabbed')
print("coin!") call_deferred('queue_free')
queue_free() return

View File

@@ -6,7 +6,7 @@
[sub_resource type="CircleShape2D" id=1] [sub_resource type="CircleShape2D" id=1]
radius = 6.38067 radius = 6.38067
[node name="coin" type="Area2D"] [node name="Coin" type="Area2D"]
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."] [node name="Sprite" type="Sprite" parent="."]
@@ -16,4 +16,4 @@ texture = ExtResource( 2 )
[node name="coin" type="CollisionShape2D" parent="."] [node name="coin" type="CollisionShape2D" parent="."]
shape = SubResource( 1 ) shape = SubResource( 1 )
[connection signal="body_entered" from="." to="." method="_on_Node2D_body_entered"] [connection signal="body_entered" from="." to="." method="_on_coin_body_entered"]

View File

@@ -1,24 +1,11 @@
extends Node2D extends Node2D
# Declare member variables here. Examples: func _on_AnimationPlayer_animation_finished(_anim_name: String) -> void:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
func _on_AnimationPlayer_animation_finished(anim_name: String) -> void:
$GemSprite.visible = false $GemSprite.visible = false
return
func _on_AnimationPlayer_animation_started(anim_name: String) -> void: func _on_AnimationPlayer_animation_started(_anim_name: String) -> void:
$GemSprite.visible = true $GemSprite.visible = true
return

15
Levels/Journal Scrap.tscn Normal file
View File

@@ -0,0 +1,15 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Sprites/Assets/JournalScrap.png" type="Texture" id=1]
[sub_resource type="RectangleShape2D" id=1]
[node name="Node2D" type="Node2D"]
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )
[node name="Area2D" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource( 1 )

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=9 format=2]
[ext_resource path="res://Sprites/Assets/galaxy_background.png" type="Texture" id=1] [ext_resource path="res://Sprites/Assets/galaxy_background.png" type="Texture" id=1]
[ext_resource path="res://GUI/HUD.tscn" type="PackedScene" id=2] [ext_resource path="res://GUI/HUD.tscn" type="PackedScene" id=2]
@@ -7,6 +7,7 @@
[ext_resource path="res://Levels/Level 1.gd" type="Script" id=5] [ext_resource path="res://Levels/Level 1.gd" type="Script" id=5]
[ext_resource path="res://Enemies/Dark Matter.tscn" type="PackedScene" id=6] [ext_resource path="res://Enemies/Dark Matter.tscn" type="PackedScene" id=6]
[ext_resource path="res://Levels/Interactables/Star.tscn" type="PackedScene" id=7] [ext_resource path="res://Levels/Interactables/Star.tscn" type="PackedScene" id=7]
[ext_resource path="res://Music/Level_1.mp3" type="AudioStream" id=8]
[node name="Space Level" type="Node2D"] [node name="Space Level" type="Node2D"]
script = ExtResource( 5 ) script = ExtResource( 5 )
@@ -73,6 +74,11 @@ mode = 1
build_mode = 1 build_mode = 1
polygon = PoolVector2Array( 0.762451, -22.0982, 427.859, -18.7308, 425.053, 245.609, -22.248, 248.976, -21.1256, -22.6594, -0.589813, -21.9661, -0.589806, 225.272, 400.359, 224.843, 399.969, -0.312477, 0.455406, -0.154987 ) polygon = PoolVector2Array( 0.762451, -22.0982, 427.859, -18.7308, 425.053, 245.609, -22.248, 248.976, -21.1256, -22.6594, -0.589813, -21.9661, -0.589806, 225.272, 400.359, 224.843, 399.969, -0.312477, 0.455406, -0.154987 )
[node name="BGM" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 )
volume_db = -7.0
autoplay = true
[connection signal="death" from="YSort/Enemies/Dark Matter" to="." method="_on_dark_matter_death"] [connection signal="death" from="YSort/Enemies/Dark Matter" to="." method="_on_dark_matter_death"]
[connection signal="death" from="YSort/Enemies/Dark Matter2" to="." method="_on_dark_matter_death"] [connection signal="death" from="YSort/Enemies/Dark Matter2" to="." method="_on_dark_matter_death"]
[connection signal="death" from="YSort/Enemies/Dark Matter3" to="." method="_on_dark_matter_death"] [connection signal="death" from="YSort/Enemies/Dark Matter3" to="." method="_on_dark_matter_death"]

View File

@@ -1,7 +1,18 @@
extends Node2D extends Node2D
func _ready() -> void: func _ready() -> void:
#$YSort/Player.position = get_viewport_rect().size / 2
$YSort/Player.position = Vector2(0,0)
$YSort/Player.load_hud($HUD) $YSort/Player.load_hud($HUD)
return return
func _on_journal_page_body_entered(body: Node) -> void:
if body.is_in_group('player'):
$'HUD/Journal Page Dialogue'.visible = true
return
func _on_Camera2D_enter_portal() -> void:
$BGM1.stop()
$BGM2.play()
return

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=85 format=2] [gd_scene load_steps=91 format=2]
[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1] [ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://Levels/Level 2.gd" type="Script" id=2] [ext_resource path="res://Levels/Level 2.gd" type="Script" id=2]
@@ -8,15 +8,20 @@
[ext_resource path="res://Levels/Objects/Chest.tscn" type="PackedScene" id=6] [ext_resource path="res://Levels/Objects/Chest.tscn" type="PackedScene" id=6]
[ext_resource path="res://Sprites/Assets/cliffTileset.png" type="Texture" id=7] [ext_resource path="res://Sprites/Assets/cliffTileset.png" type="Texture" id=7]
[ext_resource path="res://GUI/HUD.tscn" type="PackedScene" id=8] [ext_resource path="res://GUI/HUD.tscn" type="PackedScene" id=8]
[ext_resource path="res://Enemies/Ghost_Enemy.tscn" type="PackedScene" id=9] [ext_resource path="res://Enemies/Ghost Enemy.tscn" type="PackedScene" id=9]
[ext_resource path="res://Sprites/Assets/DeadTree.png" type="Texture" id=10] [ext_resource path="res://Sprites/Assets/DeadTree.png" type="Texture" id=10]
[ext_resource path="res://Sprites/Assets/darkForestTileset.png" type="Texture" id=11] [ext_resource path="res://Sprites/Assets/darkForestTileset.png" type="Texture" id=11]
[ext_resource path="res://Levels/Area2D.gd" type="Script" id=12] [ext_resource path="res://Levels/Chest Detection.gd" type="Script" id=12]
[ext_resource path="res://Levels/Camera2D.gd" type="Script" id=13] [ext_resource path="res://Levels/Camera2D.gd" type="Script" id=13]
[ext_resource path="res://Sprites/Assets/Shadow.png" type="Texture" id=14] [ext_resource path="res://Sprites/Assets/Shadow.png" type="Texture" id=14]
[ext_resource path="res://Levels/Traps/Spawn Trap.tscn" type="PackedScene" id=15] [ext_resource path="res://Levels/Traps/Spawn Trap.tscn" type="PackedScene" id=15]
[ext_resource path="res://Sprites/Assets/Skull.png" type="Texture" id=16] [ext_resource path="res://Sprites/Assets/Skull.png" type="Texture" id=16]
[ext_resource path="res://Sprites/Assets/grassPatch.png" type="Texture" id=17] [ext_resource path="res://Sprites/Assets/grassPatch.png" type="Texture" id=17]
[ext_resource path="res://Sprites/Assets/JournalScrap.png" type="Texture" id=18]
[ext_resource path="res://Levels/Objects/Dialogue.tscn" type="PackedScene" id=19]
[ext_resource path="res://Music/Level_2_2.mp3" type="AudioStream" id=20]
[ext_resource path="res://Music/Level_2_1.mp3" type="AudioStream" id=21]
[ext_resource path="res://Levels/Portal Dark Forest.gd" type="Script" id=22]
[sub_resource type="TileSet" id=1] [sub_resource type="TileSet" id=1]
0/name = "darkForestTileset.png 0" 0/name = "darkForestTileset.png 0"
@@ -767,6 +772,8 @@ points = PoolVector2Array( 34.2487, 55.6436, 7.92332, 55.4821, 14.222, 39.5738,
8/shapes = [ ] 8/shapes = [ ]
8/z_index = 0 8/z_index = 0
[sub_resource type="RectangleShape2D" id=68]
[sub_resource type="RectangleShape2D" id=65] [sub_resource type="RectangleShape2D" id=65]
[sub_resource type="CapsuleShape2D" id=66] [sub_resource type="CapsuleShape2D" id=66]
@@ -882,27 +889,35 @@ format = 1
tile_data = PoolIntArray( -2883568, 6, 0, -2818047, 6, 0, -2818023, 6, 0, -2752509, 6, 0, -2752505, 6, 0, -2752501, 6, 0, -2686971, 6, 0, -2686967, 6, 0, -2686953, 6, 0, -2686952, 6, 0, -2621440, 6, 0, -2555884, 6, 0, -2490345, 6, 0, -2359285, 3, 2, -2359274, 3, 2, -2293753, 3, 1, -2293745, 6, 0, -2293741, 6, 0, -2162686, 6, 0, -1966061, 6, 0, -1966055, 6, 0, -1900544, 3, 2, -1900518, 3, 2, -1834988, 6, 0, -1834986, 6, 0, -1769466, 6, 0, -1769453, 6, 0, -1769450, 6, 0, -1703932, 6, 0, -1703930, 6, 0, -1703915, 6, 0, -1638400, 6, 0, -1572858, 6, 0, -1572838, 3, 2, -1507308, 6, 0, -1441790, 6, 0, -1441788, 6, 0, -1441782, 3, 1, -1441771, 6, 0, -1376253, 6, 0, -1376233, 6, 0, -1245184, 3, 2, -1245182, 6, 0, -1245177, 6, 0, -1179630, 6, 0, -1114090, 3, 2, -851962, 3, 2, -851959, 3, 131072, -786431, 3, 0, -786420, 3, 65537, -720877, 1, 0, -655358, 1, 0, -655356, 1, 0, -655354, 1, 0, -655352, 1, 0, -524290, 1, 0, -589821, 1, 0, -589818, 1, 0, -589802, 3, 65537, -524287, 3, 131072, -393217, 1, 0, -458751, 1, 0, -458730, 3, 1, -327684, 3, 2, -393216, 1, 0, -393211, 1, 0, -393199, 1, 0, -393195, 3, 65538, -262146, 3, 65537, -327677, 1, 0, -327665, 1, 0, -196611, 3, 65538, -262144, 1, 0, -262142, 1, 0, -262139, 1, 0, -262127, 1, 0, -262125, 1, 0, -196593, 3, 131072, -131057, 1, 0, -131054, 1, 0, -65527, 3, 0, -65523, 3, 65537, -65514, 3, 0, 2, 1, 0, 11, 3, 65536, 17, 1, 0, 65536, 1, 0, 65537, 3, 1, 65540, 1, 0, 65551, 1, 0, 65552, 3, 65538, 65555, 1, 0, 131074, 1, 0, 131082, 1, 0, 131089, 1, 0, 196608, 1, 0, 196614, 3, 65536, 196616, 1, 0, 196630, 3, 131072, 262147, 3, 0, 262153, 0, 4, 393214, 3, 65536, 327682, 0, 3, 327687, 0, 3, 327688, 0, 131074, 327689, 0, 65536, 327692, 3, 131073, 458751, 3, 2, 393217, 0, 3, 393218, 0, 131074, 393222, 0, 131073, 393223, 0, 131074, 393224, 0, 0, 393225, 0, 65540, 393233, 3, 131074, 393238, 3, 1, 458753, 1, 0, 458754, 0, 1, 458755, 1, 0, 458757, 1, 0, 458758, 0, 1, 458759, 0, 1, 458760, 0, 65540, 458761, 3, 2, 458773, 3, 65537, 524288, 1, 0, 524291, 0, 65539, 524292, 0, 65540, 524295, 3, 131072, 524303, 3, 2, 524305, 1, 0, 524308, 3, 2, 589828, 1, 0, 589830, 1, 0, 720894, 3, 131074, 655360, 1, 0, 655361, 3, 65536, 655368, 3, 65537, 655382, 3, 1, 786434, 3, 1, 786438, 3, 0, 786440, 3, 65536, 786443, 3, 0, 786445, 3, 65537, 786453, 3, 65538, 851974, 3, 2 ) tile_data = PoolIntArray( -2883568, 6, 0, -2818047, 6, 0, -2818023, 6, 0, -2752509, 6, 0, -2752505, 6, 0, -2752501, 6, 0, -2686971, 6, 0, -2686967, 6, 0, -2686953, 6, 0, -2686952, 6, 0, -2621440, 6, 0, -2555884, 6, 0, -2490345, 6, 0, -2359285, 3, 2, -2359274, 3, 2, -2293753, 3, 1, -2293745, 6, 0, -2293741, 6, 0, -2162686, 6, 0, -1966061, 6, 0, -1966055, 6, 0, -1900544, 3, 2, -1900518, 3, 2, -1834988, 6, 0, -1834986, 6, 0, -1769466, 6, 0, -1769453, 6, 0, -1769450, 6, 0, -1703932, 6, 0, -1703930, 6, 0, -1703915, 6, 0, -1638400, 6, 0, -1572858, 6, 0, -1572838, 3, 2, -1507308, 6, 0, -1441790, 6, 0, -1441788, 6, 0, -1441782, 3, 1, -1441771, 6, 0, -1376253, 6, 0, -1376233, 6, 0, -1245184, 3, 2, -1245182, 6, 0, -1245177, 6, 0, -1179630, 6, 0, -1114090, 3, 2, -851962, 3, 2, -851959, 3, 131072, -786431, 3, 0, -786420, 3, 65537, -720877, 1, 0, -655358, 1, 0, -655356, 1, 0, -655354, 1, 0, -655352, 1, 0, -524290, 1, 0, -589821, 1, 0, -589818, 1, 0, -589802, 3, 65537, -524287, 3, 131072, -393217, 1, 0, -458751, 1, 0, -458730, 3, 1, -327684, 3, 2, -393216, 1, 0, -393211, 1, 0, -393199, 1, 0, -393195, 3, 65538, -262146, 3, 65537, -327677, 1, 0, -327665, 1, 0, -196611, 3, 65538, -262144, 1, 0, -262142, 1, 0, -262139, 1, 0, -262127, 1, 0, -262125, 1, 0, -196593, 3, 131072, -131057, 1, 0, -131054, 1, 0, -65527, 3, 0, -65523, 3, 65537, -65514, 3, 0, 2, 1, 0, 11, 3, 65536, 17, 1, 0, 65536, 1, 0, 65537, 3, 1, 65540, 1, 0, 65551, 1, 0, 65552, 3, 65538, 65555, 1, 0, 131074, 1, 0, 131082, 1, 0, 131089, 1, 0, 196608, 1, 0, 196614, 3, 65536, 196616, 1, 0, 196630, 3, 131072, 262147, 3, 0, 262153, 0, 4, 393214, 3, 65536, 327682, 0, 3, 327687, 0, 3, 327688, 0, 131074, 327689, 0, 65536, 327692, 3, 131073, 458751, 3, 2, 393217, 0, 3, 393218, 0, 131074, 393222, 0, 131073, 393223, 0, 131074, 393224, 0, 0, 393225, 0, 65540, 393233, 3, 131074, 393238, 3, 1, 458753, 1, 0, 458754, 0, 1, 458755, 1, 0, 458757, 1, 0, 458758, 0, 1, 458759, 0, 1, 458760, 0, 65540, 458761, 3, 2, 458773, 3, 65537, 524288, 1, 0, 524291, 0, 65539, 524292, 0, 65540, 524295, 3, 131072, 524303, 3, 2, 524305, 1, 0, 524308, 3, 2, 589828, 1, 0, 589830, 1, 0, 720894, 3, 131074, 655360, 1, 0, 655361, 3, 65536, 655368, 3, 65537, 655382, 3, 1, 786434, 3, 1, 786438, 3, 0, 786440, 3, 65536, 786443, 3, 0, 786445, 3, 65537, 786453, 3, 65538, 851974, 3, 2 )
[node name="Collectible" type="Node2D" parent="."] [node name="Collectible" type="Node2D" parent="."]
position = Vector2( 350, 0 )
scale = Vector2( 0.5, 0.5 )
z_index = 4
[node name="Journal Scrap" type="Sprite" parent="Collectible"] [node name="Journal Page" type="Area2D" parent="Collectible"]
collision_layer = 3
collision_mask = 3
[node name="HUD" parent="." instance=ExtResource( 8 )] [node name="Sprite" type="Sprite" parent="Collectible/Journal Page"]
texture = ExtResource( 18 )
[node name="Pause Screen" parent="." instance=ExtResource( 5 )] [node name="CollisionShape2D" type="CollisionShape2D" parent="Collectible/Journal Page"]
shape = SubResource( 68 )
[node name="TreasureChest" parent="." instance=ExtResource( 6 )] [node name="TreasureChest" parent="." instance=ExtResource( 6 )]
position = Vector2( 54, 170 ) position = Vector2( 54, 170 )
scale = Vector2( 0.5, 0.5 ) scale = Vector2( 0.5, 0.5 )
object_scene = ExtResource( 6 ) object_scene = ExtResource( 6 )
[node name="ChestDetection" type="Area2D" parent="TreasureChest"] [node name="Chest Detection" type="Area2D" parent="TreasureChest"]
script = ExtResource( 12 ) script = ExtResource( 12 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="TreasureChest/ChestDetection"] [node name="CollisionShape2D" type="CollisionShape2D" parent="TreasureChest/Chest Detection"]
position = Vector2( -1.78381, -1.75043 ) position = Vector2( -1.78381, -1.75043 )
scale = Vector2( 3.08, 1.96 ) scale = Vector2( 3.08, 1.96 )
shape = SubResource( 65 ) shape = SubResource( 65 )
[node name="PortalDarkForest" type="Area2D" parent="TreasureChest"] [node name="PortalDarkForest" type="Area2D" parent="TreasureChest"]
script = ExtResource( 22 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="TreasureChest/PortalDarkForest"] [node name="CollisionShape2D" type="CollisionShape2D" parent="TreasureChest/PortalDarkForest"]
position = Vector2( 402.642, -712.75 ) position = Vector2( 402.642, -712.75 )
@@ -914,6 +929,7 @@ shape = SubResource( 66 )
[node name="Spawn Trap" parent="Traps" instance=ExtResource( 15 )] [node name="Spawn Trap" parent="Traps" instance=ExtResource( 15 )]
position = Vector2( 296.416, -364.541 ) position = Vector2( 296.416, -364.541 )
enemy_path = "res://Enemies/Ghost Enemy.tscn"
[node name="Skull" type="TileMap" parent="."] [node name="Skull" type="TileMap" parent="."]
modulate = Color( 0.658824, 0.658824, 0.658824, 1 ) modulate = Color( 0.658824, 0.658824, 0.658824, 1 )
@@ -922,5 +938,23 @@ tile_set = SubResource( 67 )
format = 1 format = 1
tile_data = PoolIntArray( -589828, 0, 0, -458754, 0, 0, -393220, 0, 0 ) tile_data = PoolIntArray( -589828, 0, 0, -458754, 0, 0, -393220, 0, 0 )
[connection signal="body_entered" from="TreasureChest/ChestDetection" to="TreasureChest/ChestDetection" method="_on_ChestDetection_body_entered"] [node name="HUD" parent="." instance=ExtResource( 8 )]
[node name="Journal Page Dialogue" parent="HUD" instance=ExtResource( 19 )]
visible = false
[node name="Pause Screen" parent="." instance=ExtResource( 5 )]
[node name="BGM1" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 21 )
volume_db = -10.0
autoplay = true
[node name="BGM2" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 20 )
volume_db = -10.0
[connection signal="enter_portal" from="YSort/Player/Camera2D" to="." method="_on_Camera2D_enter_portal"]
[connection signal="body_entered" from="Collectible/Journal Page" to="." method="_on_journal_page_body_entered"]
[connection signal="body_entered" from="TreasureChest/Chest Detection" to="TreasureChest/Chest Detection" method="_on_chest_detection_body_entered"]
[connection signal="body_entered" from="TreasureChest/PortalDarkForest" to="YSort/Player/Camera2D" method="_on_PortalDarkForest_body_entered"] [connection signal="body_entered" from="TreasureChest/PortalDarkForest" to="YSort/Player/Camera2D" method="_on_PortalDarkForest_body_entered"]

View File

@@ -1,9 +1,9 @@
extends Node2D extends Node2D
onready var coin = preload('res://Levels/Interactables/Coin.tscn') onready var coin: Resource = preload('res://Levels/Interactables/Coin.tscn')
var screensize var screensize: Vector2
var score = 0 var score: int = 0
func _ready() -> void: func _ready() -> void:
@@ -17,7 +17,8 @@ func spawn_coins(num: int) -> void:
for _i in range(num): for _i in range(num):
var g: Node = coin.instance() var g: Node = coin.instance()
$'coin_container'.add_child(g) $'coin_container'.add_child(g)
g.connect('coin_grabbed', self, '_on_coin_grabbed') if g.connect('coin_grabbed', self, '_on_coin_grabbed') != OK:
print('ERROR: Coin "coin_grabbed" signal already connected.')
#g.set_pos(Vector2(rand_range(0, screensize.x - 40), rand_range(0, screensize.y - 40))) #g.set_pos(Vector2(rand_range(0, screensize.x - 40), rand_range(0, screensize.y - 40)))
g.position = Vector2(rand_range(0, screensize.x - 40), rand_range(0, screensize.y - 40)) g.position = Vector2(rand_range(0, screensize.x - 40), rand_range(0, screensize.y - 40))
return return
@@ -25,13 +26,13 @@ func spawn_coins(num: int) -> void:
func _on_coin_grabbed() -> void: func _on_coin_grabbed() -> void:
score += 1 score += 1
print(score)
$'Level 3 HUD/Label'.set_text(str(score) + '/5') $'Level 3 HUD/Label'.set_text(str(score) + '/5')
return return
func _timer_out() -> void: func _timer_out() -> void:
get_tree().change_scene('res://Levels/Hub World.tscn') if get_tree().change_scene('res://GUI/Level Failed.tscn') != OK:
print('ERROR: Level 3 failed to change scene to Level Failed.')
queue_free() queue_free()
return return
@@ -43,15 +44,9 @@ func _on_TreasureChest_ice_key_collected() -> void:
return return
func _on_DoorDetector_body_entered(body: Node) -> void:
if body.is_in_group('player'):
print('WIN WIN WIN')
get_tree().change_scene('res://Levels/Hub World.tscn')
return
func _on_DoorDetector_area_entered(area: Area2D) -> void: func _on_DoorDetector_area_entered(area: Area2D) -> void:
if area.get_parent().name == 'Player': if area.get_parent().name == 'Player':
get_tree().change_scene('res://GUI/Level Complete.tscn') if get_tree().change_scene('res://GUI/Level Complete.tscn') != OK:
print('ERROR: Level 3 failed to change scene to Level Complete.')
queue_free() queue_free()
return return

View File

@@ -127,31 +127,23 @@ position = Vector2( 250.562, 86.6365 )
[node name="Enemies" type="YSort" parent="YSort"] [node name="Enemies" type="YSort" parent="YSort"]
[node name="Snowman 1" parent="YSort/Enemies" groups=[ [node name="Snowman 1" parent="YSort/Enemies" groups=["enemies"] instance=ExtResource( 4 )]
"enemies",
] instance=ExtResource( 4 )]
position = Vector2( 268.977, 221.859 ) position = Vector2( 268.977, 221.859 )
collision_layer = 4 collision_layer = 4
collision_mask = 5 collision_mask = 5
[node name="Snowman 2" parent="YSort/Enemies" groups=[ [node name="Snowman 2" parent="YSort/Enemies" groups=["enemies"] instance=ExtResource( 4 )]
"enemies",
] instance=ExtResource( 4 )]
position = Vector2( 124.417, 123.977 ) position = Vector2( 124.417, 123.977 )
collision_layer = 4 collision_layer = 4
collision_mask = 5 collision_mask = 5
[node name="Blue Snowman 1" parent="YSort/Enemies" groups=[ [node name="Blue Snowman 1" parent="YSort/Enemies" groups=["enemies"] instance=ExtResource( 6 )]
"enemies",
] instance=ExtResource( 6 )]
position = Vector2( 252.747, 40.9419 ) position = Vector2( 252.747, 40.9419 )
collision_layer = 4 collision_layer = 4
collision_mask = 5 collision_mask = 5
script = ExtResource( 7 ) script = ExtResource( 7 )
[node name="Blue Snowman 2" parent="YSort/Enemies" groups=[ [node name="Blue Snowman 2" parent="YSort/Enemies" groups=["enemies"] instance=ExtResource( 6 )]
"enemies",
] instance=ExtResource( 6 )]
position = Vector2( 105.053, 195.4 ) position = Vector2( 105.053, 195.4 )
collision_layer = 4 collision_layer = 4
collision_mask = 5 collision_mask = 5
@@ -233,3 +225,4 @@ autoplay = true
[connection signal="ice_key_collected" from="YSort/TreasureChest" to="." method="_on_TreasureChest_ice_key_collected"] [connection signal="ice_key_collected" from="YSort/TreasureChest" to="." method="_on_TreasureChest_ice_key_collected"]
[connection signal="frozen" from="YSort/Player" to="Effects/SlowTime" method="start"] [connection signal="frozen" from="YSort/Player" to="Effects/SlowTime" method="start"]
[connection signal="unfreeze" from="Effects/SlowTime" to="YSort/Player" method="_on_SlowTime_unfreeze"] [connection signal="unfreeze" from="Effects/SlowTime" to="YSort/Player" method="_on_SlowTime_unfreeze"]
[connection signal="timer_out" from="HUD/Countdown Timer" to="." method="_timer_out"]

View File

@@ -26,5 +26,12 @@ func _on_NextArea_area_entered(area: Area2D) -> void:
func _on_Demon_Boss_demon_boss_death() -> void: func _on_Demon_Boss_demon_boss_death() -> void:
get_tree().change_scene('res://GUI/Level Complete.tscn') $Timer.start()
return
func _on_Timer_timeout() -> void:
if get_tree().change_scene('res://GUI/Level Complete.tscn') != OK:
print('ERROR: Level 4 failed to change scene to Level Complete.')
queue_free() queue_free()
return

File diff suppressed because one or more lines are too long

View File

@@ -7,8 +7,9 @@ func _ready() -> void:
func _on_activate_boss_teleporter_body_entered(body: Node) -> void: func _on_activate_boss_teleporter_body_entered(body: Node) -> void:
$'Interactables/Boss Teleporter'.set_deferred('visible', true) if body.is_in_group('player'):
$'Interactables/Activate Boss Teleporter'.call_deferred('queue_free') $'Interactables/Boss Teleporter'.set_deferred('visible', true)
$'Interactables/Activate Boss Teleporter'.call_deferred('queue_free')
return return

View File

@@ -1,38 +1,33 @@
extends AnimatedSprite extends AnimatedSprite
export(PackedScene) var object_scene: PackedScene = null export var object_scene: PackedScene = null
var is_player_inside: bool = false
var is_opened: bool = false
var has_key: bool = false var has_key: bool = false
onready var animation_player: AnimationPlayer = get_node("AnimationPlayer")
onready var tween: Tween = get_node("Key/Tween")
func _ready() -> void: func _ready() -> void:
assert(object_scene!=null) assert(object_scene != null)
animation_player.play("closed") $AnimationPlayer.play('closed')
$Key/KeySprite.visible = false $Key/KeySprite.visible = false
return
func _on_area_body_entered(body: Node) -> void:
if body.is_in_group('player'):
$Area/CollisionShape2D.set_deferred('disabled', true)
$AnimationPlayer.play('open')
_drop_object()
return
func _input(event: InputEvent) -> void:
if is_player_inside and not is_opened:
is_opened = true
animation_player.play("open")
_drop_object()
func _drop_object() -> void: func _drop_object() -> void:
#print($Key.position)
$Key/KeySprite.visible = true $Key/KeySprite.visible = true
tween.interpolate_property($Key, "position", Vector2(0,0), Vector2(0, -10), 1.0, Tween.TRANS_QUAD, if not $Key/Tween.interpolate_property($Key, 'position', Vector2(0,0), Vector2(0, -10), 1.0,
Tween.EASE_OUT) Tween.TRANS_QUAD, Tween.EASE_OUT):
tween.start() print('ERROR: Chest key animation has errors.')
yield(tween, "tween_completed") if not $Key/Tween.start():
print('ERROR: Chest key animation failed to start.')
yield($Key/Tween, 'tween_completed')
$Key/KeySprite.visible = false $Key/KeySprite.visible = false
return
func _on_Area2D_player_entered(_player: KinematicBody2D) -> void:
is_player_inside = true
func _on_Area2D_player_exited(_player: KinematicBody2D) -> void:
is_player_inside = false

View File

@@ -174,5 +174,4 @@ animation = "closed"
[node name="AnimationPlayer" type="AnimationPlayer" parent="Entrance"] [node name="AnimationPlayer" type="AnimationPlayer" parent="Entrance"]
anims/closed = SubResource( 6 ) anims/closed = SubResource( 6 )
[connection signal="body_entered" from="Area" to="." method="_on_Area2D_player_entered"] [connection signal="body_entered" from="Area" to="." method="_on_area_body_entered"]
[connection signal="body_exited" from="Area" to="." method="_on_Area2D_player_exited"]

View File

@@ -0,0 +1,63 @@
extends ColorRect
export var dialog_path: String = ''
export var text_speed: float = 0.05
var dialog: Array
var phrase_num: int = 0
var finished = false
func _ready() -> void:
$Timer.wait_time = text_speed
dialog = get_dialog()
assert(dialog, 'Dialog not found')
next_phrase()
return
func _input(event: InputEvent) -> void:
$Indicator.visible = finished
if event.is_action_pressed('ui_accept'):
if finished:
next_phrase()
else:
$Text.visible_characters = len($Text.text)
return
func get_dialog() -> Array:
var f = File.new()
assert(f.file_exists(dialog_path), 'File path does not exist')
f.open(dialog_path, File.READ)
var json = f.get_as_text()
var output = parse_json(json)
if typeof(output) == TYPE_ARRAY:
return output
else:
return []
func next_phrase() -> void:
if phrase_num >= len(dialog):
queue_free()
return
finished = false
$Name.bbcode_text = dialog[phrase_num]['Name']
$Text.bbcode_text = dialog[phrase_num]['Text']
$Text.visible_characters = 0
while $Text.visible_characters < len($Text.text):
$Text.visible_characters += 1
$Timer.start()
yield($Timer, 'timeout')
finished = true
phrase_num += 1
return

View File

@@ -0,0 +1,84 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://Levels/Objects/DialogBox.gd" type="Script" id=1]
[ext_resource path="res://Fonts/AtariClassicSmooth.ttf" type="DynamicFontData" id=2]
[sub_resource type="DynamicFont" id=2]
size = 20
extra_spacing_top = -1
extra_spacing_bottom = -1
extra_spacing_char = -1
font_data = ExtResource( 2 )
[sub_resource type="Theme" id=3]
default_font = SubResource( 2 )
[sub_resource type="Animation" id=1]
resource_name = "bounce"
tracks/0/type = "value"
tracks/0/path = NodePath("AnimationPlayer:root_node")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ NodePath("..") ]
}
[node name="Dialogue" type="Control"]
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DialogBox" type="ColorRect" parent="."]
margin_left = 60.0
margin_top = 145.0
margin_right = 335.0
margin_bottom = 185.0
rect_min_size = Vector2( 275, 40 )
rect_scale = Vector2( 0.7, 0.730801 )
theme = SubResource( 3 )
color = Color( 0.776471, 0.752941, 0.647059, 1 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
dialog_path = "res://Levels/Objects/journalScrapDialog.json"
[node name="Name" type="RichTextLabel" parent="DialogBox"]
anchor_bottom = 2.0
margin_right = 500.0
margin_bottom = -17.0
rect_scale = Vector2( 0.4, 0.4 )
custom_colors/default_color = Color( 0, 0, 0, 1 )
text = "ddd"
fit_content_height = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Text" type="RichTextLabel" parent="DialogBox"]
margin_top = 9.0
margin_right = 500.0
margin_bottom = 70.0
rect_scale = Vector2( 0.4, 0.4 )
custom_colors/default_color = Color( 0, 0, 0, 1 )
text = "dddd"
scroll_active = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Indicator" type="Polygon2D" parent="DialogBox"]
position = Vector2( -104, 104 )
color = Color( 0, 0, 0, 1 )
antialiased = true
polygon = PoolVector2Array( 370.756, -68.0704, 376.296, -74.7627, 365.367, -74.6793 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="DialogBox/Indicator"]
anims/bounce = SubResource( 1 )
[node name="Timer" type="Timer" parent="DialogBox"]

View File

@@ -1,24 +1,11 @@
extends Node2D extends Node2D
# Declare member variables here. Examples: func _on_AnimationPlayer_animation_finished(_anim_name: String) -> void:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
func _on_AnimationPlayer_animation_finished(anim_name: String) -> void:
$IceKeySprite.visible = false $IceKeySprite.visible = false
return
func _on_AnimationPlayer_animation_started(anim_name: String) -> void: func _on_AnimationPlayer_animation_started(_anim_name: String) -> void:
$IceKeySprite.visible = true $IceKeySprite.visible = true
return

View File

@@ -1,34 +1,20 @@
extends Sprite extends Sprite
signal ice_key_collected
var is_player_inside: bool = false var is_player_inside: bool = false
var is_opened: bool = false var is_opened: bool = false
var has_key: bool = true var has_key: bool = true
signal ice_key_collected
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass
func _on_Player_Detector_area_entered(area: Area2D) -> void: func _on_Player_Detector_area_entered(area: Area2D) -> void:
print(get_parent().get_parent().score)
if area.get_parent().name == 'Player' and get_parent().get_parent().score >= 5: if area.get_parent().name == 'Player' and get_parent().get_parent().score >= 5:
if is_opened == false: if is_opened == false:
$chestClosed.visible = false $chestClosed.visible = false
$chestOpened.visible = true $chestOpened.visible = true
$Key.visible = true $Key.visible = true
$Key/AnimationPlayer.play("rise") $Key/AnimationPlayer.play('rise')
is_opened = true is_opened = true
has_key = false has_key = false
emit_signal("ice_key_collected") emit_signal('ice_key_collected')
return

View File

@@ -0,0 +1,5 @@
[
{"Name":"???", "Text":"Did they REALLY think they would be able to leave the ethereal plane?!"},
{"Name":"???", "Text":"No one ever leaves the ethereal plane!"},
{"Name":"???", "Text":"What a joke."}
]

View File

@@ -0,0 +1,7 @@
extends Area2D
func _ready() -> void:
visible = false
$CollisionShape2D.visible = false
return

View File

@@ -1,17 +0,0 @@
extends Area2D
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
self.visible = false
$CollisionShape2D.visible = false
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
# pass

View File

@@ -1,6 +1,6 @@
extends Area2D extends Area2D
export var enemy_path: String = 'res://Enemies/Ghost_Enemy.tscn' export var enemy_path: String = 'res://Enemies/ENEMY.tscn'
export var relative_x_tiles: int export var relative_x_tiles: int
export var relative_y_tiles: int export var relative_y_tiles: int

View File

@@ -42,7 +42,7 @@ func main_menu_option(option: String) -> void:
if option == 'new game': if option == 'new game':
if get_tree().change_scene(hub_world_path) != OK: if get_tree().change_scene(hub_world_path) != OK:
print('ERROR: Main failed to change scene to Hub World.') print('ERROR: Main failed to change scene to Hub World.')
queue_free() queue_free()
#var level_select_menu: Node = play_level_select_menu() #var level_select_menu: Node = play_level_select_menu()
#yield(level_select_menu, 'complete') #yield(level_select_menu, 'complete')
#free_connected_node(level_select_menu, 'level_select_menu_option') #free_connected_node(level_select_menu, 'level_select_menu_option')

BIN
Music/Hub_World.mp3 Normal file

Binary file not shown.

View File

@@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/Hub_World.mp3-42885cef66c1c7343770523f6d96d156.mp3str"
[deps]
source_file="res://Music/Hub_World.mp3"
dest_files=[ "res://.import/Hub_World.mp3-42885cef66c1c7343770523f6d96d156.mp3str" ]
[params]
loop=true
loop_offset=0

BIN
Music/Level_1.mp3 Normal file

Binary file not shown.

15
Music/Level_1.mp3.import Normal file
View File

@@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/Level_1.mp3-9039f67add638808045184c34f72f9a7.mp3str"
[deps]
source_file="res://Music/Level_1.mp3"
dest_files=[ "res://.import/Level_1.mp3-9039f67add638808045184c34f72f9a7.mp3str" ]
[params]
loop=true
loop_offset=0

BIN
Music/Level_2_1.mp3 Normal file

Binary file not shown.

View File

@@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/Level_2_1.mp3-ee2c847c916154147d31f02fcb5a48e1.mp3str"
[deps]
source_file="res://Music/Level_2_1.mp3"
dest_files=[ "res://.import/Level_2_1.mp3-ee2c847c916154147d31f02fcb5a48e1.mp3str" ]
[params]
loop=true
loop_offset=0

BIN
Music/Level_2_2.mp3 Normal file

Binary file not shown.

View File

@@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/Level_2_2.mp3-134340b5ecee726d2d95e042e2c114d0.mp3str"
[deps]
source_file="res://Music/Level_2_2.mp3"
dest_files=[ "res://.import/Level_2_2.mp3-134340b5ecee726d2d95e042e2c114d0.mp3str" ]
[params]
loop=true
loop_offset=0

BIN
Music/Level_4.mp3 Normal file

Binary file not shown.

15
Music/Level_4.mp3.import Normal file
View File

@@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/Level_4.mp3-109bbc88c479a0242f45096987fd4cb3.mp3str"
[deps]
source_file="res://Music/Level_4.mp3"
dest_files=[ "res://.import/Level_4.mp3-109bbc88c479a0242f45096987fd4cb3.mp3str" ]
[params]
loop=true
loop_offset=0

BIN
Music/Level_Complete.mp3 Normal file

Binary file not shown.

View File

@@ -0,0 +1,15 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
path="res://.import/Level_Complete.mp3-ae5af4a1ee7128809b313389d42673b2.mp3str"
[deps]
source_file="res://Music/Level_Complete.mp3"
dest_files=[ "res://.import/Level_Complete.mp3-ae5af4a1ee7128809b313389d42673b2.mp3str" ]
[params]
loop=true
loop_offset=0

BIN
Music/Level_Failed.wav Normal file

Binary file not shown.

View File

@@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/Level_Failed.wav-b9c2b0727fa0fd5a5f7230cad50c2000.sample"
[deps]
source_file="res://Music/Level_Failed.wav"
dest_files=[ "res://.import/Level_Failed.wav-b9c2b0727fa0fd5a5f7230cad50c2000.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 860 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 B

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 B

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 339 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 746 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 852 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 B

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 B

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 B

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 B

After

Width:  |  Height:  |  Size: 149 B

Some files were not shown because too many files have changed in this diff Show More