Beispiel #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="game">Game object</param>
        /// <param name="scene">PlayScene where game is playing</param>
        /// <param name="spriteBatch">SpriteBatch for drawing</param>
        public Noguri(Game game,
                      PlayScene scene,
                      SpriteBatch spriteBatch) : base(game)
        {
            this.game        = (GameNoguri)game;
            this.scene       = scene;
            this.spriteBatch = spriteBatch;
            this.position    = new Vector2(Shared.LimitRightLevelZero -
                                           WIDTH, Ground.GetY(0) - HEIGHT);
            tex       = game.Content.Load <Texture2D>("Images/noguri");
            speed     = new Vector2(SPEED_X, 0);
            rectangle = new Rectangle((int)position.X + ALLOWANCE_SIDE,
                                      (int)position.Y, WIDTH - (ALLOWANCE_SIDE * 2), HEIGHT);

            // Load sounds
            jumpSound = game.Content.Load <SoundEffect>("Sounds/jump");
            dieSound  = game.Content.Load <SoundEffect>("Sounds/die");
            itemSound = game.Content.Load <SoundEffect>("Sounds/item");
            fallSound = game.Content.Load <Song>("Sounds/fall");

            // Create image frames
            CreateFrames();
        }
Beispiel #2
0
 static void Main()
 {
     using (var game = new GameNoguri())
         game.Run();
 }