One thing that is tripping me up is that when you fire, the game lags for an instant. The reason is because the way the program knows if you hit something is it does a series of pixel tests for the incoming enemy to see if any points are missing (when you fire, a line is drawn across the screen at the angle of your weapon, and then it erases that line)
:If K=31:Then //Fire with the alpha button :For(G,X-1,X+1 //It actually fires at 3 different angles, other wise many incoming enemies would be too hard to hit :Line(0,4,60cos(G),4+60sin(G :Line(0,4,60cos(G),4+60sin(G),0 :End :ClrList L1 :For(G,-1,1 :For(H,0,2 :pxl-Test(H+int(62-3F),G+int(47+3E -> L1(1+dim(L1 :End :End :End :If K=1 or 8>sum(L1 //K=1 happens when the enemy reaches the ground :Then :Pt-Off(E,F,2 :randInt(-12,12 -> E :20 -> F :End :End
Note that the above is not nearly the whole code. It is a tiny portion of the program; this isn't even everything involved in the firing. I also did not include the code for aiming the weapon, or the actual animation of the weapon, or the movement of the enemies, or the getKey routine. I'll add all this later if anyone wants me to. There is more to the firing code, thiugh that involves scoring and lives and "special attacks" etc, but i did not include that stuff because that isnt where the problem is.
If anyone knows of a better way to check if an enemy has been hit, please let me know.
EDIT: I have decided to change my window settings do avoid using the int( command in some cases, and also to avoid dozens of fractions cluttering my entire code. This should reduce size by a significant amount, and increase speed slightly. I will change the code above to match the new code once I finish modifications.