|
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn),
581
guests, and 0
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Mein Code funktioniert nicht!!!
#263591
04/30/09 17:41
04/30/09 17:41
|
Joined: Apr 2009
Posts: 274
atari98
OP
Member
|
OP
Member
Joined: Apr 2009
Posts: 274
|
Ich habe in diesem Code einen ent_animate code mit eingefügt und jetzt funktioniert weder noch die animation noch das Game.Es komt nur eine Fehlermeldung.
Was hab ich falsch gemacht.Der Name der Animation ist doch "Fly"
Der Code:
/////////////////////////////// #include <acknex.h> #include <default.c>
///////////////////////////////
function main() { level_load ("homework18.wmb"); wait (2); vec_set(camera.x,vector(0,-480,1000)); // set a static position for the camera vec_set(camera.pan,vector(90,-68,0)); // set the correct orientation for the camera }
action my_car() { while (1) {
if (key_d) my.pan -= 3*time_step; // decrease the pan angle of the car if (key_w ) // press and hold the "Space" key to move the car c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE); if (key_s ) // press and hold the "Space" key to move the car c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE); if (key_cul) my.roll += 3*time_step; // increase the pan angle of the car if (key_cur) my.roll -= 3*time_step; // decrease the pan angle of the car if (key_cuu ) // press and hold the "Space" key to move the car my.tilt += 3*time_step; // increase the pan angle of the car if (key_cud ) // press and hold the "Space" key to move the car my.tilt -= 3*time_step; // increase the pan angle of the car // move the car using relative_speed wait (1); ent_animate(me,"fly",my.fly,ANM_CYCLE);
} }
Schon mal danke im Vorraus.
Gruss Atari98
|
|
|
Re: Mein Code funktioniert nicht!!!
[Re: atari98]
#263941
05/03/09 12:12
05/03/09 12:12
|
Joined: Apr 2009
Posts: 274
atari98
OP
Member
|
OP
Member
Joined: Apr 2009
Posts: 274
|
Hab ich eingefügt sieht jetzt so aus und funktioniert immer noch nicht:
/////////////////////////////// #include <acknex.h> #include <default.c>
///////////////////////////////
function main() { level_load ("homework18.wmb"); wait (2); vec_set(camera.x,vector(0,-480,1000)); // set a static position for the camera vec_set(camera.pan,vector(90,-68,0)); // set the correct orientation for the camera }
{
ent_animate(my, "fly", anim_speed, ANM_CYCLE); anim_speed += 16*time_step; }
action my_car() { while (1) {
if (key_d) my.pan -= 3*time_step; // decrease the pan angle of the car if (key_w ) // press and hold the "Space" key to move the car c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE); if (key_s ) // press and hold the "Space" key to move the car c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE); if (key_cul) my.roll += 3*time_step; // increase the pan angle of the car if (key_cur) my.roll -= 3*time_step; // decrease the pan angle of the car if (key_cuu ) // press and hold the "Space" key to move the car my.tilt += 3*time_step; // increase the pan angle of the car if (key_cud ) // press and hold the "Space" key to move the car my.tilt -= 3*time_step; // increase the pan angle of the car // move the car using relative_speed wait (1);
} }
Da wird immer angezeigt:`anim speed´ undeclared identifier
Kann mir jemand helfen!!!
|
|
|
Re: Mein Code funktioniert nicht!!!
[Re: atari98]
#263987
05/03/09 17:37
05/03/09 17:37
|
Joined: Apr 2009
Posts: 274
atari98
OP
Member
|
OP
Member
Joined: Apr 2009
Posts: 274
|
Jetzt funktioniert das mit den Code.Die Engine ladet ganz normal das Level aber der Rotor bewegt sich trotzdem nicht.
Der Code:
/////////////////////////////// #include <acknex.h> #include <default.c>
///////////////////////////////
function main() { level_load ("homework18.wmb"); wait (2); vec_set(camera.x,vector(0,-480,1000)); // set a static position for the camera vec_set(camera.pan,vector(90,-68,0)); // set the correct orientation for the camera }
var anim_speed; // variable für die animations geschwindigkeit
{
ent_animate(my, "fly", anim_speed, ANM_CYCLE); anim_speed += 1.5*time_step; }
action my_car() { while (1) {
if (key_d) my.pan -= 3*time_step; // decrease the pan angle of the car if (key_w ) // press and hold the "Space" key to move the car c_move (my, vector(15*time_step, 0, 0), nullvector, GLIDE); if (key_s ) // press and hold the "Space" key to move the car c_move (my, vector(-15*time_step, 0, 0), nullvector, GLIDE); if (key_cul) my.roll += 3*time_step; // increase the pan angle of the car if (key_cur) my.roll -= 3*time_step; // decrease the pan angle of the car if (key_cuu ) // press and hold the "Space" key to move the car my.tilt += 3*time_step; // increase the pan angle of the car if (key_cud ) // press and hold the "Space" key to move the car my.tilt -= 3*time_step; // increase the pan angle of the car // move the car using relative_speed wait (1);
} }
|
|
|
Re: Mein Code funktioniert nicht!!!
[Re: atari98]
#263996
05/03/09 18:09
05/03/09 18:09
|
Joined: Aug 2007
Posts: 1,922 Schweiz
Widi
Serious User
|
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
Dir fehlen scheinbar noch die Grundlagen zum Programmieren. Sehr zum empfehlen: der lite-C Workshop auf der Downloadseite (auch auf deutsch). Hat mir auch ne Menge geholfen. Workshop No. 21 behandelt auch das ent_animate. Deine zwei Zeilen:
ent_animate(my, "fly", anim_speed, ANM_CYCLE);
anim_speed += 1.5*time_step;
gehören in die while Schleife der action!! (ohne die Klammern {} )
Last edited by Widi; 05/03/09 19:39.
|
|
|
|