game xbox controller, two terrains, tilmaplayer, physics, worked in gimp
This commit is contained in:
1 parent
e24a881958
commit
c3ab17230b
14 files changed
+594
-9
No files matched your search
@@ -5,7 +5,7 @@ signal destroySignal(body)
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
get_window().grab_focus()
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
||||
+4
-4
@@ -63,14 +63,14 @@ func handle_input()->void:
|
||||
#shove left
|
||||
pushTarget.apply_central_impulse(Vector2(-1,0) * shove_power )
|
||||
# Handle jump.
|
||||
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
|
||||
if Input.is_action_just_pressed("jump") and is_on_floor():
|
||||
velocity.y = JUMP_VELOCITY
|
||||
current_player_state=PlayerStates.JUMPING
|
||||
upJump = true
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
direction = Input.get_axis("ui_left", "ui_right")
|
||||
direction = Input.get_axis("left", "right")
|
||||
func handle_movement()->void:
|
||||
if direction:
|
||||
velocity.x = direction * SPEED
|
||||
@@ -94,7 +94,7 @@ func handle_collisions()->void:
|
||||
print("Something on my right")
|
||||
#get the thing I can shove
|
||||
var collider = right_cast.get_collider()
|
||||
if collider is Node:
|
||||
if collider is RigidBody2D:
|
||||
pushRightEnabled = true
|
||||
pushTarget = collider
|
||||
else:
|
||||
@@ -103,7 +103,7 @@ func handle_collisions()->void:
|
||||
if left_cast.is_colliding():
|
||||
print("Something on my left")
|
||||
var collider = left_cast.get_collider()
|
||||
if collider is Node:
|
||||
if collider is RigidBody2D:
|
||||
pushLeftEnabled = true
|
||||
pushTarget = collider
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user