Example #1
0
        private int[] mA; //input key array. 0 = left, 1 = up, 2 = right

        public Player(DynamicShape shape, IBaseImage image) : base(shape, image)
        {
            mA = new int[3];
            taxiOrientation = TaxiOrientation.Left;
            taxiDirection   = TaxiDirection.None;
            imageContainer  = ImageContainer.GetInstance();
            Shape           = new DynamicShape(
                new Vec2F(),
                new Vec2F(Constants.EXTENT_X * 2, Constants.EXTENT_Y));
            Image = imageContainer.GetPlayerStride(taxiOrientation, taxiDirection);
            SpaceTaxiBus.GetBus().Subscribe(GameEventType.PlayerEvent, this);
        }
 public void GetPlayerStridesReturnsImageStrideForAllPossibleDirections(
     TaxiOrientation orientation, TaxiDirection direction)
 {
     //if test doesn't fail, the images were successfully retrieved from the ImageContainer
     var strides = imageContainer.GetPlayerStride(orientation, direction);
 }
Example #3
0
 /// <summary>
 /// Determine image of player object and render
 /// </summary>
 public void RenderPlayer()
 {
     Image = imageContainer.GetPlayerStride(taxiOrientation, taxiDirection);
     RenderEntity();
 }