コード例 #1
0
ファイル: Enemy.cs プロジェクト: ptrick/Ninja-Versus-Slime
 public Enemy(ContentManager content, Camera camera, Level level)
 {
     this.camera = camera;
     this.level = level;
     walk = new Clip(content.Load<Texture2D>("Monsters/e/walk"), 5);
     death = new Clip(content.Load<Texture2D>("Monsters/e/death"), 4);
     idle = new Clip(content.Load<Texture2D>("Monsters/e/idle"), 4);
     squish = content.Load<SoundEffect>("Squish");
     currentClip = walk;
     animPlayer = new AnimationPlayer();
     int d = Helper.rnd.Next(1);
     if (d == 0)
         direction = SpriteEffects.None;
     else
         direction = SpriteEffects.FlipHorizontally;
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: ptrick/Ninja-Versus-Slime
        public Player(ContentManager content, Camera camera, Level level)
        {
            image = content.Load<Texture2D>("TileMain");

            death = new Clip(content.Load<Texture2D>("Player/death"), 4);
            walk = new Clip(content.Load<Texture2D>("Player/walk"), 5);
            jump = new Clip(content.Load<Texture2D>("Player/jump"), 1);
            idle = new Clip(content.Load<Texture2D>("Player/idle"), 2);
            scream = content.Load<SoundEffect>("Scream");

            animPlayer = new AnimationPlayer();

            currentClip = idle;

            this.camera = camera;
            this.level = level;
        }