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)
|
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,32 +266,31 @@ 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
|
|
||||||
LeftID% = -1
|
|
||||||
RightDistance% = 1000
|
|
||||||
RightID% = -1
|
|
||||||
|
|
||||||
FOR Enemy%=0 TO MaxEnemies% - 1
|
LeftDistance% = 1000
|
||||||
|
LeftID% = -1
|
||||||
|
RightDistance% = 1000
|
||||||
|
RightID% = -1
|
||||||
|
|
||||||
|
FOR Enemy%=0 TO MaxEnemies% - 1
|
||||||
LeftCornerX% = EnemyLocations%(Enemy%,X) + EnemyHitbox%(EnemyHitboxID%(Enemy%),X)
|
LeftCornerX% = EnemyLocations%(Enemy%,X) + EnemyHitbox%(EnemyHitboxID%(Enemy%),X)
|
||||||
LeftCornerY% = EnemyLocations%(Enemy%,1) + EnemyHitbox%(EnemyHitboxID%(Enemy%),1)
|
LeftCornerY% = EnemyLocations%(Enemy%,1) + EnemyHitbox%(EnemyHitboxID%(Enemy%),1)
|
||||||
RightCornerX% = LeftCornerX% + EnemyHitbox%(EnemyHitboxID%(Enemy%),2)
|
RightCornerX% = LeftCornerX% + EnemyHitbox%(EnemyHitboxID%(Enemy%),2)
|
||||||
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%
|
||||||
@@ -300,7 +298,7 @@ FOR Enemy%=0 TO MaxEnemies% - 1
|
|||||||
ENDIF
|
ENDIF
|
||||||
ENDIF
|
ENDIF
|
||||||
ENDIF
|
ENDIF
|
||||||
NEXT Enemy%
|
NEXT Enemy%
|
||||||
|
|
||||||
ENDPROC
|
ENDPROC
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user