Exemplo n.º 1
0
        public Enemy(int type, Random random)
            : this(type,
    
           new Vector2(random.Next(0, (int)Game1.SCREEN_WIDTH), random.Next(0, (int)Game1.SCREEN_HEIGHT)),
           new Vector2(0, 0),
           random)
        {
            speed.X = random.Next(-MAX_SPEED, MAX_SPEED);
            speed.Y = random.Next(-MAX_SPEED, MAX_SPEED);

            Alive = true;
            moveType = 0;

            moveSwitch = new Counter(random.Next(1000, 3000));
            counter = new Counter(random.Next(10, 20));
            pause = new Counter(random.Next(100, 200));

            rectangle = new Rectangle((int)Position.X, (int)Position.Y, SIZE, SIZE);

            textureDecision = new List<Tuple<Speed, Rectangle>>();

            textureDecision.Add(new Tuple<Speed, Rectangle>(() => speed.Y < 0, sources["up"]));
            textureDecision.Add(new Tuple<Speed, Rectangle>(() => speed.X < 0, sources["left"]));
            textureDecision.Add(new Tuple<Speed, Rectangle>(() => speed.Y > 0, sources["down"]));
            textureDecision.Add(new Tuple<Speed, Rectangle>(() => speed.X > 0, sources["right"]));
        }
Exemplo n.º 2
0
        public Trail(Rectangle source)
        {
            rectangle = new Rectangle(0, 0, Moveable.SIZE, Moveable.SIZE);

            positions = new List<Vector2>();
            sources = new List<Rectangle>();

            for (int i = 0; i < SIZE; i++)
            {
                positions.Add(new Vector2(0, 0));
                sources.Add(source);
            }

            timer = new Counter(DELAY);
        }
Exemplo n.º 3
0
        public Controller()
        {
            gameMenu = new Menu[]{
                startGame, settings, instructions, credits, exit, back
            };

            gameSettings = new Dictionary<String, int>();
            gameSettings.Add("round time", DEFAULT_ROUND_TIME);
            gameSettings.Add("#rounds", DEFAULT_NUM_OF_ROUNDS);
            gameSettings.Add("#players", NUM_OF_PLAYERS);

            state = STATE.MAINMENU;
            pauseTimer = new Counter(PAUSE_TIME * FPS);
            roundTimer = new Counter(DEFAULT_ROUND_TIME * FPS);
            artist = new Game.Game_Objects.Artist();
            widget = new WidgetDemonstration();
            initGame = true;
        }