Rendering a moving square entirely from lua.
This commit is contained in:
@@ -1 +1,28 @@
|
||||
print('Initial scene')
|
||||
module('spritebatch')
|
||||
module('time')
|
||||
|
||||
x = 0.0
|
||||
y = 0.0
|
||||
|
||||
function sceneDispose()
|
||||
-- print('Disposing initial scene')
|
||||
end
|
||||
|
||||
function sceneUpdate()
|
||||
-- print('Updating initial scene')
|
||||
x = x + TIME.delta * 10.0
|
||||
y = y + TIME.delta * 10.0
|
||||
end
|
||||
|
||||
function sceneRender()
|
||||
-- print('Rendering initial scene')
|
||||
x1 = x + 32
|
||||
y1 = y + 32
|
||||
spriteBatchPush(
|
||||
nil,
|
||||
x, y,
|
||||
x1, y1,
|
||||
nil
|
||||
)
|
||||
spriteBatchFlush()
|
||||
end
|
||||
Reference in New Issue
Block a user