Beispiel #1
0
        public override void Initialize()
        {
            Texture = playerShipTexture;

            DrawLayer = .4f;

            scriptManager = thisScene.scriptManager;

            bullets = new List<Bullet>();

            Origin = new Vector2(23.5f, 23.5f);
            Hitbox = new Circle(Center, 20f);
            UsesInnerHitbox = true;
            InnerHitbox = new Circle(new Vector2(23.5f, 19.5f), 4f);

            mainEmitter = new BulletEmitter(this, Center, false);
            mainEmitter.LockedToParentPosition = true;

            CollidesWithLayers = new int[] { 0, 1 };
            CollisionLayer = 3;

            Color = Color.White;

            CanFire = thisScene.PlayerCanFire;

            OnOuterCollision += ObjectGrazed;
            OnInnerCollision += ObjectCollidedWith;

            base.Initialize();
        }
 public LevelManager(GameScene newScene)
 {
     thisScene = newScene;
     scriptManager = newScene.scriptManager;
 }
Beispiel #3
0
 public Level(LevelManager thisManager)
 {
     manager = thisManager;
     scriptManager = manager.thisScene.scriptManager;
     Initialize();
 }
Beispiel #4
0
        public override void Initialize()
        {
            scriptManager = new ScriptManager();
            gameObjects = new List<GameObject>();
            animations = new List<Animation>();

            ExtendValues = new List<int>()
            {
                10000,
                25000,
                50000,
                100000,
                200000,
                400000,
                800000,
                1600000,
                3200000,
                6400000,
                12800000,
                25600000,

            };

            if (AsteroidRebuttal.HardcoreMode)
            {
                ExtendValues.Clear();
                Lives = 0;
            }

            // Set the game area to 700 x 650.
            ScreenArea = new Rectangle(0, 0, 700, 650);
            fader = new Fader(this);

            // Set the UI window to 150 x 650, beginning after the ScreenArea.
            GUIArea = new Rectangle(700, 0, 225, 650);

            quadtree = new QuadTree(0, ScreenArea);
            collisionDetection = new CollisionDetection(this);

            levelManager = new LevelManager(this);

            // Test
            levelManager.SetLevel(1);

            //new FinalBoss(this, new Vector2(350, -300));
            player = new PlayerShip(this, new Vector2(350, 550));
        }