int main(void) { TheBirthOfBigD(); /* Initialize I/O, ADC, Timer, & Switch */ QueueAheadWall = 0; QueueRightWall = 1; QueueLeftWall = 1; wait(); while(1) { if(QueueRightWall == 1 && QueueLeftWall == 1 && QueueAheadWall == 1) { FaceRight(); FaceRight(); } else if(QueueRightWall == 1 && QueueAheadWall == 1) { FaceLeft(); } else if(QueueRightWall == 0) { FaceRight(); } MoveForward(216); } return (EXIT_SUCCESS); }
void Dude::SetOrientation() { float mx, my; hge->Input_GetMousePos( &mx, &my ); if( mx < pos.x + dude->w / 2 ) { FaceLeft(); } else if( mx > pos.x + dude->w / 2 ) { FaceRight(); } }
////////////////////////////////////////////// // Constructor ////////////////////////////////////////////// cTank::cTank(cGame *pownergame, int pn) { player_num = pn; tankcritter = new cCritterArmedPlayerTank(pownergame); // add left right function if(player_num == 0) { FaceRight(); tankcritter->moveTo(cVector(-8.0, 3.0, 0.0), false); } else { FaceLeft(); tankcritter->moveTo(cVector(+8.0, 3.0, 0.0), false); } tankcritter->setAimToAttitudeLock(FALSE); tankcritter->setArmed(FALSE); //Although I made it "Unarmed I can shoot by pressing the g key (JPH) }
void cTank::FaceFlip() { if(face == 1) FaceRight(); else FaceLeft(); }