I am developing a snake game with two tails (player vs. device). After I built the grid, I started working on moving the tail towards right direction. The problem that I face is the tail is not moving.

The following code is creating an image of arrow (right arrow) so that a user can click this arrow to move to the right:

```
self.arrowRight = [[UIImageView alloc] initWithFrame: CGRectMake(90, 39, 27, 27)];
        [_arrowRight setImage:[UIImage imageNamed:@"right-arrow.png"]];
        UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(rightTap)];
        [_arrowRight setUserInteractionEnabled:YES];
        [_arrowRight addGestureRecognizer:singleTap];
        [_viewB addSubview:_arrowRight];

-(void)rightTap{
    [self moveRight];
}

```

The following code creates a subview of the tail on the grid where:

x is defined as the axis that will be changed every time it moves to the right

viewA1 is the subview of the tail and ViewA is the view of the grid

```
_x=39;
    int l;
    UIView *viewA1;
    for (l=0; l<6; l++) {
        viewA1 = [[UIView alloc]initWithFrame:CGRectMake(_x,48,11,11)];
        viewA1.backgroundColor = [UIColor greenColor];
        [_viewA addSubview:viewA1];
        _x += 12;
    }

```

The following code is the moveRight method:

```
-(IBAction)moveRight {

    _timer = [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(moveRight) userInfo:nil repeats:YES];
    [UIView beginAnimations:@"movingright" context:nil];
    [UIView setAnimationDuration:1];
    _x = 39;
    _vPlayer = [[UIView alloc]initWithFrame:CGRectMake(_x,48,11,11)];
    _vPlayer.backgroundColor = [UIColor greenColor];
    _x += 12;
    [_viewA addSubview:_vPlayer];
    [UIView commitAnimations];
} 

```

Can someone help me solving this issue

Thanks