Discuss Scratch

RaptorSkyraider
Scratcher
50 posts

How to make my game scroll

I have a game where there are lots of clones, how do I make the clones scroll behind the screen if you don't collect them, (FYI the game I am making is Agar.io)
AMA_Tutor
Scratcher
11 posts

How to make my game scroll

like this?
when I start as a clone
if <not <touching [sprite v] ?>> then
point in direction (pick random (-360) to (360)
repeat until <touching [sprite v] >
move (1) steps
end
end
RaptorSkyraider
Scratcher
50 posts

How to make my game scroll

AMA_Tutor wrote:

like this?
when I start as a clone
if <not <touching [sprite v] ?>> then
point in direction (pick random (-360) to (360)
repeat until <touching [sprite v] >
move (1) steps
end
end
I will try
RaptorSkyraider
Scratcher
50 posts

How to make my game scroll

RaptorSkyraider wrote:

AMA_Tutor wrote:

like this?
when I start as a clone
if <not <touching [sprite v] ?>> then
point in direction (pick random (-360) to (360)
repeat until <touching [sprite v] >
move (1) steps
end
end
I will try
I did not work, if you play the game, when the dots spawn, try to make it go off the screen, it gets caught half-way behind the edge of the screen.
mstone326
Scratcher
1000+ posts

How to make my game scroll

So at that point hide the sprite, Scratch won't allow sprites to go completely off screen. It always leaves 5 pixels of the sprite on screen. Create some parameters to decide if the item is on screen or not and if it is on screen show or else hide the sprite.
RaptorSkyraider
Scratcher
50 posts

How to make my game scroll

mstone326 wrote:

So at that point hide the sprite, Scratch won't allow sprites to go completely off screen. It always leaves 5 pixels of the sprite on screen. Create some parameters to decide if the item is on screen or not and if it is on screen show or else hide the sprite.
good idea thanks!
mstone326
Scratcher
1000+ posts

How to make my game scroll

RaptorSkyraider
Scratcher
50 posts

How to make my game scroll

So, now I have made it so that when it is touching the edge wait 0.5 seconds then hide, but when ever one spawns it just disapears, here is the code for the food
when green flag clicked
hide
forever
wait (3) secs
change [color v] effect by (25)
create clone of [Food v]
end
when I start as a clone
forever
if <touching [edge v] ?> then

wait (0.5) secs
hide
end
end
when I start as a clone
show
go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
forever
change x by ((mouse x) * (-0.01))
change y by ((mouse y) * (-0.01))
if <touching [Agar.io v] ?> then

wait (0.01) secs
delete this clone
end
end
RaptorSkyraider
Scratcher
50 posts

How to make my game scroll

RaptorSkyraider wrote:

So, now I have made it so that when it is touching the edge wait 0.5 seconds then hide, but when ever one spawns it just disappears without ever staying on the screen, here is the code for the food
when green flag clicked
hide
forever
wait (3) secs
change [color v] effect by (25)
create clone of [Food v]
end
when I start as a clone
forever
if <touching [edge v] ?> then

wait (0.5) secs
hide
end
end
when I start as a clone
show
go to x: (pick random (-240) to (240)) y: (pick random (-180) to (180))
forever
change x by ((mouse x) * (-0.01))
change y by ((mouse y) * (-0.01))
if <touching [Agar.io v] ?> then

wait (0.01) secs
delete this clone
end
end
powercon5
Scratcher
1000+ posts

How to make my game scroll

RaptorSkyraider
Scratcher
50 posts

How to make my game scroll

I think I got it to work, see what you thinkClick please

Powered by DjangoBB