int random = rand(2); // returns a number between 0 and 2 (including floating point)
// setting it to an int casts it (making random equal 0 or 1)
switch(random)
{
case 0:
// Change animation to first run
break;
case 1:
// Change animation to second run
break;
}
int a = 1.5; // a will be equal 1
int b = 2.9; // b will equal 2
dzuncoi wrote:btw, where can i get these kinds of code ?
double yvel = yvelocity; // save yvelocity's value
//put the PhysicalResponse here
yvelocity = yvel; // set yvelocity back to yvel
Users browsing this forum: No registered users and 1 guest