Discuss Scratch

2dthignamabobber232
Scratcher
21 posts

I need help making my game switch screens when the player sprite touches the end of it

please I don't know how
ametrine_
Scratcher
1000+ posts

I need help making my game switch screens when the player sprite touches the end of it

you can do something like this:
forever
if <(x position) > [240]> then // 240 is the x position of the right edge
broadcast [next level v]
end
end
2dthignamabobber232
Scratcher
21 posts

I need help making my game switch screens when the player sprite touches the end of it

oh thank you!I will use this and give full credit and leave the credit part there forever.
2dthignamabobber232
Scratcher
21 posts

I need help making my game switch screens when the player sprite touches the end of it

tried and didn't work…because there is no block in scratch for when the sprite hits a wall specifically.do you know how to make one though.
ametrine_
Scratcher
1000+ posts

I need help making my game switch screens when the player sprite touches the end of it

2dthignamabobber232 wrote:

tried and didn't work…because there is no block in scratch for when the sprite hits a wall specifically.do you know how to make one though.
if the wall is a sprite, you can use the <touching (sprite)> block

Last edited by ametrine_ (Nov. 30, 2024 01:49:13)

Elfilin026
Scratcher
87 posts

I need help making my game switch screens when the player sprite touches the end of it

ametrine_ wrote:

you can do something like this:
forever
if <(x position) > [240]> then // 240 is the x position of the right edge
broadcast [next level v]
end
end
But Remember, Some sprites cannot surpass X240, so you have to look at the sprite's X Limit, then change it.
ametrine_
Scratcher
1000+ posts

I need help making my game switch screens when the player sprite touches the end of it

Elfilin026 wrote:

But Remember, Some sprites cannot surpass X240, so you have to look at the sprite's X Limit, then change it.
true, it should probably be >239 instead
2dthignamabobber232
Scratcher
21 posts

I need help making my game switch screens when the player sprite touches the end of it

thanks,but….what event block do I use for it?
ametrine_
Scratcher
1000+ posts

I need help making my game switch screens when the player sprite touches the end of it

2dthignamabobber232 wrote:

thanks,but….what event block do I use for it?
do you know how broadcasts work?
2dthignamabobber232
Scratcher
21 posts

I need help making my game switch screens when the player sprite touches the end of it

ye
ametrine_
Scratcher
1000+ posts

I need help making my game switch screens when the player sprite touches the end of it

2dthignamabobber232 wrote:

ye
then i'm sure you can figure out which event block to use for the broadcast
but, if you're talking about the event block the forever loop is attached to, just do whichever one starts your game
2dthignamabobber232
Scratcher
21 posts

I need help making my game switch screens when the player sprite touches the end of it

ok thank you!
hiimbob419
Scratcher
1 post

I need help making my game switch screens when the player sprite touches the end of it

it doesn't word
ametrine_
Scratcher
1000+ posts

I need help making my game switch screens when the player sprite touches the end of it

hiimbob419 wrote:

it doesn't word
please make a new topic for your own issue, instead of necroposting on old ones

Powered by DjangoBB