Discuss Scratch

EmerGuyIsHere
Scratcher
28 posts

Coordinate system using clones

So, i have a 11 by 4 grid of tile, the center top needs to be 0, and the rest from there.
I am trying to figure out an id system to rederect every tile to a ceratin item on the list with all my blocks, which would be the “X_Y_” Value.
I am using this to have items and structures have a coordinate to refer to.
The project;
Project
Jareddddddd
Scratcher
1000+ posts

Coordinate system using clones

theres 2 things you can do
1 - Render each frame
(laggy, but easy)
You create a clone for each item in the list every frame.
2 - Create permanent clones
You create clones with IDs that correspond to the item they read from.
By creating a variable that is “for this sprite only”, each clone gets their own copy of that variable when it is created. You can use this to give each clone their own data.
ex shown here: https://scratch.mit.edu/projects/741043035/
EmerGuyIsHere
Scratcher
28 posts

Coordinate system using clones

I tried somthing, but the coordinites it gave were far from inaccurate.
How do i fix this?

Last edited by EmerGuyIsHere (Oct. 6, 2022 13:18:00)

deck26
Scratcher
1000+ posts

Coordinate system using clones

This just sounds like basic grid system which is not hard to do. Am I correct that you just want to work out which grid cell you're in given a pair of x,y coordinates?

If you give more info such as how the grid is numbered (starting top left and recording row by row, for example?) and the size of the grid cells I can give you more details.

For some purposes it may suit you to refer to the top centre cell as 0 but when linking to a list you want one of the corner cells to link to 1 as the lowest value.

Powered by DjangoBB