コード例 #1
0
ファイル: Game.cs プロジェクト: SlagDrop/ConcenReact
        public Game(AssetHandler assetHandler, DebugForm debugForm, bool debug, Profile p, Player p2, int tS, int pX, int pY, Assets.Tileset tileset)
        {
            //Debug-Form
            this.debug     = debug;
            this.debugForm = debugForm;
            //Spielerzuweisung
            playerProfile = p;
            Player2       = p2;


            //Status-Variablen
            inBattle        = false;
            inOptions       = false;
            isInteracting   = false;
            inInventory     = false;
            inCharacterMenu = false;

            //Enemy Status-Variablen
            enemyIsInteracting = false;


            //Festlegung der Tilesize und der Pixelgröße des zu zeichnenden bereichs
            tileSize = tS;
            pbSizeX  = pX;
            pbSizeY  = pY;
            battle   = new Battle(pbSizeX, pbSizeY);

            this.assetHandler = assetHandler;

            //Random Map
            GameMap       = new Karte(pbSizeX / tileSize, pbSizeY / tileSize, tileSize);
            GameMap.Tiles = Karte.GenerateRandomTiles(assetHandler, pbSizeX / tileSize, pbSizeY / tileSize, null, tileset);
            background    = GameMap.GetMapBitmap();

            //Gesamt-Bitmap
            gesamt = new Bitmap(background.Width, background.Height);

            MenuTransparency    = 128;
            menuBrush           = new SolidBrush(Color.FromArgb(MenuTransparency, Color.DarkBlue));
            iconBackgroundBrush = new SolidBrush(Color.FromArgb(MenuTransparency, Color.Black));

            CheckPlayerOnTile();


            gesamtGraphics = Graphics.FromImage(gesamt);


            //Spieler zum Startbeginn TODO: Ersetzen durch Zufall
            SetupStartingPlayer(playerProfile.Player);

            //wartezeit nach rundenwechsel für ki TODO: Config-Eintrag
            maxTickWaitTime     = 5;
            currentTickWaitTime = maxTickWaitTime;
        }
コード例 #2
0
        public Game(Player p1, Player p2, int tS, int pX, int pY)
        {
            //Debug-Form
            debug = true;
            //Spielerzuweisung
            player1 = p1;
            Player2 = p2;


            currPlayer        = player1;
            currPlayerMovePwr = player1.MovePower;

            inBattle      = false;
            inOptions     = false;
            isInteracting = false;
            inInventory   = false;


            //Festlegung der Tilesize und der Pixelgröße des zu zeichnenden bereichs
            tileSize = tS;
            pbSizeX  = pX;
            pbSizeY  = pY;
            battle   = new Battle(pbSizeX, pbSizeY);


            //Random Map
            gameMap       = new Karte(pbSizeX / tileSize, pbSizeY / tileSize, tileSize);
            gameMap.Tiles = Karte.GenerateRandomTiles(pbSizeX / tileSize, pbSizeY / tileSize, null);
            background    = gameMap.GetMapBitmap();

            //Gesamt-Bitmap
            gesamt = new Bitmap(background.Width, background.Height);


            menuBrush = new SolidBrush(Color.FromArgb(100, Color.DarkBlue));
            CheckPlayerOnTile();
            DebugMode();
        }