You're always welcome, heyguy..!! <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">
I would unpin the barriers once one of them hits the wall.
Here's an example of the unpin method.
https://www.dropbox.com/s/jvze67iehgwat ... .capx?dl=0
The basic idea is to use those barriers on the side as bouncing points for just one flying enemy only.
Once the enemy gets destroyed, then I would destroy the barriers at the same time and move on to the next enemy.
Since the game's canvas is much larger than the (500,500) size used on the example capx file, the correct way of handling the unpin would be..
1. Immediately unpin the barrier that hits the wall.
2. Unpin the one didn't hit the wall.
3. When the Player moves away from the wall, then pin again.
I would use a variable for this method as well. For example..
a. Dropped = 1 when the right side barrier hits the wall and unpins from the Player.
b. When Dropped = 1 occurs, the left side barrier unpins at the same time.
c. There should be another variable called DistanceFrom and it's set to Player.x's location after dropping the barriers.
d. While Dropped = 1, when DistanceFrom becomes -50 or so, meaing Player's X moved away from the wall 50 in the amount of 50 pixels, then Pin those barriers again to the Imagepoint 1 and 2.
4. This way, the Player will always have the wall while the Enemy is chasing and hovering above, even after hitting the wall.
In order to prevent the enemy from chasing the Player forever and interfering with other enemies, I would..
1. Set a variable of EnemyPosition and trigger only once to record Enemy's X and Y position when its line of sight activates.
2. If EnemyPosition is bigger than a certain number of pixels, meaning the enemy was following the Player for more than that number of pixels (e.g. 350), then Enemy will lose line of sight and move back to the EnemyPosition.
Just an idea, but they should work.