Exemple #1
0
        public SecondPlayer(World world)
        {
            DirectionAnimationCouple dac = new DirectionAnimationCouple();
            dac.Couples.Add(Direction.Up, "player_up");
            dac.Couples.Add(Direction.Down, "player_down");
            dac.Couples.Add(Direction.Left, "player_left");
            dac.Couples.Add(Direction.Right, "player_right");

            character = new Character(new Vector2D(0, 0), new Vector2D(3, 3), dac, world, "player_animation", 0);

            Program.RenderWindow.KeyPressed += RenderWindow_KeyPressed;
            Program.RenderWindow.KeyReleased += RenderWindow_KeyReleased;
        }
Exemple #2
0
        public Character(Vector2D position, Vector2D speed, DirectionAnimationCouple animationCouples,
                         World world, string animation, int collisionLayer)
            : base(position)
        {
            this.collisionLayer = collisionLayer;
            this.world          = world is LayeredWorld ? (LayeredWorld)world : world;

            this.speed            = speed;
            this.position         = position;
            this.animationCouples = animationCouples;
            this.animation        = AnimationGroupManager.GetAnimationGroup(animation);

            this.animation.CurrentAnimation = animationCouples[Direction.Down];
        }
Exemple #3
0
        public Character(Vector2D position, Vector2D speed, DirectionAnimationCouple animationCouples,
            World world, string animation, int collisionLayer)
            : base(position)
        {
            this.collisionLayer = collisionLayer;
            this.world = world is LayeredWorld ? (LayeredWorld)world : world;

            this.speed = speed;
            this.position = position;
            this.animationCouples = animationCouples;
            this.animation = AnimationGroupManager.GetAnimationGroup(animation);

            this.animation.CurrentAnimation = animationCouples[Direction.Down];
        }