Ejemplo n.º 1
0
 public Target(ref TargetAttack ta, ref global_vars vars, ref Game1 game)
     : base(game)
 {
     this.game = game;
     this.variables = vars;
     thisTarget = this;
     position = new Rectangle(vars.screen_width/2, vars.screen_height/2, 100, 100);
     attack = ta;
 }
Ejemplo n.º 2
0
 protected void getTarget()
 {
     Target t = new Target(ref thisTA, ref variables, ref game);
     game.Components.Add(t);
 }
Ejemplo n.º 3
0
 public static void handleTargetCommands(ref Target target, ref global_vars vars)
 {
     keypressed = Keyboard.GetState();
     if (keypressed.IsKeyDown(Keys.Up))
         target.move('u');
     else if (keypressed.IsKeyDown(Keys.Down))
         target.move('d');
     else if (keypressed.IsKeyDown(Keys.Right))
         target.move('r');
     else if (keypressed.IsKeyDown(Keys.Left))
         target.move('l');
     else if (keypressed.IsKeyDown(Keys.Enter))
         target.select();
 }