Basically I've never loaded/played a .x animation before.
I'm wondering if someone can give me a simple explanation as to how this works. I'm working from the code below.
I'd appreciate if someone could give me a pointer on what I'm doing wrong.
Thanks in advance.
Notes:
- I am exporting from 3ds max 2010 via Panda Exporter.
- The object has 10 frames of animation and plays/loops fine in 3ds.
`*** A swimming fishy? Mebbe. ***
//SETUP
SYNC ON
SYNC RATE 60
//UDTs
TYPE Vect2
x AS FLOAT
y AS FLOAT
ENDTYPE
TYPE Player
Obj AS INTEGER
Pos AS Vect2
Vel AS Vect2
Accel AS FLOAT
Decel AS FLOAT
IfAlive AS BOOLEAN
Life AS FLOAT
ENDTYPE
//VARs/GlOBALs
GLOBAL CamOne AS INTEGER = 1
GLOBAL Fish AS Player
Fish.Obj = 1
Fish.Pos.x = 0
Fish.Pos.y = 0
//LOAD
`The Infamous Fish
LOAD OBJECT "xfiles\fishanim.x", Fish.Obj
POSITION OBJECT Fish.Obj, Fish.Pos.x, Fish.Pos.y, 0
`Camera
MAKE CAMERA CamOne
POSITION CAMERA CamOne, -300, 0, 0
POINT CAMERA 1, OBJECT POSITION X(Fish.Obj), OBJECT POSITION Y(Fish.Obj), OBJECT POSITION Z(Fish.Obj)
//BEGIN LOOP
WHILE ESCAPEKEY() = 0
` Delta Time Update
IF SCREEN FPS() <> 0
dt = SCREEN FPS()
dt = 1.0 / dt
ELSE
dt = 0.016666
ENDIF
//IN-GAME CALLS
Debug()
PlayerUpdate()
`Temporary Camera
if upkey()=1 then move camera 1, 10
if downkey()=1 then move camera 1, -10
if leftkey()=1 then turn camera left 1, 1
if rightkey()=1 then turn camera right 1, 1
//END LOOP
SYNC
ENDWHILE
//FUNCTIONS
FUNCTION Debug()
TEXT 0, 0, "" + STR$(total object frames(1))
ENDFUNCTION Debug
FUNCTION PlayerUpdate()
`I would like to see it swimming
LOOP OBJECT Fish.Obj, 0, total object frames(Fish.Obj)
ENDFUNCTION
Thanks again.
I'm looking for the true nature of things. But I'm not cynical at all. Or sarcastic for that matter. Now tell me: where is the irony here?