Esempio n. 1
0
        public Map(Spawn spawn)
        {
            switch (GlobalSupport.GameDifficulty)
            {
            case EDifficulty.Easy:
                GenerateEasyMap ();
                break;
            case EDifficulty.Medium:
                GenerateMediumMap ();
                break;
            case EDifficulty.Hard:
                GenerateHardMap ();
                break;
            }

            this.spawn = spawn;
        }
 /// Author:	Guy Spronck
 /// Date:	23-06-2015
 /// <summary>
 /// Draws the spawn.
 /// </summary>
 /// <param name="res">Res.</param>
 /// <param name="opt">Opt.</param>
 /// <param name="spawn">Spawn.</param>
 /// <param name="tempCanvas">Temp canvas.</param>
 /// <param name="imgWidth">Image width.</param>
 /// <param name="imgHeight">Image height.</param>
 private void DrawSpawn(Android.Content.Res.Resources res, BitmapFactory.Options opt, Spawn spawn, Canvas tempCanvas, int imgWidth, int imgHeight)
 {
     tempCanvas.DrawBitmap (BitmapFactory.DecodeResource (res, Resource.Drawable.SpawnFlag01, opt), (float)spawn.x * imgWidth, (float)spawn.y * imgHeight, null);
 }
Esempio n. 3
0
        private void GenerateEasyMap()
        {
            map = new Tile[3, 3];

            // y, x - north, east, south, west
            map [0, 0] = new Tile (false, true, false, false, EShops.None, 0);
            map [0, 1] = new Tile (false, false, true, true, EShops.None,0);
            map [0, 2] = new Tile (false, false, false, false, EShops.None,0);
            map [1, 0] = new Tile (false, false, false, false, EShops.None,0);
            map [1, 1] = new Tile (true, false, true, false, EShops.None,0);
            map [1, 2] = new Tile (false, false, false, false, EShops.None,0);
            map [2, 0] = new Tile (false, true, false, false, EShops.Butcher,0);
            map [2, 1] = new Tile (true, true, false, true, EShops.None,0);
            map [2, 2] = new Tile (false, false, false, true, EShops.Greengrocer,0);

            spawn = new Spawn (0, 0);
            cabbagesToRetreive = 1;
            sausagesToRetreive = 1;
            Robot robot = Robot.Create (EOrientation.East, this);
        }