anaglym/tests/ballstairs.lua
Josh Holtrop 9058dcfefc added initial support for reference objects
git-svn-id: svn://anubis/anaglym/trunk@241 99a6e188-d820-4881-8870-2d33a10e2619
2010-02-11 01:03:08 +00:00

31 lines
791 B
Lua
Executable File

function init_event()
arena = ag.loadModel("boxarena", { static = true })
ball = ag.loadModel("checkerball")
ball:setPosition(-7, 7.4, 12)
ball2 = ball:clone()
ball2:setPosition(-7, 7.4, 14)
ball3 = ball:clone()
ball3:setPosition(-7, 7.4, 16)
logo = ag.loadModel("dwlogo", {scale = 0.5})
logo:setPosition(-1, 2, 11)
crate = ag.loadModel("crate")
crate:setPosition(-5, -3, 10)
end
function update_event()
ballx, bally, ballz = ball:getPosition()
ag.setCamera(7, -6, 15, ballx, bally, ballz, 0, 0, 1)
if (ag.isKeyDown("m")) then
ball:setPosition(-7, 7.4, 12)
end
end
function key_down_event(key)
if (key == "d") then
ball2:destroy()
elseif (key == "p") then
ball:addForce(-10000, 0, 0)
end
end