Fixed comments in kinematic_char demo
This commit is contained in:
parent
d21f72adf2
commit
5b6773f6bc
|
@ -1,12 +1,12 @@
|
||||||
|
|
||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
# member variables here, example:
|
#member variables here, example:
|
||||||
# var a=2
|
#var a=2
|
||||||
# var b="textvar"
|
#var b="textvar"
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
# Initalization here
|
#Initalization here
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
|
|
||||||
extends KinematicBody2D
|
extends KinematicBody2D
|
||||||
|
|
||||||
# This is a simple collision demo showing how
|
#This is a simple collision demo showing how
|
||||||
# the kinematic cotroller works.
|
#the kinematic cotroller works.
|
||||||
# move() will allow to move the node, and will
|
#move() will allow to move the node, and will
|
||||||
# always move it to a non-colliding spot,
|
#always move it to a non-colliding spot,
|
||||||
# as long as it starts from a non-colliding spot too.
|
#as long as it starts from a non-colliding spot too.
|
||||||
|
|
||||||
|
|
||||||
#pixels / second
|
#pixels / second
|
||||||
const GRAVITY = 500.0
|
const GRAVITY = 500.0
|
||||||
|
|
||||||
# Angle in degrees towards either side that the player can
|
#Angle in degrees towards either side that the player can
|
||||||
# consider "floor".
|
#consider "floor".
|
||||||
const FLOOR_ANGLE_TOLERANCE = 40
|
const FLOOR_ANGLE_TOLERANCE = 40
|
||||||
const WALK_FORCE = 600
|
const WALK_FORCE = 600
|
||||||
const WALK_MAX_SPEED = 200
|
const WALK_MAX_SPEED = 200
|
||||||
|
@ -68,7 +68,6 @@ func _fixed_process(delta):
|
||||||
var motion = velocity * delta
|
var motion = velocity * delta
|
||||||
|
|
||||||
#move and consume motion
|
#move and consume motion
|
||||||
#
|
|
||||||
motion = move(motion)
|
motion = move(motion)
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,9 +84,9 @@ func _fixed_process(delta):
|
||||||
floor_velocity=get_collider_velocity()
|
floor_velocity=get_collider_velocity()
|
||||||
#velocity.y=0
|
#velocity.y=0
|
||||||
|
|
||||||
# But we were moving and our motion was interrupted,
|
#But we were moving and our motion was interrupted,
|
||||||
# so try to complete the motion by "sliding"
|
#so try to complete the motion by "sliding"
|
||||||
# by the normal
|
#by the normal
|
||||||
motion = n.slide(motion)
|
motion = n.slide(motion)
|
||||||
velocity = n.slide(velocity)
|
velocity = n.slide(velocity)
|
||||||
|
|
||||||
|
@ -109,7 +108,7 @@ func _fixed_process(delta):
|
||||||
prev_jump_pressed=jump
|
prev_jump_pressed=jump
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
# Initalization here
|
#Initalization here
|
||||||
set_fixed_process(true)
|
set_fixed_process(true)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue