Hey guys, I've made a generic shooter, you control a ship at the bottom of the screen, an enemy sprite will come down, you fire at it, get a point if you kill it, pretty basic stuff, but for the first game it's something to learn the basics. So far I'm having trouble implementing a feature that I'd like to add. Every 100 points or so, I'd like to see the enemy sprite get faster and faster, to add some difficulty.
Here's the code I have having the enemy chase the player:
if player1y < player0y then player1y = player1y + 1
if player1y > player0y then player1y = player1y - 1
if player1x < player0x then player1x = player1x + 1
if player1x > player0x then player1x = player1x - 1
Now that code worked and I'd like to add some difficulty (faster enemies after so many points) -- Here is what I tried and it didn't work:
if score < 100 then player1y < player0y then player1y = player1y + 1
if score < 100 then player1y > player0y then player1y = player1y - 1
if score < 100 then player1x < player0x then player1x = player1x + 1
if score < 100 then player1x > player0x then player1x = player1x - 1
if score > 100 then player1y < player0y then player1y = player1y + 2
if score > 100 then player1y > player0y then player1y = player1y - 2
if score > 100 then player1x < player0x then player1x = player1x + 2
if score > 100 then player1x > player0x then player1x = player1x - 2
In theory this should've worked, but it didn't. I've tried other miscellaneous things but this is the major change I've made. Is there something I'm missing? Any help about this would be highly appreciated.