Discuss Scratch

funnypie1234
Scratcher
15 posts

Loop Around

hi, I'm trying to make “asteroids” the old aracade game, and i cant get the Loop around thigny to work!

unlocked_absolute
Scratcher
100+ posts

Loop Around

You want to make a game where asteroids can fall is it?
If that is what you want,
here’s the script:
when green flag clicked
forever
wait (pick random (4) to (10)) secs
create clone of [myself v]
end

Then put the script for the clone.
Maybe add falling motions by changing y by 10 maybe…

If I’m helping, Thank You
If I’m not helping, Tell me.
deck26
Scratcher
1000+ posts

Loop Around

Do you mean going off one side and coming in at the opposite side?
papipupepappa
Scratcher
100+ posts

Loop Around

You might want to take a look at @RokCoder's Asteroids Tutorial:
https://scratch.mit.edu/projects/388166384/
Vibrato
Scratcher
1000+ posts

Loop Around

Something like this may help:
forever
if <(x position) < [-235]> then
set x to (234)
end
if <(x position) > [235]> then
set x to (-234)
end
if <(y position) < [-175]> then
set y to (174)
end
if <(y position) > [175]> then
set y to (-174)
end
end
But you may need to tweak some numbers
funnypie1234
Scratcher
15 posts

Loop Around

deck26 wrote:

Do you mean going off one side and coming in at the opposite side?
Yes, that is what i mean, like the clasic aracade game
funnypie1234
Scratcher
15 posts

Loop Around

Vibrato wrote:

Something like this may help:
forever
if <(x position) < [-235]> then
set x to (234)
end
if <(x position) > [235]> then
set x to (-234)
end
if <(y position) < [-175]> then
set y to (174)
end
if <(y position) > [175]> then
set y to (-174)
end
end
But you may need to tweak some numbers
I have tried that already… the problem is that it glitches sometimes and for some reason some of the edges dont work well. my game requires up arrow to move forward, and left and right arrows to turn. hope that information helps!
funnypie1234
Scratcher
15 posts

Loop Around

papipupepappa wrote:

You might want to take a look at @RokCoder's Asteroids Tutorial:
https://scratch.mit.edu/projects/388166384/
problem! im not allowed to use Youtube
deck26
Scratcher
1000+ posts

Loop Around

funnypie1234 wrote:

Vibrato wrote:

Something like this may help:
forever
if <(x position) < [-235]> then
set x to (234)
end
if <(x position) > [235]> then
set x to (-234)
end
if <(y position) < [-175]> then
set y to (174)
end
if <(y position) > [175]> then
set y to (-174)
end
end
But you may need to tweak some numbers
I have tried that already… the problem is that it glitches sometimes and for some reason some of the edges dont work well. my game requires up arrow to move forward, and left and right arrows to turn. hope that information helps!
Shouold just be a case of fine tuing the values. Please try it and share if it isn'#t working so we can identify the problem.
Oumuamua
Scratcher
1000+ posts

Loop Around

Hi, i have not idea about you expect it must look… you just try this:



Sorry,i forgot to say that those x and y coordinates can vary depending sprites dimensions.

Last edited by Oumuamua (July 3, 2020 21:10:18)

Powered by DjangoBB