I wrote my script and it didnt work. I cant find mistake.
And also i have problem when i move one of my objects and it colides with other i began to move and this object. I want that when i move one object others were disabled to move.
Two things this might or might not help but rotation in defold is done in radians not degrees plus when you reference your rotate bool you misspelled it as rotat
I corected mistakes but i also cant rotate object. When i press to fingers on the screen nothing happened.
britzl
August 24, 2016, 7:20pm
6
Have you searched the forum? Rotating game objects has been discussed several times:
Okay so i have a rotating sprite i can get access to the rotation values but im lost on how to make it move forward in the rotated angle sure to be some math calculation in defold for making this part simple,
Also wondering how to make a sprite appear and disappear from a function also simple once you know how i guess.
Kind regards,
A.
I want to rotate an object 90 degrees, the object is facing upwards and I want it animating to the right, I have this code in “init” :
go.animate(".", "rotation", go.PLAYBACK_ONCE_FORWARD, vmath.quat_rotation_z(-90), go.EASING_LINEAR, 4)
But when I run, it gives me weird behaviour, it acts as if it’s moving away (scaling down) and then it goes back, rotate to opposite direction, I don’t really understand what’s going on.
Hi,
I am having a problem using the euler.z for rotation. I am making a Tetris clone for the purpose of learning the Defold framework.
See the following gif:
http://makeagif.com/i/7QMgRt
The rotation is fine for the first 2 clicks, where the brick went clockwise -90deg and -180deg, but when it is -270deg it suddenly rotate anti clockwise instead. I have no idea how to fix this.
My code is below.
go.animate(“brick”, “euler.z”, go.PLAYBACK_ONCE_FORWARD, -90*x, go.EASING_LINEAR, 0.5)
where x…
And I’ve created an example as well: publicexamples/examples/rotate_and_move at master · britzl/publicexamples · GitHub