Hello,
Why does this algorithm doesn’t work in gdevelop?
We have a circle:
Its variables:
Code:
Why doesn’t it move up and down?
regards,
Hello,
Why does this algorithm doesn’t work in gdevelop?
We have a circle:
Its variables:
Code:
Why doesn’t it move up and down?
regards,
Because the variable is not updated, Y_Pos
only gets a value once at the start.
I’ll need a couple more minutes to really answer you (I’m a beginner too), but I can say that you don’t need to use the variable here
Right. Currently the circle only moves down right? I think I follow
“y position of Circle > Circle.Y() + 100”
Would move down forever, yes.
Do you mean the variable cant get another value?
it can’t because you have
“at the beginning of the scene” condition
try to remove it
Nice. This should work.
The Y coordinate is inverted, meaning that higher is lower, so you actually move downwards when adding 1 to the Y.
You are changing the variable Direction to “Back”, but the next event check if it is “back”, lowercase letters and uppercase letters matter.
Can you please explain more?
I am still confused about how the gdevelop axis works!
It seems like it is not like other engines.
I can’t find any explanation or image about gdevelop axis.
If you have a link to an image or description please send me.
regards,
Thanks for your reply but this code isn’t working.
Have you tested it?
Yes, if the Direction
variable value starts with front
or back
, it works.
I see it’s working for you now👍
X:
Left = goes decreasing (below negative)
Right = goes increasing (past positive)
Y:
Up = goes decreasing (below negative)
Down = goes increasing (past positive)
. . . . . . y: -1000
. . . . . . . . . . ˆ
x: -1000 < —0— > x: +1000
. . . . . . . . . . v
. . . . . . y: +1000
You have it as set to circle.y()+1 change it to add 1 and it will move
And use subtract for the other way not set to