
over time the list of commands will be added.
- Code: Select all
1 entity.loadAnimation(entity, animation) -- adds the animation of the object.
2 entity.animation(entity, frame, flag)
flag:
1 = lose once.
2 = fixated
3 = play in reverse order
3 entity.getAnimation(entity) -- get the current animation.
4 entity.setAnimation(entity, animation) --change your current animation
5 entity.stateAnimation(entity) -- returns the state of the animation
return:
0 = the animation does not play
1 = the animation is playing
6 entity.extractAnimation(animation, frameStart, frameEnd) -- extract animation
==================================================================================
exemple:
- Code: Select all
function onInit()
obj = objID
idle = entity.extractAnimation("C:/zombi.mesh", 0, 20)
run = entity.extractAnimation("C:/zombi.mesh", 21, 40)
die = entity.extractAnimation("C:/zombi.mesh", 41, 60)
entity.animation(obj, idle, 2)
end
function onUpdate()
if( input.keyDown( "up" ) == 1) then
entity.move(obj,0,0,0.1)
if entity.stateAnimation(run) == 0 then
entity.animation(obj, run, 2)
end
else
if entity.stateAnimation(run) == 0 then
entity.animation(obj, idle, 2)
end
end