mirror of
https://github.com/stevenhowes/TheEscape.git
synced 2026-05-27 00:03:25 +01:00
Allow dual-targetting of enemies directly in front
This commit is contained in:
Binary file not shown.
@@ -273,10 +273,11 @@ ENDPROC
|
|||||||
|
|
||||||
REM Calculate player ship's phaser arc
|
REM Calculate player ship's phaser arc
|
||||||
DEF PROCplayer_arc_calculatetarget
|
DEF PROCplayer_arc_calculatetarget
|
||||||
NoseX% = PlayerLocation%(X) + PlayerHitbox%(0) + (PlayerHitbox%(2)/2)
|
NoseX% = PlayerLocation%(x) + PlayerHitbox%(0) + (PlayerHitbox%(2)/2)
|
||||||
|
NoseXLeft% = PlayerLocation%(X) + PlayerHitbox%(0)
|
||||||
|
NoseXRight% = PlayerLocation%(X) + PlayerHitbox%(0) + PlayerHitbox%(2)
|
||||||
NoseY% = (PlayerLocation%(Y) + PlayerHitbox%(1) + PlayerHitbox%(3))
|
NoseY% = (PlayerLocation%(Y) + PlayerHitbox%(1) + PlayerHitbox%(3))
|
||||||
|
|
||||||
|
|
||||||
LeftDistance% = 1000
|
LeftDistance% = 1000
|
||||||
LeftID% = -1
|
LeftID% = -1
|
||||||
RightDistance% = 1000
|
RightDistance% = 1000
|
||||||
@@ -291,13 +292,13 @@ DEF PROCplayer_arc_calculatetarget
|
|||||||
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 (NoseXRight% - ((LeftCornerX% + RightCornerX%) / 2)) > 0 THEN
|
||||||
IF DistanceY% < LeftDistance% THEN
|
IF DistanceY% < LeftDistance% THEN
|
||||||
LeftDistance% = DistanceY%
|
LeftDistance% = DistanceY%
|
||||||
LeftID% = Enemy%
|
LeftID% = Enemy%
|
||||||
ENDIF
|
ENDIF
|
||||||
ENDIF
|
ENDIF
|
||||||
IF (NoseX% - ((LeftCornerX% + RightCornerX%) / 2)) < 0 THEN
|
IF (NoseXLeft% - ((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