Discuss Scratch

cs2411456
Scratcher
41 posts

How do i make the background endless for agar.io

I have been making a substitute for agar.io, but i find it really annoying when it goes off the background. I have tried multiple thing, such as creating clones of the background, or changing the size, but it just wont work. Please help me!
drchubbington
Scratcher
100+ posts

How do i make the background endless for agar.io

Pen is the answer. You have to draw a grid for the background, so you can do this:


Here is the example:
https://scratch.mit.edu/projects/299057888/
For reference only; this won't work for your project.

Here's how to do it to satisfy your own needs:

Say you are spacing your lines 20 pixels apart, and you have two variables called ScrollX and ScrollY to mark the offset of the character.

Create a myblock with “run without screen refresh” checked
define Draw grid with offset (x) (y) (spacing)
set [Var v] to (0)
repeat ((480)/(spacing))
go to x: (((-240)+((Var)*(spacing)))+((x)mod(spacing))) y: (180)
pen down
set y to (-180)
pen up
change [Var v] by (1)
end
set [Var v] to (0)
repeat ((360)/(spacing))
go to x: (-240) y: (((-180)+((Var)*(spacing)))+((y)mod(spacing)))
pen down
set x to (240)
pen up
change [Var v] by (1)
end
Then make the script:
when I receive [Start Game v]
forever
clear
Draw grid with offset (ScrollX) (ScrollY) (Your spacing)
end
Sorry for the red block; I haven't figured out how to make scratch recognize it as a MyBlock yet.

Last edited by drchubbington (April 1, 2019 22:53:59)

cs2411456
Scratcher
41 posts

How do i make the background endless for agar.io

Thanks, Ill try it! Totally helped :-)
drchubbington
Scratcher
100+ posts

How do i make the background endless for agar.io

No problem! Let me know if you have any troubles extra things you need for the grid!
bS5M8ExK
Scratcher
21 posts

How do i make the background endless for agar.io

thanks
when green flag clicked
forever
(thanks!)
say [thanks] for (2) secs
end
bS5M8ExK
Scratcher
21 posts

How do i make the background endless for agar.io

define Thanks
say [THANKSSS!]
bS5M8ExK
Scratcher
21 posts

How do i make the background endless for agar.io

be awsome!
DUYdeptrai2019
Scratcher
93 posts

How do i make the background endless for agar.io

bS5M8ExK wrote:

define Thanks
say [THANKSSS!]
please dont necropost, this topic is 1 years old
drchubbington
Scratcher
100+ posts

How do i make the background endless for agar.io

Lol I got a notification from that
bS5M8ExK
Scratcher
21 posts

How do i make the background endless for agar.io

when green flag clicked
forever
Be happy,Be awsome
set [ happiness ] to [Infinity]
end
_Polygon
Scratcher
16 posts

How do i make the background endless for agar.io

I tried it, but it didn't work.
bS5M8ExK
Scratcher
21 posts

How do i make the background endless for agar.io

DUYdeptrai2019 wrote:

bS5M8ExK wrote:

define Thanks
say [THANKSSS!]
please dont necropost, this topic is 1 years old
Okay thanks

Powered by DjangoBB