Slight UI tweaks; Some Fish Cascade Fixes
This commit is contained in:
@@ -1,16 +1,37 @@
|
||||
extends AnimatedSprite2D
|
||||
extends CharacterBody2D
|
||||
|
||||
var speed = 10
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
play('stand')
|
||||
$FishTux.play('stand')
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
func _process(delta: float):
|
||||
var velocity = Vector2.ZERO
|
||||
var speed = 301
|
||||
velocity.x += 0
|
||||
|
||||
if velocity.x > 0:
|
||||
velocity = velocity.normalized() * speed
|
||||
if speed > 300:
|
||||
$FishTux.play('run')
|
||||
$FishTux.scale.x = 1
|
||||
else:
|
||||
$FishTux.play('walk')
|
||||
$FishTux.scale.x = 1
|
||||
elif velocity.x < 0:
|
||||
velocity = velocity.normalized() * speed
|
||||
if speed > 300:
|
||||
$FishTux.play('run')
|
||||
$FishTux.scale.x = -1
|
||||
else:
|
||||
$FishTux.play('walk')
|
||||
$FishTux.scale.x = -1
|
||||
else:
|
||||
$FishTux.play('stand')
|
||||
|
||||
|
||||
position += velocity * delta
|
||||
position = position.clamp(Vector2.ZERO, get_viewport_rect().size)
|
||||
|
||||
func movetofish(loc):
|
||||
Vector2(loc, 660)
|
||||
|
||||
Reference in New Issue
Block a user