Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » movement
- Supreme_Weeb
- Scratcher
51 posts
movement
when an enemy sprite hits the bottom of the screen (y=-160 specifically) I want it to move left to right. I have it to where forever if y position = -160 then move x by 10, but nothing happens it just stops moving.
- deck26
- Scratcher
1000+ posts
movement
Best if you share the project. Using a less than block to check the y position may be a better option than using an equals block. You can try triggering it at -100 and gradually move further down if that works.
- Supreme_Weeb
- Scratcher
51 posts
movement
it needs to be at that specific position (give or take a couple numbers) so starting it at -100 is way too high up Best if you share the project. Using a less than block to check the y position may be a better option than using an equals block. You can try triggering it at -100 and gradually move further down if that works.
- deck26
- Scratcher
1000+ posts
movement
The point is that tests the script! If your sprtie never actually reaches -160 you might not realise it. By testing a less extreme value you test that the script works and then adjust the value.it needs to be at that specific position (give or take a couple numbers) so starting it at -100 is way too high up Best if you share the project. Using a less than block to check the y position may be a better option than using an equals block. You can try triggering it at -100 and gradually move further down if that works.
Last edited by deck26 (Sept. 21, 2021 16:00:27)
- Discussion Forums
- » Help with Scripts
- » movement