mirror of
https://github.com/stevenhowes/TheEscape.git
synced 2026-05-27 20:13:42 +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)
|
REM Move enemy ship (display and physical)
|
||||||
DEF PROCenemy_ship_move
|
DEF PROCenemy_ship_move
|
||||||
REM TODO: Only uses player velocity currently (/2 so they don't match stars)
|
|
||||||
FOR Enemy%=0 TO MaxEnemies% - 1
|
FOR Enemy%=0 TO MaxEnemies% - 1
|
||||||
EnemyLocations%(Enemy%,Y) = EnemyLocations%(Enemy%,Y) - ((Cents% - LastCents%) * PlayerVelocity%/20) - ((Cents% - LastCents%) * EnemyVelocity%(Enemy%,Y))
|
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
|
REM Calculate player ship's phaser arc
|
||||||
DEF PROCplayer_arc_calculatetarget
|
DEF PROCplayer_arc_calculatetarget
|
||||||
GCOL 0,0
|
|
||||||
NoseX% = PlayerLocation%(X) + PlayerHitbox%(0) + (PlayerHitbox%(2)/2)
|
NoseX% = PlayerLocation%(X) + PlayerHitbox%(0) + (PlayerHitbox%(2)/2)
|
||||||
NoseY% = (PlayerLocation%(Y) + PlayerHitbox%(1) + PlayerHitbox%(3))
|
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
|
LeftDistance% = 1000
|
||||||
LeftID% = -1
|
LeftID% = -1
|
||||||
@@ -286,13 +282,15 @@ FOR Enemy%=0 TO MaxEnemies% - 1
|
|||||||
IF LeftCornerY% > NoseY% THEN
|
IF LeftCornerY% > NoseY% THEN
|
||||||
DistanceY% = LeftCornerY% - NoseY%
|
DistanceY% = LeftCornerY% - NoseY%
|
||||||
DistanceX% = ABS(NoseX% - ((LeftCornerX% + RightCornerX%) / 2))
|
DistanceX% = ABS(NoseX% - ((LeftCornerX% + RightCornerX%) / 2))
|
||||||
|
|
||||||
IF (DistanceY%/5) > DistanceX% THEN
|
IF (DistanceY%/5) > DistanceX% THEN
|
||||||
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) > 0 THEN
|
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) > 0 THEN
|
||||||
IF DistanceY% < LeftDistance% THEN
|
IF DistanceY% < LeftDistance% THEN
|
||||||
LeftDistance% = DistanceY%
|
LeftDistance% = DistanceY%
|
||||||
LeftID% = Enemy%
|
LeftID% = Enemy%
|
||||||
ENDIF
|
ENDIF
|
||||||
ELSE
|
ENDIF
|
||||||
|
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) < 0 THEN
|
||||||
IF DistanceY% < RightDistance% THEN
|
IF DistanceY% < RightDistance% THEN
|
||||||
RightDistance% = DistanceY%
|
RightDistance% = DistanceY%
|
||||||
RightID% = Enemy%
|
RightID% = Enemy%
|
||||||
|
|||||||
Reference in New Issue
Block a user