///////////////////////////////
#define PRAGMA_PATH "%EXE_DIR%\templates\images";
#define PRAGMA_PATH "%EXE_DIR%\templates\models";
#define PRAGMA_PATH "%EXE_DIR%\templates\sounds";
#include <acknex.h>
#include <default.c>
#include "mtlFX.c"
///////////////////////////////
VECTOR ball_speed;
ENTITY *ball;
function main()
{
video_mode = 9;
level_load("test11.WMB");
wait(2);
ball = ent_create("ball.mdl", vector(-128, 0, 16), NULL);
ph_setgravity(vector(0,0, -386));
phent_settype(ball, PH_RIGID, PH_SPHERE);
phent_setmass(ball, 3, PH_SPHERE);
phent_setfriction(ball, 80);
phent_setdamping(ball, 40, 40);
phent_setelasticity(ball, 50, 20);
camera.z = 200;
camera.tilt = -20;
camera.pan = 0;
while(1) {
ball_speed.x = 130 * (key_d - key_a) * time_step;
ball_speed.y = 130 * (key_w - key_s) * time_step;
ball_speed.z = 0;
phent_addtorqueglobal(ball, ball_speed);
camera.x = ball.x - 300;
camera.y = ball.y;
wait(1);
}
}