예제 #1
0
 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
        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;
        }