Discuss Scratch

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.
Candy_Jess_Husky
Scratcher
100+ posts

movement

Edit: My last answer was wrong. I've checked out the project, here's the real one.

In the forever loop where it checks if the ‘y position’ is equal to -160, change it to -161.

if <(y position) = [-161]> then
change x by (10)
end

Last edited by Candy_Jess_Husky (Sept. 21, 2021 07:56:21)


Supreme_Weeb
Scratcher
51 posts

movement

deck26 wrote:

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.
it needs to be at that specific position (give or take a couple numbers) so starting it at -100 is way too high up
deck26
Scratcher
1000+ posts

movement

Supreme_Weeb wrote:

deck26 wrote:

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.
it needs to be at that specific position (give or take a couple numbers) so starting it at -100 is way too high up
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.

Last edited by deck26 (Sept. 21, 2021 16:00:27)

Powered by DjangoBB