コード例 #1
0
ファイル: Level1State.cs プロジェクト: healerrend/Cora-Code
        public override void loadState(GameState state, ContentManager content)
        {
            this.state = state;

            TextureLoader.junkSpaceBG = content.Load<Texture2D>("junk\\space-1280x720");
            corasprite = content.Load<Texture2D>("junk\\walksheet");
            TextureLoader.grayblock = content.Load<Texture2D>("junk\\graysquare");
            TextureLoader.redsquare = content.Load<Texture2D>("RealAssets\\redsquare");

            this.levelSize.X = 3350;
            this.levelSize.Y = 720;
            this.walls.Add(new Wall(new BoundingBox(new Vector3(-34, -2, 0), new Vector3(-1, 740, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(0, 620, 0), new Vector3(1150, 670, 0)), this));
            //this.walls.Add(new Wall(new BoundingBox(new Vector3(200, 617, 0), new Vector3(400, 622, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(1100, 570, 0), new Vector3(1950, 620, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(1900, 420, 0), new Vector3(1950, 570, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(2500, 330, 0), new Vector3(3350, 370, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(3300, 0, 0), new Vector3(3350, 330, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(0, 270, 0), new Vector3(650, 320, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(600, 270, 0), new Vector3(650, 420, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(600, 370, 0), new Vector3(1000, 420, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(950, 320, 0), new Vector3(1050, 370, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(1000, 270, 0), new Vector3(1100, 320, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(1050, 220, 0), new Vector3(1150, 270, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(1100, 170, 0), new Vector3(3050, 220, 0)), this));
            this.walls.Add(new Wall(new BoundingBox(new Vector3(3000, 0, 0), new Vector3(3050, 170, 0)), this));
            this.walls.Add(new Slope(this, new Point(1900, 420), new Point(2500, 330)));
            //this.walls.Add(new Slope(this, new Point(0, 370), new Point(450, 250)));

            foreach (LevelBlock w in walls)
            {
                w.Sprite = TextureLoader.grayblock;
            }
            player = new Player(corasprite, walls, this);

            objects.Add(player);
            player.movePlayer(new Point(100, 550));
        }
コード例 #2
0
ファイル: State.cs プロジェクト: healerrend/Cora-Code
        public override void loadState(GameState state, ContentManager content)
        {
            this.state = state;

            TextureLoader.junkSpaceBG = content.Load<Texture2D>("junk\\space-1280x720");
            corasprite = content.Load<Texture2D>("junk\\walksheet");
            TextureLoader.grayblock = content.Load<Texture2D>("junk\\graysquare");
            TextureLoader.redsquare = content.Load<Texture2D>("RealAssets\\redsquare");

            levelSize = new Vector2(5000, 3000);
            walls.Add(new Wall(new BoundingBox(new Vector3(0,1000,0), new Vector3(5000, 1020, 0)), this));
            walls.Add(new Wall(new BoundingBox(new Vector3(701, 800, 0), new Vector3(1000, 850, 0)), this));
            walls.Add(new Slope(this, new Point(400, 1000), new Point(700, 800)));
            walls.Add(new MovingPlatform(new BoundingBox(new Vector3(900,800,0), new Vector3(1000,850,0)), this, new Point(900,600), new Point(1000,800), MovingPlatformRotationType.Bouncing, 5, true, true));

            foreach (LevelBlock w in walls)
            {
                w.Sprite = TextureLoader.grayblock;
            }
            player = new Player(corasprite, walls, this);

            objects.Add(player);
        }
コード例 #3
0
ファイル: State.cs プロジェクト: healerrend/Cora-Code
 /// <summary>
 /// Must be overridden. This method should be called any time this state is loaded into the master game state class.
 /// This method will handle logic which will initialize the state and prepare it for play.
 /// </summary>
 /// <param name="content">The content manager used to load visual assets</param>
 public virtual void loadState(GameState state, ContentManager content)
 {
     this.state = state;
 }
コード例 #4
0
 /// <summary>
 /// This is called to initialize the state itself, and to load any assets needed through the content manager.
 /// </summary>
 public override void loadState(GameState state, ContentManager content)
 {
     this.state = state;
     POSITION_PLAY_GAME = new Vector2(400, 300);
     POSITION_CREDITS = new Vector2(400, 340);
     POSITION_OPTIONS = new Vector2(400, 380);
     POSITION_EXIT = new Vector2(400, 420);
     POSITION_LEVEL_EDIT = new Vector2(400, 460);
     bgImage = content.Load<Texture2D>("junk\\menubg");
     font = content.Load<SpriteFont>("realassets\\arbonnie");
 }
コード例 #5
0
 /// <summary>
 /// This method will load all A/V assets for this state.
 /// </summary>
 /// <param name="content">The content manager, to load the assets.</param>
 public override void loadState(GameState state, ContentManager content)
 {
     this.state = state;
     POSITION_PLAY_GAME = new Vector2(600, 100);
     POSITION_GO_TO_DATABASE = new Vector2(600, 300);
     POSITION_EXIT = new Vector2(0, 100);
     POSITION_GO_TO_OPTIONS = new Vector2(0, 500);
     background = content.Load<Texture2D>("junk\\junkhub");
     playGame = content.Load<Texture2D>("junk\\junkplaygame");
     goToDatabase = content.Load<Texture2D>("junk\\junkgotodatabase");
     goToOptions = content.Load<Texture2D>("junk\\junkgotooptions");
     exit = content.Load<Texture2D>("junk\\junkexitgame");
 }
コード例 #6
0
 /// <summary>
 /// This will load the assets for this state
 /// </summary>
 /// <param name="content">The content manager to load the assets</param>
 public override void loadState(GameState state, ContentManager content)
 {
     this.state = state;
     background = content.Load<Texture2D>("junk\\junkoptions");
     font = content.Load<SpriteFont>("realassets\\russellsquare");
     drawRect = new Rectangle(100, 100, 960, 540);
     POSITION_RETURN = new Vector2(200, 200);
     activationState = ActivationState.activating;
     animator = 0;
 }
コード例 #7
0
 public override void loadState(GameState state, ContentManager C)
 {
     this.state = state;
     this.background = C.Load<Texture2D>("junk\\splash");
 }
コード例 #8
0
ファイル: CreditsState.cs プロジェクト: healerrend/Cora-Code
 public override void loadState(GameState state, ContentManager content)
 {
     this.state = state;
     background = content.Load<Texture2D>("junk\\junkcredits");
 }
コード例 #9
0
 public override void loadState(GameState state, ContentManager content)
 {
     this.state = state;
     importedTextures = new List<Texture2D>();
     mOld = Mouse.GetState();
     mNew = Mouse.GetState();
     TextureLoader.redsquare = content.Load<Texture2D>("realassets\\redsquare");
     TextureLoader.cursor = content.Load<Texture2D>("junk\\levelcreatorcursor");
     wall = content.Load<Texture2D>("junk\\graysquare");
     form = new LevelEditForm(this);
     Thread formThread = new Thread(new ThreadStart(runForm));
     formThread.SetApartmentState(ApartmentState.STA);
     formThread.Start();
     nullPlayer = new Player(null, walls, this);
 }
コード例 #10
0
ファイル: DoDraw.cs プロジェクト: healerrend/Cora-Code
        public GameTime time; //The GameTime, which includes the time since the game was started, and the time elapsed since last update.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates a drawPacket. Only one of these is needed per update.
        /// </summary>
        /// <param name="s">The master game state</param>
        /// <param name="t">The GameTime, which includes the time since the game was started, and the time elapsed since last update.</param>
        /// <param name="c">The sprite batch, which is the tool that actually draws.</param>
        public drawPacket(GameState s, GameTime t, SpriteBatch c)
        {
            state = s;
            sb = c;
            time = t;
        }
コード例 #11
0
ファイル: DoDraw.cs プロジェクト: healerrend/Cora-Code
        public GameTime time; //The GameTime, which includes the time since the game was started, and the time elapsed since last update.

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Creates a doPacket. Only one of these is needed per update.
        /// </summary>
        /// <param name="s">The master game state</param>
        /// <param name="t">The GameTime, which includes the time since the game was started, and the time elapsed since last update.</param>
        /// <param name="c">The controller</param>
        public doPacket(GameState s, GameTime t, Controller c)
        {
            state = s;
            controller = c;
            time = t;
        }