Hi,
You're lucky, i have written an entity move script for myself,
so this may help you:
(Use the WSAD-Keys)
VECTOR* vec = vector(0,0,0);
if (key_pressed(17)) // forward
{
vec_for_angle(vec,vector(player.pan,0,0));
c_move(player,nullvector,vec,IGNORE_CONTENT | GLIDE);
}
if (key_pressed(31)) // back
{
vec_for_angle(vec,vector((player.pan + 180)%360,0,0));
c_move(player,nullvector,vec,IGNORE_CONTENT | GLIDE);
}
if (key_pressed(30)) // rotate Left
{
c_rotate(player,vector(0.1,0,0),USE_AXISR);
}
if (key_pressed(32)) // rotate Right
{
c_rotate(player,vector(-0.1,0,0),USE_AXISR);
}
Important:
You are confusing two concepts:
1. Inbuild Physics
2. (I call it) 'Manual Physics'.
1.) Physics System
If ypu are using the inbuilt physics system, then you give
your object 'out of control' and into the charge of the physics engine - this means that you should no more move your object by yourself.
You normally build wheels to your tank model,
and then build in a motor to turn this wheels.
Or you may simply push your object around -
if it was a ball (check out the ball example in your sample directory of your lite-c installation)
But if you would push your tank around like this, it would only look stupid - believe me, I tried it this way
)
A good example for building in wheels and moving the object with that is the bulldozer example
Link:Bulldozer Example on the Aknex ressource side 2.) 'manual physics'
There you move objects yourself - collision detection is
controlled by the flags you provide to the c_move function,
and depending on if an entity has a passable flag.
I personally recommend using the GLIDING flag,
because if you use a non-flat terrain, then your
tank won't get stuck that fast.
Pro for 2: Much faster, easiert to begin with
Downside: Not that nice, and you have to care for general physics by yourself (gravity for example is applied by manually c-moving your objects downside every frame)
I hope that helped a bit,
Davidus