2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Würfelspiel: Welche Seite ist oben ??
#335237
07/27/10 12:12
07/27/10 12:12
|
Joined: Sep 2009
Posts: 18 Paderborn, Germany
ralf0507
OP
Newbie
|
OP
Newbie
Joined: Sep 2009
Posts: 18
Paderborn, Germany
|
Hallo !
Ich sitz an meinem ersten Spiel. Ein Würfel fällt aufs Spielbrett. Doch welche Seite ist oben ??
Wer kann mir helfen ?
-----
Hello, this is my first game with gamestudio. A dice game. I made a dice, and when it´s fallen, which side of the dice is up ?? Who could help me ?
My code:
///////////////////////////////////////////////////////////////
VECTOR ball_force; ENTITY* dice; VECTOR ball_force;
VECTOR* old_pos1 = {x=0; y=0; z=0;} VECTOR* old_pos2 = {x=0; y=0; z=0;} VECTOR* new_pos1 = {x=0; y=0; z=0;} VECTOR* new_pos2 = {x=0; y=0; z=0;} void main() { level_load("start.wmb"); // lade das Level dice = ent_create ("dice2.mdl", vector(-135, 0, 600), NULL); // erstelle den Ball
//Physik ph_setgravity (vector(0, 0, -186)); // setze die Schwerkraft phent_settype (dice, PH_RIGID, PH_BOX); // setze den Typus der Physik-Entity phent_setmass (dice, 1, PH_SPHERE); // und ihre Masse phent_setfriction (dice, 20); // setze die Reibung phent_setdamping (dice, 0, 0); // setze die Dämpfung phent_setelasticity (dice, 20, 1); // setze die Elastizität
//Drehmoment ball_force.x = random(100); ball_force.y = random(100); ball_force.z = random(100); phent_addtorqueglobal (dice, ball_force); // füge d. Würfel ein Drehmoment hinzu
//Programmschleife while (true) { camera.x = dice.x - 200; // halte d. Kamera 300 Quants hinter d. Ball camera.y = dice.y + 100; // verwende dasselbe y wie mit d. Ball camera.z = 1000; // und plaziere sie bei z = 1000 Quants camera.tilt = -80; // lasse sie nach unten schauen wait (1); } }
|
|
|
Re: Würfelspiel: Welche Seite ist oben ??
[Re: ralf0507]
#335241
07/27/10 12:47
07/27/10 12:47
|
Joined: Apr 2008
Posts: 650
Sajeth
User
|
User
Joined: Apr 2008
Posts: 650
|
Pan, Tilt und Roll können lediglich nicht mehr direkt verändert, aber immer noch ausgelesen werden ;-)
Teleschrott-Fan.
|
|
|
Re: Würfelspiel: Welche Seite ist oben ??
[Re: ralf0507]
#335246
07/27/10 13:01
07/27/10 13:01
|
Joined: May 2007
Posts: 2,043 Germany
Lukas
Programmer
|
Programmer
Joined: May 2007
Posts: 2,043
Germany
|
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|