MetalZelda: It is really nice your animation

.

You can still combine your random movement with a circle movement, if you want more precision. For instance, you could use something like this (the code is untested, so it can surely be improved and there might be mistakes):

`local cx, cy = hero:get_position() -- Define center position here.`

local r = 8 -- Define circle radius here (in pixels).

local angular_speed = 2*math.pi/1000 -- In radians per millisecond (it can be negative).

local init_angle = math.pi/2 -- Initial angle.

-- Function to return position for each time instant.

-- (Time variable must be given in milliseconds.)

local function f(t)

local angle = init_angle + t*angular_speed

local x = cx + r*math.cos(angle)

local y = cy + r*math.sin(angle)

return math.floor(x), math.floor(y)

end

You can call that function from a timer looped each millisecond, which changes the position of the moving magic.

For more customization, you can define a function that modifies the radius and the angular speed depending on the time, make the angular movement accelerate/decelerate, or whatever you can imagine.