mirror of
https://github.com/stevenhowes/TheEscape.git
synced 2026-05-27 00:03:25 +01:00
Neaten some stuff up.
This commit is contained in:
Binary file not shown.
@@ -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%
|
||||
|
||||
Reference in New Issue
Block a user