Example #1
0
        public void CreatePlayer()
        {
            Dictionary<AnimationKey, Animation> animations = new Dictionary<AnimationKey, Animation>();

            Animation animation = new Animation(3, 32, 32, 0, 0);
            animations.Add(AnimationKey.Down, animation);

            animation = new Animation(3, 32, 32, 0, 96);
            animations.Add(AnimationKey.Up, animation);

            animation = new Animation(3, 32, 32, 0, 32);
            animations.Add(AnimationKey.Left, animation);

            animation = new Animation(3, 32, 32, 0, 64);
            animations.Add(AnimationKey.Right, animation);

            AnimatedSprite sprite = new AnimatedSprite(gameRef.Content.Load<Texture2D>(@"GUI\malefighter"),
                                                        animations);

            GamePlayScreen.Player = new Player(gameRef, sprite);
        }
        public void CreatePlayer()
        {
            Dictionary<AnimationKey, Animation> animations = new Dictionary<AnimationKey, Animation>();

            Animation animation = new Animation(3,32,32,0,0);
            animations.Add(AnimationKey.Down, animation);

            animation = new Animation(3, 32, 32, 0, 96);
            animations.Add(AnimationKey.Up, animation);

            animation = new Animation(3, 32, 32, 0, 32);
            animations.Add(AnimationKey.Left, animation);

            animation = new Animation(3, 32, 32, 0, 64);
            animations.Add(AnimationKey.Right, animation);

            AnimatedSprite sprite = new AnimatedSprite(characterImages[genderSelector.SelectedIndex, classSelector.SelectedIndex],
                                                        animations);

            GamePlayScreen.Player = new Player(gameRef, sprite);
        }
Example #3
0
 public Character(Entity entity, AnimatedSprite sprite)
 {
     this.entity = entity;
     this.sprite = sprite;
 }
Example #4
0
        public void LockToSprite(AnimatedSprite sprite)
        {
            position.X = (sprite.Position.X + sprite.Width/2)  * zoom - (viewPortRectangle.Width/2);
            position.Y = (sprite.Position.Y + sprite.Height/2) * zoom - (viewPortRectangle.Height/2);

            LockCamera();
        }
 public NonPlayerCharacter(Entity entity, AnimatedSprite sprite)
     : base(entity, sprite)
 {
     conversations = new List<Conversation>();
     quests = new List<Quest>();
 }
Example #6
0
 public Player(Game game, AnimatedSprite sprite)
 {
     gameRef = (Game1) game;
     camera = new Camera(gameRef.ScreenRectangle);
     this.sprite = sprite;
 }