Movement tweaks, fade tweaks, stopped ledge jumping, and lighting tweaks
This commit is contained in:
Binary file not shown.
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="adff44dac2834f17108b17f4084591a1"
|
||||||
|
dest_md5="e2e7037a5692f3fe173da14e5c60805a"
|
||||||
|
|
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="b13caddd7fdd2e51d2b7a6b20a8f47c3"
|
||||||
|
dest_md5="4475888cf6d0167b58105bf9f678979c"
|
||||||
|
|
Binary file not shown.
@ -0,0 +1,3 @@
|
|||||||
|
source_md5="88515d8ae34cca55294e20310b7476c4"
|
||||||
|
dest_md5="0f70ef32cfa3623874dce680b21fdd79"
|
||||||
|
|
BIN
client/.import/x07DLrX.jpg-800f7c21b25c7cf1a88b1ba7bf53d2e0.stex
Normal file
BIN
client/.import/x07DLrX.jpg-800f7c21b25c7cf1a88b1ba7bf53d2e0.stex
Normal file
Binary file not shown.
BIN
client/Assets/Art/UI/Credits/x07DLrX.jpg
Normal file
BIN
client/Assets/Art/UI/Credits/x07DLrX.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 88 KiB |
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="StreamTexture"
|
||||||
path="res://.import/animation_reference.png-0380e195c2981cbf6a12a964c592fbc3.stex"
|
path="res://.import/x07DLrX.jpg-800f7c21b25c7cf1a88b1ba7bf53d2e0.stex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://animation_reference.png"
|
source_file="res://Assets/Art/UI/Credits/x07DLrX.jpg"
|
||||||
dest_files=[ "res://.import/animation_reference.png-0380e195c2981cbf6a12a964c592fbc3.stex" ]
|
dest_files=[ "res://.import/x07DLrX.jpg-800f7c21b25c7cf1a88b1ba7bf53d2e0.stex" ]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
BIN
client/Assets/Art/square_light.png
Normal file
BIN
client/Assets/Art/square_light.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.0 KiB |
34
client/Assets/Art/square_light.png.import
Normal file
34
client/Assets/Art/square_light.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/square_light.png-aadfc5d355cc8a74d0d2f8166db807ad.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Assets/Art/square_light.png"
|
||||||
|
dest_files=[ "res://.import/square_light.png-aadfc5d355cc8a74d0d2f8166db807ad.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=true
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=true
|
||||||
|
svg/scale=1.0
|
@ -1,23 +1,24 @@
|
|||||||
[gd_scene load_steps=10 format=2]
|
[gd_scene load_steps=11 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Assets/Themes/default.tres" type="Theme" id=1]
|
[ext_resource path="res://Assets/Themes/default.tres" type="Theme" id=1]
|
||||||
[ext_resource path="res://Scripts/Systems/GameGui.gd" type="Script" id=2]
|
[ext_resource path="res://Scripts/Systems/GameGui.gd" type="Script" id=2]
|
||||||
[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/improbable-v1/Improbable.ttf" type="DynamicFontData" id=3]
|
[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/improbable-v1/Improbable.ttf" type="DynamicFontData" id=3]
|
||||||
[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/zapper-v1.1/Zapper.otf" type="DynamicFontData" id=4]
|
[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/zapper-v1.1/Zapper.otf" type="DynamicFontData" id=4]
|
||||||
[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/marksman-v1/Marksman.ttf" type="DynamicFontData" id=5]
|
[ext_resource path="res://Assets/Proprietary/hf-scifi-complete/marksman-v1/Marksman.ttf" type="DynamicFontData" id=5]
|
||||||
|
[ext_resource path="res://Scripts/Entities/Fader.gd" type="Script" id=6]
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
[sub_resource type="DynamicFont" id=1]
|
||||||
size = 18
|
size = 18
|
||||||
font_data = ExtResource( 4 )
|
font_data = ExtResource( 4 )
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id=4]
|
[sub_resource type="StyleBoxFlat" id=2]
|
||||||
bg_color = Color( 0.2, 0.376471, 0.368627, 0.694118 )
|
bg_color = Color( 0.2, 0.376471, 0.368627, 0.694118 )
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=2]
|
[sub_resource type="DynamicFont" id=3]
|
||||||
size = 48
|
size = 48
|
||||||
font_data = ExtResource( 3 )
|
font_data = ExtResource( 3 )
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=3]
|
[sub_resource type="DynamicFont" id=4]
|
||||||
size = 32
|
size = 32
|
||||||
outline_size = 2
|
outline_size = 2
|
||||||
outline_color = Color( 0, 0, 0, 0.45098 )
|
outline_color = Color( 0, 0, 0, 0.45098 )
|
||||||
@ -83,7 +84,7 @@ margin_left = 37.0
|
|||||||
margin_top = -9.0
|
margin_top = -9.0
|
||||||
margin_right = 987.0
|
margin_right = 987.0
|
||||||
margin_bottom = 22.0
|
margin_bottom = 22.0
|
||||||
custom_styles/panel = SubResource( 4 )
|
custom_styles/panel = SubResource( 2 )
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
@ -121,7 +122,7 @@ margin_left = 12.0
|
|||||||
margin_top = -59.0
|
margin_top = -59.0
|
||||||
margin_right = 1257.0
|
margin_right = 1257.0
|
||||||
margin_bottom = -8.0
|
margin_bottom = -8.0
|
||||||
custom_fonts/font = SubResource( 2 )
|
custom_fonts/font = SubResource( 3 )
|
||||||
text = "Entering: Depths"
|
text = "Entering: Depths"
|
||||||
valign = 2
|
valign = 2
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
@ -137,9 +138,21 @@ margin_left = -386.0
|
|||||||
margin_top = -110.5
|
margin_top = -110.5
|
||||||
margin_right = 386.0
|
margin_right = 386.0
|
||||||
margin_bottom = 110.5
|
margin_bottom = 110.5
|
||||||
custom_fonts/font = SubResource( 3 )
|
custom_fonts/font = SubResource( 4 )
|
||||||
text = "Press WASD to move"
|
text = "Press WASD to move"
|
||||||
align = 1
|
align = 1
|
||||||
__meta__ = {
|
__meta__ = {
|
||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="Fader" type="ColorRect" parent="."]
|
||||||
|
visible = false
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
mouse_filter = 2
|
||||||
|
color = Color( 0, 0, 0, 1 )
|
||||||
|
script = ExtResource( 6 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
start_with_fade_in = false
|
||||||
|
@ -1,28 +1,27 @@
|
|||||||
[gd_scene load_steps=12 format=2]
|
[gd_scene load_steps=13 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Assets/Sfx/intro/processed.wav" type="AudioStream" id=1]
|
[ext_resource path="res://Assets/Sfx/intro/processed.wav" type="AudioStream" id=1]
|
||||||
[ext_resource path="res://Scripts/Component/StorySpeaker.gd" type="Script" id=2]
|
[ext_resource path="res://Scripts/Component/StorySpeaker.gd" type="Script" id=2]
|
||||||
[ext_resource path="res://Scripts/Entities/NPCs/Aura.gd" type="Script" id=3]
|
[ext_resource path="res://Scripts/Entities/NPCs/Aura.gd" type="Script" id=3]
|
||||||
[ext_resource path="res://Assets/Art/Characters/aura.png" type="Texture" id=4]
|
[ext_resource path="res://Assets/Art/Characters/aura.png" type="Texture" id=4]
|
||||||
|
[ext_resource path="res://Scripts/Entities/Fader.gd" type="Script" id=5]
|
||||||
|
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=1]
|
[sub_resource type="AtlasTexture" id=1]
|
||||||
atlas = ExtResource( 4 )
|
atlas = ExtResource( 4 )
|
||||||
region = Rect2( 23, 0, 5, 16 )
|
region = Rect2( 23, 0, 5, 16 )
|
||||||
|
|
||||||
[sub_resource type="StreamTexture" id=3]
|
[sub_resource type="StreamTexture" id=2]
|
||||||
load_path = "res://.import/aura.png-d56c2c3c604fb12791bf7613004ed5a9.stex"
|
load_path = "res://.import/aura.png-d56c2c3c604fb12791bf7613004ed5a9.stex"
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=4]
|
[sub_resource type="AtlasTexture" id=3]
|
||||||
atlas = SubResource( 3 )
|
atlas = SubResource( 2 )
|
||||||
region = Rect2( 19, 0, 3, 16 )
|
region = Rect2( 19, 0, 3, 16 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=5]
|
[sub_resource type="AtlasTexture" id=4]
|
||||||
atlas = SubResource( 3 )
|
atlas = SubResource( 2 )
|
||||||
region = Rect2( 29, 0, 3, 16 )
|
region = Rect2( 29, 0, 3, 16 )
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=2]
|
[sub_resource type="RectangleShape2D" id=5]
|
||||||
extents = Vector2( 62.9439, 20.084 )
|
extents = Vector2( 62.9439, 20.084 )
|
||||||
|
|
||||||
[sub_resource type="Animation" id=6]
|
[sub_resource type="Animation" id=6]
|
||||||
@ -160,16 +159,16 @@ texture = SubResource( 1 )
|
|||||||
[node name="RightArm" type="Sprite" parent="Torso"]
|
[node name="RightArm" type="Sprite" parent="Torso"]
|
||||||
position = Vector2( -3, 0 )
|
position = Vector2( -3, 0 )
|
||||||
z_index = -1
|
z_index = -1
|
||||||
texture = SubResource( 4 )
|
texture = SubResource( 3 )
|
||||||
|
|
||||||
[node name="LeftArm" type="Sprite" parent="Torso"]
|
[node name="LeftArm" type="Sprite" parent="Torso"]
|
||||||
position = Vector2( 3, 0 )
|
position = Vector2( 3, 0 )
|
||||||
z_index = -1
|
z_index = -1
|
||||||
texture = SubResource( 5 )
|
texture = SubResource( 4 )
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
shape = SubResource( 2 )
|
shape = SubResource( 5 )
|
||||||
|
|
||||||
[node name="Speaker" type="Node" parent="."]
|
[node name="Speaker" type="Node" parent="."]
|
||||||
script = ExtResource( 2 )
|
script = ExtResource( 2 )
|
||||||
@ -190,6 +189,18 @@ __meta__ = {
|
|||||||
"_edit_use_anchors_": false
|
"_edit_use_anchors_": false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[node name="Fader" type="ColorRect" parent="CanvasLayer"]
|
||||||
|
visible = false
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
mouse_filter = 2
|
||||||
|
color = Color( 0, 0, 0, 1 )
|
||||||
|
script = ExtResource( 5 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
start_with_fade_in = false
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
anims/Idle = SubResource( 6 )
|
anims/Idle = SubResource( 6 )
|
||||||
anims/Shoot = SubResource( 7 )
|
anims/Shoot = SubResource( 7 )
|
||||||
|
@ -1717,7 +1717,7 @@ tracks/39/keys = {
|
|||||||
"times": PoolRealArray( 0, 0.5, 0.9 )
|
"times": PoolRealArray( 0, 0.5, 0.9 )
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id=23]
|
[sub_resource type="RectangleShape2D" id=6]
|
||||||
extents = Vector2( 3.06702, 6.9149 )
|
extents = Vector2( 3.06702, 6.9149 )
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id=7]
|
[sub_resource type="AtlasTexture" id=7]
|
||||||
@ -1817,7 +1817,7 @@ zoom = Vector2( 0.187, 0.187 )
|
|||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
position = Vector2( -0.0595379, 2.35723 )
|
position = Vector2( -0.0595379, 2.35723 )
|
||||||
shape = SubResource( 23 )
|
shape = SubResource( 6 )
|
||||||
|
|
||||||
[node name="Light2D" type="Light2D" parent="."]
|
[node name="Light2D" type="Light2D" parent="."]
|
||||||
texture = ExtResource( 3 )
|
texture = ExtResource( 3 )
|
||||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
8
client/Scripts/Component/Killbox.gd
Normal file
8
client/Scripts/Component/Killbox.gd
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
extends Area2D
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
connect("body_entered", self, "_on_body_entered")
|
||||||
|
|
||||||
|
func _on_body_entered(body):
|
||||||
|
if body.has_method("handle_death"):
|
||||||
|
body.handle_death()
|
8
client/Scripts/Component/Savebox.gd
Normal file
8
client/Scripts/Component/Savebox.gd
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
extends Area2D
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
connect("body_entered", self, "_on_body_entered")
|
||||||
|
|
||||||
|
func _on_body_entered(body):
|
||||||
|
if body.saved_pos:
|
||||||
|
body.saved_pos = body.position
|
@ -39,7 +39,7 @@ func shoot_scene():
|
|||||||
|
|
||||||
func start_fade():
|
func start_fade():
|
||||||
timer.stop()
|
timer.stop()
|
||||||
var fader = get_tree().root.get_node("World").get_node("Fader").get_child(0)
|
var fader = $CanvasLayer/Fader
|
||||||
fader.connect("fade_complete", self, "go_to_credits")
|
fader.connect("fade_complete", self, "go_to_credits")
|
||||||
fader.fade(2, false)
|
fader.fade(2, false)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ var baseGravity : float = 9.8
|
|||||||
|
|
||||||
# Player movment variables
|
# Player movment variables
|
||||||
var maxMoveVelocity : float = 150
|
var maxMoveVelocity : float = 150
|
||||||
var moveAcceleration : float = 125
|
var moveAcceleration : float = 100
|
||||||
var moveFriction : float = 65
|
var moveFriction : float = 65
|
||||||
var jumpVelocity : float = -150
|
var jumpVelocity : float = -150
|
||||||
var jumped = false
|
var jumped = false
|
||||||
@ -21,6 +21,35 @@ var interactables = [] # Objects in range to interact with
|
|||||||
var items = [] # Items in player inventory
|
var items = [] # Items in player inventory
|
||||||
var equiped = null # Currently equiped item
|
var equiped = null # Currently equiped item
|
||||||
|
|
||||||
|
var saved_pos
|
||||||
|
func _ready():
|
||||||
|
saved_pos = position
|
||||||
|
|
||||||
|
#==================
|
||||||
|
# Helper Functions
|
||||||
|
#==================
|
||||||
|
func is_movement_locked():
|
||||||
|
if gui and gui.is_in_dialog():
|
||||||
|
return true
|
||||||
|
return false
|
||||||
|
|
||||||
|
func check_for_nodes():
|
||||||
|
if not gui:
|
||||||
|
gui = get_node("/root/World/GUI")
|
||||||
|
|
||||||
|
#==================
|
||||||
|
# Death management
|
||||||
|
#==================
|
||||||
|
func handle_death():
|
||||||
|
print_debug("Player death not implemented!")
|
||||||
|
gui.fade_screen(0.25, false)
|
||||||
|
gui.connect("screen_fade_complete", self, "death_fade_complete")
|
||||||
|
|
||||||
|
func death_fade_complete():
|
||||||
|
position = saved_pos
|
||||||
|
gui.fade_screen(1, true)
|
||||||
|
gui.disconnect("screen_fade_complete", self, "death_fade_complete")
|
||||||
|
|
||||||
#==================
|
#==================
|
||||||
# Inventory System
|
# Inventory System
|
||||||
#==================
|
#==================
|
||||||
@ -52,14 +81,18 @@ func interact():
|
|||||||
# Game Loop
|
# Game Loop
|
||||||
#===========
|
#===========
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
|
check_for_nodes()
|
||||||
|
|
||||||
jumped = false
|
jumped = false
|
||||||
|
|
||||||
# Gravity
|
# Gravity
|
||||||
motion.y += baseGravity
|
if is_on_floor():
|
||||||
|
motion.y = 0
|
||||||
if not gui:
|
else:
|
||||||
gui = get_node("/root/World/GUI")
|
motion.y += baseGravity
|
||||||
elif not gui.is_in_dialog():
|
|
||||||
|
# Manage movement input
|
||||||
|
if not is_movement_locked():
|
||||||
user_input()
|
user_input()
|
||||||
if jumped:
|
if jumped:
|
||||||
motion.y = jumpVelocity
|
motion.y = jumpVelocity
|
||||||
@ -68,8 +101,6 @@ func _physics_process(delta):
|
|||||||
|
|
||||||
# Apply velocity limits
|
# Apply velocity limits
|
||||||
moveMotion = clamp(moveMotion, -maxMoveVelocity, maxMoveVelocity)
|
moveMotion = clamp(moveMotion, -maxMoveVelocity, maxMoveVelocity)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Apply velocity to frame
|
# Apply velocity to frame
|
||||||
motion.x = moveMotion
|
motion.x = moveMotion
|
||||||
@ -84,17 +115,17 @@ func _physics_process(delta):
|
|||||||
# conditions
|
# conditions
|
||||||
func animation_manager(motion : float):
|
func animation_manager(motion : float):
|
||||||
|
|
||||||
if not is_on_floor():
|
if not test_move(transform, Vector2(0,1)):
|
||||||
$AnimationPlayer.play("InAir")
|
$AnimationPlayer.play("InAir")
|
||||||
elif jumped:
|
elif jumped:
|
||||||
if $AnimationPlayer.current_animation != "Jump":
|
if $AnimationPlayer.current_animation != "Jump":
|
||||||
$AnimationPlayer.play("Jump")
|
$AnimationPlayer.play("Jump")
|
||||||
elif moveMotion > 0:
|
elif moveMotion > 0:
|
||||||
$AnimationPlayer.playback_speed = abs(motion)/200
|
$AnimationPlayer.playback_speed = abs(motion)/100
|
||||||
if $AnimationPlayer.current_animation != "RunRight":
|
if $AnimationPlayer.current_animation != "RunRight":
|
||||||
$AnimationPlayer.play("RunRight")
|
$AnimationPlayer.play("RunRight")
|
||||||
elif moveMotion < 0:
|
elif moveMotion < 0:
|
||||||
$AnimationPlayer.playback_speed = abs(motion)/200
|
$AnimationPlayer.playback_speed = abs(motion)/100
|
||||||
if $AnimationPlayer.current_animation != "RunLeft":
|
if $AnimationPlayer.current_animation != "RunLeft":
|
||||||
$AnimationPlayer.play("RunLeft")
|
$AnimationPlayer.play("RunLeft")
|
||||||
else:
|
else:
|
||||||
@ -111,20 +142,27 @@ func user_input():
|
|||||||
|
|
||||||
# Move down platforms
|
# Move down platforms
|
||||||
if is_on_floor() and Input.is_action_just_pressed("ui_up") and Input.is_action_pressed("ui_down"):
|
if is_on_floor() and Input.is_action_just_pressed("ui_up") and Input.is_action_pressed("ui_down"):
|
||||||
var test_pos = Vector2(position.x,position.y+5)
|
var test_pos = Vector2(position.x,position.y+6)
|
||||||
if not test_move(Transform2D(0,test_pos), Vector2(0,1)):
|
if not test_move(Transform2D(0,test_pos), Vector2(0,1)):
|
||||||
position.y = position.y + 1
|
position.y = position.y + 2
|
||||||
return
|
return
|
||||||
|
|
||||||
# Jumping
|
# Jumping
|
||||||
if(is_on_floor() and Input.is_action_just_pressed("ui_up")):
|
if(test_move(transform, Vector2(0,1)) and Input.is_action_just_pressed("ui_up")):
|
||||||
jumped = true
|
jumped = true
|
||||||
|
|
||||||
# Move left and right <- & ->
|
# Move left and right <- & ->
|
||||||
|
# - - - - - - - - - - - - - - -
|
||||||
|
var movementModifier = 1
|
||||||
|
|
||||||
|
if not test_move(transform, Vector2(0,1)):
|
||||||
|
movementModifier = 0.5
|
||||||
|
|
||||||
|
# Movement input
|
||||||
if(Input.is_action_pressed("ui_left")):
|
if(Input.is_action_pressed("ui_left")):
|
||||||
moveMotion = -moveAcceleration
|
moveMotion = -moveAcceleration * movementModifier
|
||||||
if(Input.is_action_pressed("ui_right")):
|
if(Input.is_action_pressed("ui_right")):
|
||||||
moveMotion = moveAcceleration
|
moveMotion = moveAcceleration * movementModifier
|
||||||
if is_on_floor() and (!Input.is_action_pressed("ui_left") and !Input.is_action_pressed("ui_right")):
|
if is_on_floor() and (!Input.is_action_pressed("ui_left") and !Input.is_action_pressed("ui_right")):
|
||||||
if moveMotion > 0:
|
if moveMotion > 0:
|
||||||
moveMotion = clamp(moveMotion - moveFriction, 0, moveMotion)
|
moveMotion = clamp(moveMotion - moveFriction, 0, moveMotion)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
extends CanvasLayer
|
extends CanvasLayer
|
||||||
|
|
||||||
|
signal screen_fade_complete
|
||||||
|
|
||||||
var in_dialog = false
|
var in_dialog = false
|
||||||
var tip_timer : Timer
|
var tip_timer : Timer
|
||||||
var zone_timer : Timer
|
var zone_timer : Timer
|
||||||
@ -14,6 +16,7 @@ func _ready():
|
|||||||
$Dialog.hide()
|
$Dialog.hide()
|
||||||
$Tip.hide()
|
$Tip.hide()
|
||||||
$ZoneLabel.hide()
|
$ZoneLabel.hide()
|
||||||
|
$Fader.connect("fade_complete", self, "_on_screen_fade_complete")
|
||||||
|
|
||||||
func is_in_dialog():
|
func is_in_dialog():
|
||||||
return in_dialog or $Dialog.is_visible_in_tree()
|
return in_dialog or $Dialog.is_visible_in_tree()
|
||||||
@ -111,3 +114,9 @@ func fade_zone_out():
|
|||||||
$ZoneLabel.modulate.a = clamp($ZoneLabel.modulate.a - 0.1, 0, 1)
|
$ZoneLabel.modulate.a = clamp($ZoneLabel.modulate.a - 0.1, 0, 1)
|
||||||
if $ZoneLabel.modulate.a == 0:
|
if $ZoneLabel.modulate.a == 0:
|
||||||
zone_timer.stop()
|
zone_timer.stop()
|
||||||
|
|
||||||
|
func fade_screen(seconds = 1, fade_in=true):
|
||||||
|
$Fader.fade(seconds, fade_in)
|
||||||
|
|
||||||
|
func _on_screen_fade_complete():
|
||||||
|
emit_signal("screen_fade_complete")
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 186 KiB |
Reference in New Issue
Block a user