#Enemy bounces off right wall but not the left wall

11 messages · Page 1 of 1 (latest)

lapis ferry
#

When switching direction, use *= instead of =

#

So velocity.x *= -1

round geyser
#

that makes the enemy stand still when it hits a wall but the sprite fips

#

flips

#

I'b

#

I've tried adding * to the other lines, no dice

lapis ferry
#

Add some prints so you can see what's going on. My guess is it must be detecting the wall too often

round geyser
#

I think it's because its

#

not rerunning the wall code

#

if is on wall do this and then what?

#

if is_on_wall():
direction = 1
velocity.x = -1
$AnimatedSprite3d.flip_h = false

else:
        direction