Neaten some stuff up.

This commit is contained in:
stevenhowes
2021-02-03 21:56:26 +00:00
parent bb1b6dd316
commit 213c8bfda5
2 changed files with 12 additions and 14 deletions
Binary file not shown.
+4 -6
View File
@@ -144,7 +144,6 @@ ENDPROC
REM Move enemy ship (display and physical)
DEF PROCenemy_ship_move
REM TODO: Only uses player velocity currently (/2 so they don't match stars)
FOR Enemy%=0 TO MaxEnemies% - 1
EnemyLocations%(Enemy%,Y) = EnemyLocations%(Enemy%,Y) - ((Cents% - LastCents%) * PlayerVelocity%/20) - ((Cents% - LastCents%) * EnemyVelocity%(Enemy%,Y))
@@ -267,12 +266,9 @@ ENDPROC
REM Calculate player ship's phaser arc
DEF PROCplayer_arc_calculatetarget
GCOL 0,0
NoseX% = PlayerLocation%(X) + PlayerHitbox%(0) + (PlayerHitbox%(2)/2)
NoseY% = (PlayerLocation%(Y) + PlayerHitbox%(1) + PlayerHitbox%(3))
REM LINE NoseX%, NoseY%, NoseX% + 200,NoseY% + 1000
REM LINE NoseX%, NoseY%, NoseX%,NoseY% + 1000
REM LINE NoseX%, NoseY%, NoseX% - 200,NoseY% + 1000
LeftDistance% = 1000
LeftID% = -1
@@ -286,13 +282,15 @@ FOR Enemy%=0 TO MaxEnemies% - 1
IF LeftCornerY% > NoseY% THEN
DistanceY% = LeftCornerY% - NoseY%
DistanceX% = ABS(NoseX% - ((LeftCornerX% + RightCornerX%) / 2))
IF (DistanceY%/5) > DistanceX% THEN
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) > 0 THEN
IF DistanceY% < LeftDistance% THEN
LeftDistance% = DistanceY%
LeftID% = Enemy%
ENDIF
ELSE
ENDIF
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) < 0 THEN
IF DistanceY% < RightDistance% THEN
RightDistance% = DistanceY%
RightID% = Enemy%