Code cleanup and minor fixes to Level 3
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
extends Label
|
extends Label
|
||||||
|
|
||||||
signal timer_end
|
signal timer_end
|
||||||
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
|
func _process(_delta: float) -> void:
|
||||||
var time_seconds: int = int($Timer.get_time_left())
|
var time_seconds: int = int($Timer.get_time_left())
|
||||||
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)])
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://GUI/Countdown Timer.gd" type="Script" id=1]
|
[ext_resource path="res://GUI/Countdown Timer.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Fonts/AtariClassic.ttf" type="DynamicFontData" id=2]
|
[ext_resource path="res://Fonts/AtariClassicSmooth.ttf" type="DynamicFontData" id=2]
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
[sub_resource type="DynamicFont" id=1]
|
||||||
size = 40
|
size = 40
|
||||||
@@ -14,8 +14,8 @@ margin_right = 335.0
|
|||||||
margin_bottom = 41.0
|
margin_bottom = 41.0
|
||||||
rect_min_size = Vector2( 200, 0 )
|
rect_min_size = Vector2( 200, 0 )
|
||||||
rect_scale = Vector2( 0.25, 0.25 )
|
rect_scale = Vector2( 0.25, 0.25 )
|
||||||
custom_fonts/font = SubResource( 1 )
|
|
||||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||||
|
custom_fonts/font = SubResource( 1 )
|
||||||
align = 1
|
align = 1
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Levels/Interactives/Coin.gd" type="Script" id=1]
|
[ext_resource path="res://Levels/Interactables/Coin.gd" type="Script" id=1]
|
||||||
[ext_resource path="res://Sprites/Assets/coin.png" type="Texture" id=2]
|
[ext_resource path="res://Sprites/Assets/coin.png" type="Texture" id=2]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=1]
|
[sub_resource type="CircleShape2D" id=1]
|
@@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=4 format=2]
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Sprites/Assets/resources_basic.png" type="Texture" id=1]
|
[ext_resource path="res://Sprites/Assets/Resources_Basic.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://Levels/Interactables/Gem.gd" type="Script" id=2]
|
[ext_resource path="res://Levels/Interactables/Gem.gd" type="Script" id=2]
|
||||||
|
|
||||||
[sub_resource type="Animation" id=3]
|
[sub_resource type="Animation" id=3]
|
||||||
|
@@ -1,14 +1,11 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
onready var coin = preload("res://Levels/Interactives/Coin.tscn")
|
onready var coin = preload('res://Levels/Interactables/Coin.tscn')
|
||||||
onready var coin_container = get_node("coin_container")
|
|
||||||
onready var score_label = get_node('Level 3 HUD/Label')
|
|
||||||
#have event for timer to run out
|
|
||||||
|
|
||||||
|
|
||||||
var screensize
|
var screensize
|
||||||
var score = 0
|
var score = 0
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
$YSort/Player.load_hud($HUD)
|
$YSort/Player.load_hud($HUD)
|
||||||
screensize = get_viewport_rect().size
|
screensize = get_viewport_rect().size
|
||||||
@@ -16,37 +13,44 @@ func _ready() -> void:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
func spawn_coins(num):
|
func spawn_coins(num: int) -> void:
|
||||||
for i in range(num):
|
for _i in range(num):
|
||||||
var g = 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")
|
g.connect('coin_grabbed', self, '_on_coin_grabbed')
|
||||||
#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
|
||||||
|
|
||||||
func _on_coin_grabbed():
|
|
||||||
|
func _on_coin_grabbed() -> void:
|
||||||
score += 1
|
score += 1
|
||||||
print(score)
|
print(score)
|
||||||
score_label.set_text(str(score) + "/5")
|
$'Level 3 HUD/Label'.set_text(str(score) + '/5')
|
||||||
|
return
|
||||||
|
|
||||||
func _timer_out():
|
|
||||||
|
func _timer_out() -> void:
|
||||||
get_tree().change_scene('res://Levels/Hub World.tscn')
|
get_tree().change_scene('res://Levels/Hub World.tscn')
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
func _on_TreasureChest_ice_key_collected() -> void:
|
func _on_TreasureChest_ice_key_collected() -> void:
|
||||||
$YSort/Door/doorClosed.visible = false
|
$YSort/Door/doorClosed.visible = false
|
||||||
$YSort/Door/doorOpened.visible = true
|
$YSort/Door/doorOpened.visible = true
|
||||||
$YSort/DoorCollision.layers = 5
|
$YSort/DoorCollision.layers = 5
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
func _on_DoorDetector_body_entered(body: Node) -> void:
|
func _on_DoorDetector_body_entered(body: Node) -> void:
|
||||||
if body.get_parent().name == 'Player':
|
if body.is_in_group('player'):
|
||||||
print('WIN WIN WIN')
|
print('WIN WIN WIN')
|
||||||
get_tree().change_scene('res://Levels/Hub World.tscn')
|
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':
|
||||||
print('WIN WIN WIN')
|
print('WIN WIN WIN')
|
||||||
get_tree().change_scene('res://Levels/Hub World.tscn') # Replace with function body.
|
get_tree().change_scene('res://Levels/Hub World.tscn')
|
||||||
|
return
|
||||||
|
@@ -177,6 +177,11 @@ position = Vector2( -49.6063, 34.526 )
|
|||||||
position = Vector2( 0, -4.25 )
|
position = Vector2( 0, -4.25 )
|
||||||
shape = SubResource( 5 )
|
shape = SubResource( 5 )
|
||||||
|
|
||||||
|
[node name="Effects" type="Node" parent="."]
|
||||||
|
|
||||||
|
[node name="SlowTime" type="Node" parent="Effects"]
|
||||||
|
script = ExtResource( 16 )
|
||||||
|
|
||||||
[node name="coin_container" type="Control" parent="."]
|
[node name="coin_container" type="Control" parent="."]
|
||||||
margin_right = 40.0
|
margin_right = 40.0
|
||||||
margin_bottom = 40.0
|
margin_bottom = 40.0
|
||||||
@@ -184,18 +189,6 @@ __meta__ = {
|
|||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Countdown Timer" parent="." instance=ExtResource( 12 )]
|
|
||||||
|
|
||||||
[node name="HUD" parent="." instance=ExtResource( 9 )]
|
|
||||||
|
|
||||||
[node name="Pause Screen" parent="." instance=ExtResource( 10 )]
|
|
||||||
|
|
||||||
[node name="BGM" type="AudioStreamPlayer" parent="."]
|
|
||||||
pause_mode = 2
|
|
||||||
stream = ExtResource( 11 )
|
|
||||||
volume_db = -12.0
|
|
||||||
autoplay = true
|
|
||||||
|
|
||||||
[node name="Level 3 HUD" type="Control" parent="."]
|
[node name="Level 3 HUD" type="Control" parent="."]
|
||||||
margin_left = 0.28064
|
margin_left = 0.28064
|
||||||
margin_top = -12.9083
|
margin_top = -12.9083
|
||||||
@@ -216,10 +209,17 @@ __meta__ = {
|
|||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Effects" type="Node" parent="."]
|
[node name="HUD" parent="." instance=ExtResource( 9 )]
|
||||||
|
|
||||||
[node name="SlowTime" type="Node" parent="Effects"]
|
[node name="Countdown Timer" parent="HUD" instance=ExtResource( 12 )]
|
||||||
script = ExtResource( 16 )
|
|
||||||
|
[node name="Pause Screen" parent="." instance=ExtResource( 10 )]
|
||||||
|
|
||||||
|
[node name="BGM" type="AudioStreamPlayer" parent="."]
|
||||||
|
pause_mode = 2
|
||||||
|
stream = ExtResource( 11 )
|
||||||
|
volume_db = -12.0
|
||||||
|
autoplay = true
|
||||||
|
|
||||||
[connection signal="area_entered" from="YSort/DoorDetector" to="." method="_on_DoorDetector_area_entered"]
|
[connection signal="area_entered" from="YSort/DoorDetector" to="." method="_on_DoorDetector_area_entered"]
|
||||||
[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"]
|
||||||
|
@@ -1,18 +1,18 @@
|
|||||||
[gd_scene load_steps=31 format=2]
|
[gd_scene load_steps=31 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/fire_column_medium_12.png" type="Texture" id=1]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_12.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://Enemies/Hellhound.tscn" type="PackedScene" id=2]
|
[ext_resource path="res://Enemies/Hellhound.tscn" type="PackedScene" id=2]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_03.png" type="Texture" id=3]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_03.png" type="Texture" id=3]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_09.png" type="Texture" id=4]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_09.png" type="Texture" id=4]
|
||||||
[ext_resource path="res://Levels/Objects/Door.tscn" type="PackedScene" id=5]
|
[ext_resource path="res://Levels/Objects/Door.tscn" type="PackedScene" id=5]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/fire_column_medium_10.png" type="Texture" id=6]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_10.png" type="Texture" id=6]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_04.png" type="Texture" id=7]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_04.png" type="Texture" id=7]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_06.png" type="Texture" id=8]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_06.png" type="Texture" id=8]
|
||||||
[ext_resource path="res://Levels/Level 4.gd" type="Script" id=9]
|
[ext_resource path="res://Levels/Level 4.gd" type="Script" id=9]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_01.png" type="Texture" id=10]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_01.png" type="Texture" id=10]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/fire_column_medium_13.png" type="Texture" id=11]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_13.png" type="Texture" id=11]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/fire_column_medium_14.png" type="Texture" id=12]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_14.png" type="Texture" id=12]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/fire_column_medium_11.png" type="Texture" id=13]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_11.png" type="Texture" id=13]
|
||||||
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_08.png" type="Texture" id=14]
|
[ext_resource path="res://Sprites/Levels/Environment/Fire_Column_Medium_08.png" type="Texture" id=14]
|
||||||
[ext_resource path="res://Resources/Level_4_Tileset.tres" type="TileSet" id=15]
|
[ext_resource path="res://Resources/Level_4_Tileset.tres" type="TileSet" id=15]
|
||||||
[ext_resource path="res://Levels/Interactables/Treasure Chest.tscn" type="PackedScene" id=16]
|
[ext_resource path="res://Levels/Interactables/Treasure Chest.tscn" type="PackedScene" id=16]
|
||||||
@@ -86,21 +86,21 @@ tile_data = PoolIntArray( -2686978, 0, 5, -2686977, 0, 196610, -2752512, 0, 1966
|
|||||||
[node name="Fire3" type="AnimatedSprite" parent="."]
|
[node name="Fire3" type="AnimatedSprite" parent="."]
|
||||||
position = Vector2( -607.628, -210.601 )
|
position = Vector2( -607.628, -210.601 )
|
||||||
frames = SubResource( 1 )
|
frames = SubResource( 1 )
|
||||||
frame = 2
|
frame = 12
|
||||||
playing = true
|
playing = true
|
||||||
offset = Vector2( 679.819, 333.222 )
|
offset = Vector2( 679.819, 333.222 )
|
||||||
|
|
||||||
[node name="Fire2" type="AnimatedSprite" parent="."]
|
[node name="Fire2" type="AnimatedSprite" parent="."]
|
||||||
position = Vector2( -543.25, -212.563 )
|
position = Vector2( -543.25, -212.563 )
|
||||||
frames = SubResource( 1 )
|
frames = SubResource( 1 )
|
||||||
frame = 5
|
frame = 1
|
||||||
playing = true
|
playing = true
|
||||||
offset = Vector2( 679.819, 333.222 )
|
offset = Vector2( 679.819, 333.222 )
|
||||||
|
|
||||||
[node name="Fire1" type="AnimatedSprite" parent="."]
|
[node name="Fire1" type="AnimatedSprite" parent="."]
|
||||||
position = Vector2( -479.806, -214.167 )
|
position = Vector2( -479.806, -214.167 )
|
||||||
frames = SubResource( 1 )
|
frames = SubResource( 1 )
|
||||||
frame = 12
|
frame = 8
|
||||||
playing = true
|
playing = true
|
||||||
offset = Vector2( 679.819, 333.222 )
|
offset = Vector2( 679.819, 333.222 )
|
||||||
|
|
||||||
|
@@ -1,17 +1,16 @@
|
|||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
const END_VALUE = 1
|
|
||||||
|
|
||||||
signal unfreeze
|
signal unfreeze
|
||||||
|
|
||||||
var is_active = false
|
const END_VALUE: int = 1
|
||||||
var time_start
|
|
||||||
var duration_ms
|
var is_active: bool = false
|
||||||
var start_value
|
var time_start: int
|
||||||
|
var duration_ms: int
|
||||||
|
var start_value: float
|
||||||
|
|
||||||
|
|
||||||
|
func start(duration: int = 1, strength: float = 0.9):
|
||||||
func start(duration = 1, strength = 0.9):
|
|
||||||
time_start = OS.get_ticks_msec()
|
time_start = OS.get_ticks_msec()
|
||||||
duration_ms = duration * 1000
|
duration_ms = duration * 1000
|
||||||
start_value = 1 - strength
|
start_value = 1 - strength
|
||||||
@@ -19,7 +18,7 @@ func start(duration = 1, strength = 0.9):
|
|||||||
is_active = true
|
is_active = true
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta: float) -> void:
|
||||||
if is_active:
|
if is_active:
|
||||||
var current_time = OS.get_ticks_msec() - time_start
|
var current_time = OS.get_ticks_msec() - time_start
|
||||||
var value = circl_ease_in(current_time, start_value, END_VALUE, duration_ms)
|
var value = circl_ease_in(current_time, start_value, END_VALUE, duration_ms)
|
||||||
@@ -28,6 +27,8 @@ func _process(delta):
|
|||||||
value = END_VALUE
|
value = END_VALUE
|
||||||
emit_signal('unfreeze')
|
emit_signal('unfreeze')
|
||||||
Engine.time_scale = value
|
Engine.time_scale = value
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
func circl_ease_in(t, b, c, d):
|
func circl_ease_in(t, b, c, d):
|
||||||
t /= d
|
t /= d
|
||||||
|
@@ -7,7 +7,7 @@ export var relative_y_tiles: int
|
|||||||
|
|
||||||
func _on_spawn_trap_body_entered(body: Node) -> void:
|
func _on_spawn_trap_body_entered(body: Node) -> void:
|
||||||
if body.is_in_group('player'):
|
if body.is_in_group('player'):
|
||||||
set_deferred('monitoring', false)
|
$Tile.set_deferred('disabled', true)
|
||||||
|
|
||||||
var enemy: KinematicBody2D = load(enemy_path).instance()
|
var enemy: KinematicBody2D = load(enemy_path).instance()
|
||||||
enemy.position.x = position.x + (relative_x_tiles * 16 + 8)
|
enemy.position.x = position.x + (relative_x_tiles * 16 + 8)
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
extends KinematicBody2D
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
signal frozen
|
||||||
|
|
||||||
export var ACCELERATION: int = 1000
|
export var ACCELERATION: int = 1000
|
||||||
export var MAX_SPEED: int = 120
|
export var MAX_SPEED: int = 120
|
||||||
export var FRICTION: int = 1000
|
export var FRICTION: int = 1000
|
||||||
signal frozen
|
|
||||||
|
|
||||||
|
|
||||||
const HEALTH_SLICES: Array = [0, 18, 35, 50, 65, 82, 100]
|
const HEALTH_SLICES: Array = [0, 18, 35, 50, 65, 82, 100]
|
||||||
var health_index: int = 6
|
var health_index: int = 6
|
||||||
@@ -49,22 +49,22 @@ func load_hud(node: CanvasLayer) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func set_weapon_position(pos: Vector2) -> void:
|
func set_weapon_position(pos: Vector2) -> void:
|
||||||
# facing left
|
# Facing left
|
||||||
if pos[0] < 0:
|
if pos[0] < 0:
|
||||||
$Sword.rotation_degrees = -90
|
$Sword.rotation_degrees = -90
|
||||||
$Javelin.rotation_degrees = -90
|
$Javelin.rotation_degrees = -90
|
||||||
|
|
||||||
# facing right
|
# Facing right
|
||||||
elif pos[0] > 0:
|
elif pos[0] > 0:
|
||||||
$Sword.rotation_degrees = 90
|
$Sword.rotation_degrees = 90
|
||||||
$Javelin.rotation_degrees = 90
|
$Javelin.rotation_degrees = 90
|
||||||
|
|
||||||
# facing up
|
# Facing up
|
||||||
elif pos[1] < 0:
|
elif pos[1] < 0:
|
||||||
$Sword.rotation_degrees = 0
|
$Sword.rotation_degrees = 0
|
||||||
$Javelin.rotation_degrees = 0
|
$Javelin.rotation_degrees = 0
|
||||||
|
|
||||||
# facing down
|
# Facing down
|
||||||
elif pos[1] > 0:
|
elif pos[1] > 0:
|
||||||
$Sword.rotation_degrees = 180
|
$Sword.rotation_degrees = 180
|
||||||
$Javelin.rotation_degrees = 180
|
$Javelin.rotation_degrees = 180
|
||||||
@@ -106,7 +106,7 @@ func _on_hitbox_area_entered(area: Area2D) -> void:
|
|||||||
hit = 3
|
hit = 3
|
||||||
elif area.is_in_group('freeze'):
|
elif area.is_in_group('freeze'):
|
||||||
emit_signal('frozen')
|
emit_signal('frozen')
|
||||||
modulate = Color(0,.5,1)
|
$Sprite.self_modulate = Color(0, 0.5, 1)
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -118,11 +118,9 @@ func _on_hitbox_area_entered(area: Area2D) -> void:
|
|||||||
hud.update_health(HEALTH_SLICES[health_index])
|
hud.update_health(HEALTH_SLICES[health_index])
|
||||||
else:
|
else:
|
||||||
get_tree().change_scene('res://Levels/Hub World.tscn')
|
get_tree().change_scene('res://Levels/Hub World.tscn')
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed('player_attack'):
|
if event.is_action_pressed('player_attack'):
|
||||||
if hud.weapon == 'sword':
|
if hud.weapon == 'sword':
|
||||||
@@ -130,7 +128,7 @@ func _input(event: InputEvent) -> void:
|
|||||||
elif hud.weapon == 'javelin':
|
elif hud.weapon == 'javelin':
|
||||||
$'Javelin/Javelin Animation'.play('swing')
|
$'Javelin/Javelin Animation'.play('swing')
|
||||||
|
|
||||||
if event.is_action_pressed('screenshot'):
|
elif event.is_action_pressed('screenshot'):
|
||||||
var img: Image = get_viewport().get_texture().get_data()
|
var img: Image = get_viewport().get_texture().get_data()
|
||||||
yield(get_tree(), 'idle_frame')
|
yield(get_tree(), 'idle_frame')
|
||||||
yield(get_tree(), 'idle_frame')
|
yield(get_tree(), 'idle_frame')
|
||||||
@@ -140,31 +138,11 @@ func _input(event: InputEvent) -> void:
|
|||||||
var time: Dictionary = OS.get_datetime_from_unix_time(OS.get_unix_time())
|
var time: Dictionary = OS.get_datetime_from_unix_time(OS.get_unix_time())
|
||||||
var time_msecs: int = OS.get_system_time_msecs()
|
var time_msecs: int = OS.get_system_time_msecs()
|
||||||
|
|
||||||
|
|
||||||
if img.save_png('user://Screenshot_%d%d%d_%d.png' % [time.year, time.month, time.day, time_msecs]) != OK:
|
if img.save_png('user://Screenshot_%d%d%d_%d.png' % [time.year, time.month, time.day, time_msecs]) != OK:
|
||||||
print('ERROR: Failed saving screenshot.')
|
print('ERROR: Failed saving screenshot.')
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
func _on_Hitbox_area_entered(area: Area2D) -> void:
|
|
||||||
print(area.name)
|
|
||||||
|
|
||||||
if area.name == 'detection':
|
|
||||||
return
|
|
||||||
|
|
||||||
if 'freeze' in area.get_parent().get_groups():
|
|
||||||
emit_signal('frozen')
|
|
||||||
return
|
|
||||||
|
|
||||||
if 'enemies' in area.get_parent().get_groups() or area.name != 'detection' or 'damage' in area.get_groups():
|
|
||||||
if health_index != 0:
|
|
||||||
health_index -= 1
|
|
||||||
hud.update_health(HEALTH_SLICES[health_index])
|
|
||||||
else:
|
|
||||||
get_tree().change_scene('res://Levels/Hub World.tscn')
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
func _on_SlowTime_unfreeze() -> void:
|
func _on_SlowTime_unfreeze() -> void:
|
||||||
modulate = Color(1,1,1)
|
$Sprite.self_modulate = Color(1, 1, 1)
|
||||||
|
return
|
||||||
|
@@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=1]
|
[sub_resource type="SpriteFrames" id=1]
|
||||||
animations = [ {
|
animations = [ {
|
||||||
"frames": [ ExtResource( 2 ) ],
|
"frames": [ ExtResource( 4 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "look_left",
|
"name": "look_up",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ ExtResource( 2 ) ],
|
"frames": [ ExtResource( 2 ) ],
|
||||||
@@ -20,15 +20,15 @@ animations = [ {
|
|||||||
"name": "look_right",
|
"name": "look_right",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ ExtResource( 4 ) ],
|
|
||||||
"loop": false,
|
|
||||||
"name": "look_up",
|
|
||||||
"speed": 5.0
|
|
||||||
}, {
|
|
||||||
"frames": [ ExtResource( 3 ) ],
|
"frames": [ ExtResource( 3 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "look_down",
|
"name": "look_down",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [ ExtResource( 2 ) ],
|
||||||
|
"loop": false,
|
||||||
|
"name": "look_left",
|
||||||
|
"speed": 5.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=2]
|
[sub_resource type="CapsuleShape2D" id=2]
|
||||||
@@ -182,9 +182,7 @@ graph_offset = Vector2( -3591.37, -302.6 )
|
|||||||
|
|
||||||
[sub_resource type="AnimationNodeStateMachinePlayback" id=14]
|
[sub_resource type="AnimationNodeStateMachinePlayback" id=14]
|
||||||
|
|
||||||
[node name="Player" type="KinematicBody2D" groups=[
|
[node name="Player" type="KinematicBody2D" groups=["player"]]
|
||||||
"player",
|
|
||||||
]]
|
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
@@ -200,12 +198,10 @@ visible = false
|
|||||||
rotation = 1.5708
|
rotation = 1.5708
|
||||||
shape = SubResource( 2 )
|
shape = SubResource( 2 )
|
||||||
|
|
||||||
[node name="Hitbox" type="Area2D" parent="." groups=[
|
[node name="Hitbox" type="Area2D" parent="." groups=["player_hitbox"]]
|
||||||
"player_hitbox",
|
|
||||||
]]
|
|
||||||
input_pickable = false
|
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 4
|
collision_mask = 4
|
||||||
|
input_pickable = false
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
|
||||||
visible = false
|
visible = false
|
||||||
|
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="StreamTexture"
|
||||||
path="res://.import/resources_basic.png-128bab182945611297ec1bda48bed0c4.stex"
|
path="res://.import/Resources_Basic.png-ace2281282b93b7ae48cda9c52d377ad.stex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://Sprites/Assets/resources_basic.png"
|
source_file="res://Sprites/Assets/Resources_Basic.png"
|
||||||
dest_files=[ "res://.import/resources_basic.png-128bab182945611297ec1bda48bed0c4.stex" ]
|
dest_files=[ "res://.import/Resources_Basic.png-ace2281282b93b7ae48cda9c52d377ad.stex" ]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="StreamTexture"
|
||||||
path="res://.import/fire_column_medium_10.png-9ae78a0f5ef8531c3b56d09574ecd317.stex"
|
path="res://.import/Fire_Column_Medium_10.png-505d756e8645c45b6fb339fbb6f8add5.stex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://Sprites/Levels/Environment/fire_column_medium_10.png"
|
source_file="res://Sprites/Levels/Environment/Fire_Column_Medium_10.png"
|
||||||
dest_files=[ "res://.import/fire_column_medium_10.png-9ae78a0f5ef8531c3b56d09574ecd317.stex" ]
|
dest_files=[ "res://.import/Fire_Column_Medium_10.png-505d756e8645c45b6fb339fbb6f8add5.stex" ]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="StreamTexture"
|
||||||
path="res://.import/fire_column_medium_11.png-f6c2ac8f20428aebca0febd0f65a5806.stex"
|
path="res://.import/Fire_Column_Medium_11.png-cb278dde504fd6f8f415eda7091cfa9a.stex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://Sprites/Levels/Environment/fire_column_medium_11.png"
|
source_file="res://Sprites/Levels/Environment/Fire_Column_Medium_11.png"
|
||||||
dest_files=[ "res://.import/fire_column_medium_11.png-f6c2ac8f20428aebca0febd0f65a5806.stex" ]
|
dest_files=[ "res://.import/Fire_Column_Medium_11.png-cb278dde504fd6f8f415eda7091cfa9a.stex" ]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="StreamTexture"
|
||||||
path="res://.import/fire_column_medium_12.png-25bc0d063fd42a44b6e9e423e3bf2656.stex"
|
path="res://.import/Fire_Column_Medium_12.png-1e7c2da6903b243f73d7ed4b50d90f8a.stex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://Sprites/Levels/Environment/fire_column_medium_12.png"
|
source_file="res://Sprites/Levels/Environment/Fire_Column_Medium_12.png"
|
||||||
dest_files=[ "res://.import/fire_column_medium_12.png-25bc0d063fd42a44b6e9e423e3bf2656.stex" ]
|
dest_files=[ "res://.import/Fire_Column_Medium_12.png-1e7c2da6903b243f73d7ed4b50d90f8a.stex" ]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="StreamTexture"
|
||||||
path="res://.import/fire_column_medium_13.png-6f8490642f9a7a3884a31ae3975deb08.stex"
|
path="res://.import/Fire_Column_Medium_13.png-a147b7694df1cdf05d373697c6a4ede3.stex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://Sprites/Levels/Environment/fire_column_medium_13.png"
|
source_file="res://Sprites/Levels/Environment/Fire_Column_Medium_13.png"
|
||||||
dest_files=[ "res://.import/fire_column_medium_13.png-6f8490642f9a7a3884a31ae3975deb08.stex" ]
|
dest_files=[ "res://.import/Fire_Column_Medium_13.png-a147b7694df1cdf05d373697c6a4ede3.stex" ]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
@@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="StreamTexture"
|
||||||
path="res://.import/fire_column_medium_14.png-81452b14764f0dd97e4008c5f9448c38.stex"
|
path="res://.import/Fire_Column_Medium_14.png-205dacf8251c335e3becb65b0df84941.stex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://Sprites/Levels/Environment/fire_column_medium_14.png"
|
source_file="res://Sprites/Levels/Environment/Fire_Column_Medium_14.png"
|
||||||
dest_files=[ "res://.import/fire_column_medium_14.png-81452b14764f0dd97e4008c5f9448c38.stex" ]
|
dest_files=[ "res://.import/Fire_Column_Medium_14.png-205dacf8251c335e3becb65b0df84941.stex" ]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user