## Welcome!

You are just one step away from creating awesome games!

You need a Google account to use Defold

# Moving game object

This example shows how to move a game object.

`simple move.script`

``````function init(self)
self.center = vmath.vector3(360, 360, 0)
self.speed = 2
self.t = 0
end

function update(self, dt)
self.t = self.t + dt
local dx = math.sin(self.t * self.speed) * self.radius
local dy = math.cos(self.t * self.speed) * self.radius
local pos = vmath.vector3()
pos.x = self.center.x + dx
pos.y = self.center.y + dy
go.set_position(pos)
end
``````
1. Store the center of rotation in the script instance (available through `self`).
5. Increase the elapsed time with `dt`, the delta time elapsed since last call to `update()`.
6. Compute offsets along the X and Y axis. We’re using `sinus` and `cosinus` of the current time, scaled with `self.speed`, which will plot points along a circle with radius `self.radius`.
7. Create a new `vector3` which will contain the computed position.
8. Set the `x` and `y` components of the vector to the rotation center plus offsets along X and Y axis.