Пример #1
0
        public void prototype_hash_return()
        {
            //Reate random operator to set some random bounds for our window which we pass into the spawner proto
            Random ran = new Random();
            int x = ran.Next(500, 1000);
            int y = ran.Next(500, 1000);

            //Instantiate
            SpawnerProto NewProto = new SpawnerProto(x, y);

            //Calls on the class that will return the cloned object of the enemy Class
            //We display their hash code to show their different objects in memory as proof

            Console.Write("\nOur Clone Hash: " + NewProto.spawnEnemy().GetHashCode());

            //Now display the hash code of the original
            Console.Write("\nOur Original: " + NewProto.getOriginal().GetHashCode());
        }
Пример #2
0
        public GameController(int windowX, int windowY)
        {
            //game controller will keep track of
            //player, enemies, score, items.
            player = new Player(3);
            diffContext = new DifficultyContext(player.PlayerScore);
            player.PlayerScore.register(diffContext);
            spawner = new SpawnerProto(windowX,windowY);

            enemiesVector = new List<Vector2>();
            enemiesOnScreen = new List<EnemySubclass>();

            notification = "";

            windowHeight = windowY;
            windowWidth = windowX;

            items = new ItemManager();
            itemAppeared = false;

            elapsedTime = 0;
        }
Пример #3
0
        public GameController(int windowX, int windowY)
        {
            //game controller will keep track of
            //player, enemies, score, items.
            player      = new Player(3);
            diffContext = new DifficultyContext(player.PlayerScore);
            player.PlayerScore.register(diffContext);
            spawner = new SpawnerProto(windowX, windowY);

            enemiesVector   = new List <Vector2>();
            enemiesOnScreen = new List <EnemySubclass>();

            notification = "";


            windowHeight = windowY;
            windowWidth  = windowX;

            items        = new ItemManager();
            itemAppeared = false;

            elapsedTime = 0;
        }