Tweak player movement

This commit is contained in:
2020-05-21 16:30:22 -04:00
parent 92892072e2
commit dee457a561
3 changed files with 4 additions and 6 deletions

View File

@ -9,8 +9,6 @@
[ext_resource path="res://Assets/Art/Tiles/metal_tile.png" type="Texture" id=7] [ext_resource path="res://Assets/Art/Tiles/metal_tile.png" type="Texture" id=7]
[ext_resource path="res://Assets/Art/Tiles/techno_wall_tile.png" type="Texture" id=8] [ext_resource path="res://Assets/Art/Tiles/techno_wall_tile.png" type="Texture" id=8]
[sub_resource type="OccluderPolygon2D" id=1] [sub_resource type="OccluderPolygon2D" id=1]
polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 ) polygon = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )

File diff suppressed because one or more lines are too long

View File

@ -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 = 25 var moveAcceleration : float = 125
var moveFriction : float = 65 var moveFriction : float = 65
var jumpVelocity : float = -150 var jumpVelocity : float = -150
var jumped = false var jumped = false
@ -76,9 +76,9 @@ func user_input():
return return
if(Input.is_action_pressed("ui_left")): if(Input.is_action_pressed("ui_left")):
moveMotion -= moveAcceleration moveMotion = -moveAcceleration
if(Input.is_action_pressed("ui_right")): if(Input.is_action_pressed("ui_right")):
moveMotion += moveAcceleration moveMotion = moveAcceleration
if(is_on_floor() and Input.is_action_just_pressed("ui_up")): if(is_on_floor() and Input.is_action_just_pressed("ui_up")):
motion.y = jumpVelocity motion.y = jumpVelocity