예제 #1
0
파일: Quicksilver.cs 프로젝트: endy/IvyXNA
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            // Setup the World
            worldElements = new List<Block>();

            CreateWorld();

            // Setup Entities
            liveEntities = new List<Entity>();

            Player = new Entity(playerSprite);
            Player.Position = new Vector2(200, 200);
            Player.MovementState = Entity.EntityMovementState.Falling;
            liveEntities.Add(Player);

            uiElementList = new List<IUserInterfaceElement>();
            playerSpeed = CreateSlider();
            playerSpeed.Position = new Point(600, 400);
            playerSpeed.Initialize();
            playerSpeed.Value = (int)Player.Speed.X;
            uiElementList.Add(playerSpeed);
            jumpSpeed = CreateSlider();
            jumpSpeed.Position = new Point(600, 432);
            jumpSpeed.Initialize();
            uiElementList.Add(jumpSpeed);

            remainingSpawnTime = 5000;

            IsMouseVisible = true;
            IsPaused = false;
        }
예제 #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            liveEntities = new List<Entity>();

            Player = new Entity(playerSprite);
            Player.Position = new Vector2(200, 200);
            liveEntities.Add(Player);

            uiElementList = new List<IUserInterfaceElement>();
            playerSpeed = CreateSlider();
            playerSpeed.Position = new Point(600, 400);
            playerSpeed.Initialize();
            uiElementList.Add(playerSpeed);
            fireRate = CreateSlider();
            fireRate.Position = new Point(600, 432);
            fireRate.Initialize();
            uiElementList.Add(fireRate);

            remainingSpawnTime = 5000;

            IsMouseVisible = true;
            IsPaused = false;
        }
예제 #3
0
파일: Quicksilver.cs 프로젝트: endy/IvyXNA
        protected Slider CreateSlider()
        {
            Slider s = new Slider();
            s.UpSprite = upSprite;
            s.DownSprite = downSprite;

            #if WINDOWS || XBOX
            s.SliderFont = sliderFont;
            #endif // WINDOWS || XBOX

            return s;
        }
예제 #4
0
        protected Slider CreateSlider()
        {
            Slider s = new Slider();
            s.UpSprite = upSprite;
            s.DownSprite = downSprite;
            s.SliderFont = sliderFont;

            return s;
        }