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);

}
}