void GameView::OnShow() { m_gameover = false; InitPhysics(Vector2::Zero, 1.f); // Create the main game node. Map + objects go in there and are affected by light m_pGameLayer = CreateLightLayer(); m_pGameLayer->SetAmbient(Color(.10f, .15f, .2f, 1)); // Set that so something cool jason will decide on AddNode(m_pGameLayer); // spawn players from the lobby data, for now assume one CreateMusic(); CreateTileMap(); GenerateMap(); CreateEntities(); CenterCamera(); SpawnPlayers(); CreatePathFinder(); m_fadeQuad = CreateSprite("healthGaugeFill.png"); m_fadeQuad->GetColorAnim().start(Color(0.f, 0.f, 0.f, 1.f), Color(0.f, 0.f, 0.f, 0.f), 3.f); m_fadeQuad->SetFilter(onut::SpriteBatch::eFiltering::Nearest); m_fadeQuad->SetScale(Vector2(100, 100)); AddNode(m_fadeQuad); }
int main() { create_connect(); enable_servos(); set_create_total_angle(0); set_create_distance(0); WhichSide(); CenterCamera(); Lift(); }
int main() { set_each_analog_state(0,0,0,1,0,0,0,0);// This line sets analog ports to be pullup (0) or floating (1) create_connect(); enable_servos(); set_create_total_angle(0); set_create_distance(0); //AUO=start_process(ArmUpOpen); ArmUp(); set_servo_position( sleep(3); CenterCamera(); create_drive_straight(-200); while(digital(8) != 1) {} create_stop(); sleep(1); ArmDownClose(); sleep(3); beep(); create_drive_straight(200); sleep(2); create_stop(); }
void Cubes (void) { if (Side == 0) { //Right of Botguy //keep offense in box until scorer gets into position //start with claw facing out ForwardTouch(); //until it hits luggage DOES BAR TOUCH SENSOR REGISTER LUGGAGE TOUCH? TurnCCW(); //turn left -- now facing airplanes CenterCamera(); //move forwards and center the camera on the blocks -- now facing airplanes and in front of blocks TurnCCW(); //turn left to face blocks with claw -- now in front of and facing blocks ForwardTouch(); //move forward until it hits blocks Grab(); //grab blocks /*create_drive_straight(100); sleep(2);//to avoid crashing with our luggage carts create_stop(); TurnCCW();*/ //OFFENSE SHOULD BE OUT OF STARTING BOX BY NOW //FORWARD BAR SENSOR SHOULD NOT BE OBSTRUCTED //CREATE SHOULD DRIVE BACKWARDS GotoBox(); create_drive_straight(200); sleep(1); create_stop(); TurnCW(); create_drive_straight(-300); sleep(1); create_stop(); TurnCW(); CenterCamera(); TurnCCW(); ForwardTouch(); Grab(); TurnCCW(); create_drive_straight(-500); sleep(2.2352); TurnCW(); GotoBox(); Release(); } if (Side == 1) //Left of Botguy. START WITH CREATE FACING OUT { ForwardTouch(); //Switch to distance TurnCW(); ForwardTouch(); create_drive_straight(50); sleep(1); create_stop(); TurnCW(); CenterCamera(); TurnCCW(); ForwardTouch(); Grab(); TurnCCW(); /*create_drive_straight(100); sleep(1); create_stop(); TurnCW();*/ while (get_create_lbump(.1) == 0 && get_create_rbump(.1) == 0) { create_drive_straight(200); //unless arm is strong enough to hold } ClearWall(); TurnCW(); ForwardTouch(); create_drive_straight(132); //one cube length (5 inches) + 5 mm safety sleep(1); create_stop(); create_drive_straight(-75); sleep(1); create_stop(); Release(); } }
int main() { initialize(); CenterCamera(); }