Hello❤️, in this game there are squares that produce numbers and other squares that perform mathematical operations when two numbers are connected to them. I do not know how to determine the values of the numbers? I need help to develop a mechanism for determining the values of the text at each stage. For a project, numbers are generated at the point where a point on the path touches the production square, and when the number collides with a part of the addition square, for example, it is deleted. The addition square is divided into three parts. There are squares under each square, one for arithmetic a, b, and a+b. What is the best mechanism for backing values? This is a link to the game beltmatic, which I want to make like it.https://youtu.be/ySm7ikL0gSI?si=hRfRFs6aijGW1dZR
I know i told you to come here and ask
BUT you did not explain it well on how it should work
And this video explain a lot more
And by looking at it most stupid but yet most effective way to do it
Would be for your blocks to have each animation from different number
FOR EXAMPLE
Animation 0 which is first should be blank
But animation 1 should have image of black block with 1
Animation 2 should have image of black block with 2
And so go on
You could go with one lank image of block and just attach to it text object
BUT performance wise you will want to have these animations
(idk how massive your game will be but looking at this video there are A LOT of moving objects and moving SO MANY text objects could generate lag easily however you could try it if you want using object linking and now each block would have just variable you would set to some number and now you would set text linked to that object to that variable)
ANYWAY if you would went with animations
My biggest problem was you could not go easily with doing more than one calculation at a time
But since you always have there A and B and not A and B and C or more
Then you would be fine
There is expression to check objects animation index
So you could totally get away with passing that to equation
If green (add) square ObjectA is in collision with black (number square) set VariableA of green square to animation index
If green square ObjectB is in collision with black square set green object VariableB to black square animation index
And now you have both values saved into 2 variables
NOW you could simply have event to change VariableOutput (which would be what green object spits out) VairableA+VariableB
And now when you produce black number squares OUT OF green square so you create number black square object you also can set its animation to VariableA+VariableB of green square object
But now you face another problem
If green square is one object then how you determine what hits A and what hits B on it?
Gdevelop does not support separate collision mask like you can have many collision mask on one object but they are all considered as ONE collision mask
Like you can check if something is in collision with green square but that will be checking if somethings collide with ANY of green square collision mask
MAYBE you could get away with making custom points in green square
And then check if black square object is inside of point of green square
AND AGAIN
What you want to achieve is easy when you have only A and B on your green square
If there would be A and B and C or even more variables
That would be problematic
Try out what i told you and decide which path you wanna go
Is it a game based on calculator you are doing?
Xierra
I WILL DO THAT > THANKS