Cheat! That's how Capcom does it!
Just make him hit it there! No physical response, no fairness. Make him to what you want!
Make it like this perhaps:
ball>collision>enemyflipper
- Code: Select all
ball.angle=direction(x, y, player.x, player.y+rand(100)-50);
Now the ball with move toward player one +- up to 50 degrees in either direction!
You can alter this in any way you want, and of course this might be a problem if player one is on the edge of the screen, as the ball might be hit off the top or bottom.
So add adjustments;
- Code: Select all
if (player1.y>-140 && player.y <140){do what i just said}
else if (player 1.y<-140 || player1.y>140){ball.angle=0;}
Now if the player is at the top or bottom, the enemy will hit it straight down the middle!
This is all of course, assuming that the playfield is in a normal horizontal state.
If it rotates, perhaps you can adjust the angle like this:
- Code: Select all
ball.angle=direction(x, y, player.x, player.y)+(rand100)-50;
Now the offset will simply be on either angle side of player 1, regardless of whether the playfield is horizontal or vertical.