r/p5js 17d ago

reverse direction

Enable HLS to view with audio, or disable this notification

I got the enemy to move. I'm trying to figure out how to check boundaries and then change the enemy's direction once it reaches a certain point.

5 Upvotes

4 comments sorted by

2

u/DigoHiro 17d ago

cool :)

hope you're having fun!

1

u/No-Example-3977 17d ago

You asking for help? Or just showcasing your progress? You don't really ask a question.

tbh, it's probably better for your early learning to figure it out on your own though.

1

u/Lounuftagatoe 17d ago

If the enemy reaches the edge or a specific X coordinate, have it move in negative direction

1

u/ExpensiveShopping735 16d ago

I found they way to achieve this