i am using the newest avable version on steam. Dont know the exakt version of it but i think its not the new 4.0 version.
Theres no real error message. When i start the game its a black screen and it says under the code "error(19,1): Unexpected indentation".
extends KinematicBody2D
export(int) var JUMP_FORCE = -130
export(int) var JUMP_RELEAS_FORCE = -70
export(int) var MAX_SPEED = 50
export(int) var ACCELERATION = 10
export(int) var FRICTION = 10
export(int) var GRAVITY = 4
export(int) var ADITIONAL_FALL_GRAVITY = 4
var velocity = Vector2.ZERO
func _physics_process(delta):
apply_gravity()
var input = Vector2.ZERO
input.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
if input.x == 0:
apply_friction()
else:
apply_acceleration(input.x)
if is_on_floor():
if Input.is_action_pressed("ui_up"):
velocity.y = JUMP_FORCE
else:
if Input.is_action_just_released("ui_up") and velocity.y < JUMP_RELEAS_FORCE:
velocity.y = JUMP_RELEAS_FORCE
if velocity.y > 0:
velocity .y += ADITIONAL_FALL_GRAVITY
velocity = move_and_slide(velocity, Vector2.UP)
func apply_gravity():
velocity.y += GRAVITY
func apply_friction():
velocity.x = move_toward(velocity.x, 0, FRICTION)
func apply_accaleration(amount):
velocity.x = move_toward(velocity.x, MAX_SPEED * amount, ACCELERATION )
thats the status of the code from the tutorial now