예제 #1
0
파일: Target.cs 프로젝트: jbornemann/Ascian
 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;
 }
예제 #2
0
 protected void getTarget()
 {
     Target t = new Target(ref thisTA, ref variables, ref game);
     game.Components.Add(t);
 }
예제 #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();
 }