Discuss Scratch

kaylorb
Scratcher
100+ posts

My diep.io shapes wont move right!

I am trying to make a diep.io game but I cant get this right

whenclickedforevergotox:scrollxy:scrolly
the shapes stay in the middle. how do I put them in a random place?
the link is https://scratch.mit.edu/projects/151809052/

thank you
Leleo
Scratcher
2 posts

My diep.io shapes wont move right!

I'm not really sure what you want, but you could just use the
setscrollxtopickrandom0to140
and
setscrollytopickrandom0to140

or whatever value you want and then place the object on that variable.
kaylorb
Scratcher
100+ posts

My diep.io shapes wont move right!

well that would work if the background was not on the scrollx scrolly also.
drmcw
Scratcher
1000+ posts

My diep.io shapes wont move right!

Surely scrollx and scrolly is the camera position? What is the shape's position in the world? When you know that then just subtract the camera position and go there!
kaylorb
Scratcher
100+ posts

My diep.io shapes wont move right!

drmcw wrote:

Surely scrollx and scrolly is the camera position? What is the shape's position in the world? When you know that then just subtract the camera position and go there!
that does not work too well
drmcw
Scratcher
1000+ posts

My diep.io shapes wont move right!

Then you're doing it wrong. Just had a look and pos x and pos y are global. They should be local to work for clones.
kaylorb
Scratcher
100+ posts

My diep.io shapes wont move right!

thanks!!!

Powered by DjangoBB