Hi,
I’m starting to play with Defold. I’m trying to understand a simple thing.
I have 2 objects: Fish and Fish1 and a script
function init(self)
go.property("speed", 8)
msg.post(".", "acquire_input_focus")
go.animate(".", "euler.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 60/self.speed)
end
function on_input(self, action_id, action)
if action_id == hash("touch") and action.pressed then
self.speed=self.speed+20
go.cancel_animations("fish1", "euler.z")
go.animate("fish1", "euler.z", go.PLAYBACK_LOOP_FORWARD, 360, go.EASING_LINEAR, 60/self.speed)
end
end
I wish fish1 would spin faster with each click. But it doesn’t. Why?