///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
var on_sag;
var on_sol;
var arka_sag;
var arka_sol;
var donus_hizi;
var ana_hiz;
var hiz_kontr;
ENTITY* govde;
action aGovde()
{
govde = me;
player = me;
set(my, SHADOW | CAST);
phent_settype (govde, PH_RIGID, PH_BOX);
phent_setmass (govde, 15, PH_BOX);
phent_setgroup (govde, 2);
phent_setfriction (govde, 20);
phent_setdamping (govde, 5, 5);
phent_setelasticity (govde, 10, 100);
}
function tekerlek_fizik_init()
{
set(my, SHADOW);
phent_settype(me, PH_RIGID, PH_SPHERE);
phent_setmass(me, 30, PH_SPHERE);
phent_setgroup(me, 2);
phent_setfriction(me, 100);
phent_setdamping(me, 20, 20);
phent_setelasticity(me, 0, 100);
}
action on_sagg()
{
tekerlek_fizik_init();
on_sag = phcon_add(PH_WHEEL, govde, me);
phcon_setparams1(on_sag, my.x, vector(0,0,1), nullvector);
phcon_setparams2(on_sag, nullvector, nullvector, nullvector);
}
action on_soll()
{
tekerlek_fizik_init();
on_sol = phcon_add(PH_WHEEL, govde, me);
phcon_setparams1(on_sol, my.x, vector(0,0,1), nullvector);
phcon_setparams2(on_sol, nullvector, nullvector, nullvector);
}
action arka_sagg()
{
tekerlek_fizik_init();
arka_sag = phcon_add (PH_WHEEL, govde, my);
phcon_setparams1 (arka_sag, my.x, nullvector, vector (0,1,0));
phcon_setparams2 (arka_sag, nullvector, nullvector, nullvector);
}
action arka_soll()
{
tekerlek_fizik_init();
arka_sol = phcon_add (PH_WHEEL, govde, my);
phcon_setparams1 (arka_sol, my.x, nullvector, vector (0,1,0));
phcon_setparams2 (arka_sol, nullvector, nullvector, nullvector);
}
function main()
{
vec_set(screen_size,vector(800,600,0));
vec_set(sky_color,vector(256,256,256)); // dark blue
video_window(NULL,NULL,0,"Ferrari Racing: Drag");
d3d_antialias = 1;
shadow_stencil = 3;
level_load("cevre.wmb");
ph_setgravity(vector(0,0, -386));
while(1)
{
/* //kamera
camera.x = govde.x - 25 * cos(govde.pan);
camera.y = govde.y - 25 * sin(govde.pan);
camera.z = govde.z + 25;
camera.pan = govde.pan; */
hiz_kontr = (key_w - key_s);
donus_hizi = hiz_kontr * 100 * time_step;
phcon_setmotor(arka_sol, nullvector, vector(-donus_hizi, 1500, 0), nullvector);
phcon_setmotor(arka_sag, nullvector, vector(-donus_hizi, 1500, 0), nullvector);
wait(1);
}
}