示例#1
0
文件: Player.cs 项目: aeren108/kaymak
        public override void LoadContent()
        {
            sprite    = CM.Load <Texture2D>("cat_fighter");
            FootStep  = CM.Load <SoundEffect>("footsteps").CreateInstance();
            Knockback = CM.Load <SoundEffect>("knockback").CreateInstance();
            Dash      = CM.Load <SoundEffect>("whoosh").CreateInstance();
            font      = CM.Load <SpriteFont>("font");

            RightWalk = new Animation(70, 8, 64, 64, 2);
            LeftWalk  = new Animation(70, 8, 64, 64, 3);
            IdleLeft  = new Animation(120, 4, 64, 64, 1);
            IdleRight = new Animation(120, 4, 64, 64, 0);

            CurAnim         = IdleRight;
            FootStep.Volume = .1f;
            FootStep.Pitch  = .05f;

            Knockback.Volume = 0.4f;
            Knockback.Pitch  = -0.2f;

            Dash.Volume = .2f;
            Dash.Pitch  = .2f;

            Listener          = new AudioListener();
            Listener.Position = new Vector3(Position.X + 32, Position.Y + 32, 0);
        }
示例#2
0
        public override void LoadContent()
        {
            font   = CM.Load <SpriteFont>("font");
            button = CM.Load <Texture2D>("button");

            singleplayer = new Button();
            multiplayer  = new Button();
            quit         = new Button();

            singleplayer.Text = "Singleplayer";
            multiplayer.Text  = "Multiplayer";
            quit.Text         = "Quit";

            singleplayer.Click += ButtonClick;
            multiplayer.Click  += ButtonClick;
            quit.Click         += ButtonClick;

            singleplayer.Position = new Vector2(graphicsDevice.Viewport.Width / 2 - 16 * 5, graphicsDevice.Viewport.Height / 2 - 64);
            multiplayer.Position  = new Vector2(graphicsDevice.Viewport.Width / 2 - 16 * 5, graphicsDevice.Viewport.Height / 2 - 16);
            quit.Position         = new Vector2(graphicsDevice.Viewport.Width / 2 - 16 * 5, graphicsDevice.Viewport.Height / 2 + 32);

            compManager.AddComponent(singleplayer);
            compManager.AddComponent(multiplayer);
            compManager.AddComponent(quit);
        }
示例#3
0
        public override void LoadContent()
        {
            font         = CM.Load <SpriteFont>("font");
            normTexture  = CM.Load <Texture2D>("button");
            focusTexture = CM.Load <Texture2D>("buttonfocus");

            texture = normTexture;

            base.LoadContent();
        }
示例#4
0
        public override void LoadContent()
        {
            Sprite     = CM.Load <Texture2D>("laser");
            LaserSound = CM.Load <SoundEffect>("laser_sound").CreateInstance();

            LaserSound.Volume = 1f;
            LaserSound.Pitch  = 0.2f;

            emitter = new AudioEmitter();
        }
示例#5
0
        public override void LoadContent()
        {
            font         = CM.Load <SpriteFont>("font");
            normTexture  = CM.Load <Texture2D>("inputbox");
            focusTexture = CM.Load <Texture2D>("inputboxfocus");

            texture   = normTexture;
            textColor = Color.BurlyWood;

            base.LoadContent();
        }
        /// <summary>
        /// Load your _graphics _content.  If loadAllContent is true, you should
        /// load _content from both ResourceManagementMode pools.  Otherwise, just
        /// load ResourceManagementMode.Manual _content.
        /// </summary>
        /// <param name="loadAllContent">Which type of _content to load.</param>
        protected override void LoadGraphicsContent(bool loadAllContent)
        {
            GraphicsDevice gd = _graphics.GraphicsDevice;

            gd.Clear(Color.CornflowerBlue);
            if (loadAllContent)
            {
                _expFlash32  = CM.Load <Texture2D>(@"Sprites/flash32");
                _expFlash64  = CM.Load <Texture2D>(@"Sprites/flash64");
                _expFlash128 = CM.Load <Texture2D>(@"Sprites/flash128");
            }
        }
示例#7
0
        public void LoadContent()
        {
            Map    = new TiledMap(this, "/dungeon.json");
            Camera = new Camera(graphics);
            player = new Player(this);
            Shaker = new ScreenShaker();

            Map.LoadContent();
            player.LoadContent();
            entities.Add(player);

            gameTheme               = CM.Load <Song>("hero_immortal");
            MediaPlayer.Volume      = 0.05f;
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(gameTheme);
        }
示例#8
0
 public override void LoadContent()
 {
     world.LoadContent();
     font = CM.Load <SpriteFont>("font");
 }
示例#9
0
 public override void LoadContent()
 {
     sprite = CM.Load <Texture2D>("fireball");
     anim   = new Animation(100, 4, 32, 32, (int)dir);
 }