sed magic: fixeth the great 'boundry' misprint
This commit is contained in:
parent
342c333e61
commit
7020914046
7 changed files with 113 additions and 113 deletions
|
@ -1,8 +1,8 @@
|
|||
extends "res://objects/enemy/enemy.gd"
|
||||
|
||||
#How far to move
|
||||
export var left_up_boundry = 0.0
|
||||
export var right_down_boundry = 0.0
|
||||
export var left_up_boundary = 0.0
|
||||
export var right_down_boundary = 0.0
|
||||
#Start direction
|
||||
export var direction = 1
|
||||
export var speed = 50
|
||||
|
@ -14,8 +14,8 @@ onready var startpos = position
|
|||
onready var sprite = $AnimatedSprite
|
||||
|
||||
func _ready():
|
||||
left_up_boundry *= 8
|
||||
right_down_boundry *= 8
|
||||
left_up_boundary *= 8
|
||||
right_down_boundary *= 8
|
||||
|
||||
func _physics_process(delta):
|
||||
if move_direction == 0:
|
||||
|
@ -26,10 +26,10 @@ func move_side_to_side(delta):
|
|||
#Move
|
||||
position.x += direction * (speed * delta)
|
||||
#Switch dir
|
||||
if position.x >= startpos.x + (right_down_boundry):
|
||||
if position.x >= startpos.x + (right_down_boundary):
|
||||
direction = -1
|
||||
if flip_sprite == true: sprite.scale.x = -1
|
||||
if position.x <= startpos.x + (-left_up_boundry):
|
||||
if position.x <= startpos.x + (-left_up_boundary):
|
||||
direction = 1
|
||||
if flip_sprite == true: sprite.scale.x = 1
|
||||
|
||||
|
@ -37,9 +37,9 @@ func move_up_and_down(delta):
|
|||
#Move
|
||||
position.y += direction * (speed * delta)
|
||||
#Switch dir
|
||||
if position.y >= startpos.y + (right_down_boundry):
|
||||
if position.y >= startpos.y + (right_down_boundary):
|
||||
direction = -1
|
||||
if flip_sprite == true: sprite.scale.y = 1
|
||||
if position.y <= startpos.y + (-left_up_boundry):
|
||||
if position.y <= startpos.y + (-left_up_boundary):
|
||||
direction = 1
|
||||
if flip_sprite == true: sprite.scale.y = -1
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
extends "res://objects/enemy/enemy.gd"
|
||||
|
||||
#How far to move
|
||||
export var left_up_boundry = 0.0
|
||||
export var right_down_boundry = 0.0
|
||||
export var left_up_boundary = 0.0
|
||||
export var right_down_boundary = 0.0
|
||||
#Start direction
|
||||
export var direction = 1
|
||||
export var slower_speed = 50
|
||||
|
@ -42,10 +42,10 @@ func move_side_to_side(delta):
|
|||
#Move
|
||||
position.x += direction * (speed * delta)
|
||||
#Switch dir
|
||||
if position.x >= startpos.x + (right_down_boundry * 8):
|
||||
if position.x >= startpos.x + (right_down_boundary * 8):
|
||||
direction = -1
|
||||
if flip_sprite == true: sprite.scale.x = -1
|
||||
if position.x <= startpos.x + (-left_up_boundry * 8):
|
||||
if position.x <= startpos.x + (-left_up_boundary * 8):
|
||||
direction = 1
|
||||
if flip_sprite == true: sprite.scale.x = 1
|
||||
|
||||
|
@ -53,10 +53,10 @@ func move_up_and_down(delta):
|
|||
#Move
|
||||
position.y += direction * (speed * delta)
|
||||
#Switch dir
|
||||
if position.y >= startpos.y + (right_down_boundry * 8):
|
||||
if position.y >= startpos.y + (right_down_boundary * 8):
|
||||
direction = -1
|
||||
if flip_sprite == true: sprite.scale.y = 1
|
||||
if position.y <= startpos.y + (-left_up_boundry * 8):
|
||||
if position.y <= startpos.y + (-left_up_boundary * 8):
|
||||
direction = 1
|
||||
if flip_sprite == true: sprite.scale.y = -1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue