/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update (GameTime gameTime) { // For Mobile devices, this logic will close the Game when the Back button is pressed // Exit() is obsolete on iOS #if !__IOS__ if (GamePad.GetState (PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState ().IsKeyDown (Keys.Escape)) { Exit (); } #endif // TODO: Add your update logic here //update get pos mouse mouse = Mouse.GetState(); //medir fps setFps(gameTime); //test criar instancia: if(Objeto.mouseRightCheck()) { Man man = new Man("new",mouse.X,mouse.Y,Spr_down,0.1,0.1);//GameBase.mouse.X,GameBase.mouse.Y,GameBase.Spr_up); } UpdateAll(); base.Update (gameTime); }
public static void GameStart() //Início do jogo, crie as instâncias aqui! { //Instâncias joao = new Man("Joao",100,300,Spr_down,1,1); joao.solid = true; joao.precise=true; //joao.sprite = Spr_down; //joao.sprite.frameSpeed = 0.5; //joao.xscale = 1; //joao.yscale = 1; //joao.setScale(1,1); //joao.x = 100; //joao.y = 300; //joao.color = Color.Black; //joao.setSprite(Spr_right); //joao.sprite.setOrigin(Sprite.Bounds.CENTER); jose = new Man("Jose",300,300,Spr_down,1,1); jose.solid = true; jose.precise=true; //jose.xscale = 1; //jose.yscale = 1; //jose.sprite = Spr_down; //jose.setScale(1,1); //jose.x = 200; //jose.y = 300; //jose.setSprite(Spr_right); //jose.angle = 1; //jose.color = Color.Black; maria = new Man("Maria",500,300,Spr_down,1,1); maria.solid=true; //maria.precise=true; }