(4.5.6) MoveToPlayer Monster Movement Speed

9Panzer

Well-known member
Excellent. Just tried it out and it works flawlessly!
BTW if its any use to you if you put this snippet at the bottom you can make monster go "Up and Down" as well!

doneWithGravity:

LDA Object_direction,x
AND #%00100000
BEQ +noVertMovement
;; there is vertical movement
LDA Object_direction,x
AND #%00010000
BEQ +isUpMovement
;; is down movement
LDA Object_y_lo,x
CLC
ADC myMaxSpeed;Object_v_speed_lo,x
STA yHold_lo
LDA Object_y_hi,x
ADC myMaxSpeed+1;Object_v_speed_hi,x
STA yHold_hi
CLC
ADC self_bottom
CMP #BOUNDS_BOTTOM ;#240

BCS doBottomBounds
JMP +noVertMovement
doBottomBounds:
CPX player1_object
BEQ +isPlayer
DestroyObject
JMP skipPhysics
+isPlayer
LDA yPrev
STA yHold_hi
STA Object_y_hi,x
; LDA #$00
; STA Object_v_speed_hi,x
; STA Object_v_speed_lo,x
; LDA #$00
; STA screenUpdateByte
; JSR doHandleBounds
JMP skipPhysics
+isUpMovement
LDA Object_y_lo,x
SEC
SBC myMaxSpeed;Object_v_speed_lo,x
STA yHold_lo
LDA Object_y_hi,x
SBC myMaxSpeed+1;Object_v_speed_hi,x
BCC +doTopBounds ;; helps if top bounds is zero.
STA yHold_hi
CMP #BOUNDS_TOP
BEQ +doTopBounds
BCC +doTopBounds
JMP +noVertMovement
+doTopBounds
CPX player1_object
BEQ +isPlayer
DestroyObject
JMP skipPhysics
+isPlayer

LDA yPrev
STA yHold_hi
STA Object_y_hi,x
; LDA #$00
; STA Object_v_speed_hi,x
; STA Object_v_speed_lo,x
; LDA #$02
; STA screenUpdateByte
; JSR doHandleBounds
JMP skipPhysics
+noVertMovement

skipPhysics:
 
Hmm, this doesn't seem to work for me in the L2R platform (4.5.9) .
I am using
"doHandlePhysics_platformBase_fixedAndSeamFix.asm" from the forums. (And added the vertical-stuff after "done with gravity" in the code)
and these stock scripts from nesmakers inventory:
"moveTowardsPlayer_adventurebase.asm"
"monsterShootProjectile.asm"

The monster projectiles are still slow. And doesnt respond to speed-settings on the gameobject. :(
Would be grateful for any suggestions...
I dont know what i messed up?
 

Attachments

  • BIT_customPhysicScript.txt
    18.3 KB · Views: 1
  • bossfight.jpg
    bossfight.jpg
    154.9 KB · Views: 3

TakuikaNinja

Active member
Hmm, this doesn't seem to work for me in the L2R platform (4.5.9) .
I am using
"doHandlePhysics_platformBase_fixedAndSeamFix.asm" from the forums. (And added the vertical-stuff after "done with gravity" in the code)
and these stock scripts from nesmakers inventory:
"moveTowardsPlayer_adventurebase.asm"
"monsterShootProjectile.asm"

The monster projectiles are still slow. And doesnt respond to speed-settings on the gameobject. :(
Would be grateful for any suggestions...
I dont know what i messed up?
I think a related issue was just solved? Check this thread out and see if that works.
https://www.nesmakers.com/index.php?threads/4-5-6-monster-projectile-very-slow-speed-resolved.7914/
 
Top Bottom