Beispiel #1
0
 static public void DrawSpace(SpaceDraw spaceDraw, int x, int y)
 {
     for (int i = 0; i < x; i++)
     {
         for (int j = 0; j < y; j++)
         {
             spaceDraw.AddImage("./images/space.gif", i * 50, j * 50);
         }
     }
 }
Beispiel #2
0
        public MainWindow()
        {
            InitializeComponent();

            var spaceDraw = new SpaceDraw(canvas);

            SpaceElement.DrawSpace(spaceDraw, 10, 10);

            playerSpaceship.Set(spaceDraw, 5, 9);
            playerSpaceship.DrawShip("./images/spaceship.gif");

            for (int i = 0; i < 8; i++)
            {
                enemySpaceShips.Add(new EnemySpaceship());
                enemySpaceShips[i].DrawShip("./images/enemy.gif");
            }
        }
Beispiel #3
0
 public void Set(SpaceDraw spaceDraw, int x, int y)
 {
     Spaceship.spaceDraw = spaceDraw;
     posx = x;
     posy = y;
 }