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)
w…
And I’ve created an example as well: https://github.com/britzl/publicexamples/tree/master/examples/rotate_and_move