示例#1
0
        // Konstruktor
        public clsGame(clsCamera Camera)
        {
            try
            {
                // Map erzeugen
                Map = new Octo.Map.clsMap(20, 20);

                GameObjectList = new List <clsGameObject>();
                Backcolor      = Color.LightBlue;

                // Hintergrund hinzufügen
                clsBackground Background = new clsBackground();
                Background.Height      = ScreenSize.Height;
                Background.Width       = ScreenSize.Width;
                Background.SpriteImage = Image.FromFile("./Assets/Grass_1.png");
                GameObjectList.Add(Background);

                // Spielobjekte hinzufügen
                clsSprite Ball1 = new clsSprite(10, 20, 100, 100, ScreenSize);
                Ball1.MaxSpeed     = 150;
                Ball1.Angle        = (float)Math.PI / 4;
                Ball1.Map          = Map;
                Ball1.moveBehavior = new clsAutomaticMove();
                Ball1.moveBehavior.BorderRectangle = new structRectangle(0, 0, Map.getSizeInPixel().Width, Map.getSizeInPixel().Height);
                Ball1.SpriteImage = Image.FromFile("./Assets/Ball.png");
                GameObjectList.Add(Ball1);

                clsSprite Ball2 = new clsSprite(400, 200, 20, 20, ScreenSize);
                Ball2.moveBehavior = new clsManualMove();
                Ball2.MaxSpeed     = 100;
                Ball2.SpriteImage  = Image.FromFile("./Assets/Ball.png");
                GameObjectList.Add(Ball2);
            }
            catch (Exception ex)
            {
                new clsError(ex);
            }
        }
示例#2
0
 // Konstruktor
 public clsMapCell(clsMap Map, int CellX, int CellY)
 {
     this.Map   = Map;
     this.CellX = CellX;
     this.CellY = CellY;
 }