Craigery
Active member
The Monster Object AI script MoveTowardsPlayer uses a different speed than the one assigned under Object Details. I want to speed up the movement, because currently its too slow for my game.
As I understand it, having a Monster move toward the player involves 3 Scripts:
MoveTowardsPlayer.asm is the AI script
MoveTowardsPoint.asm is the macro from line 22 of the previous ASM
doMoveTowardsPoint.asm is the macro from line 22 of the previous ASM (coincidence??)
In doMoveTowardsPoint.asm you get tempA and tempB
which are used in MoveTowardsPoint.asm as:
So its storing the H and V angle as the objects speed? If I increase either Object H or V speed variable it moves faster, but towards a different point. What is another way around this? I suppose I could offset the position it looks for to move to, but I wonder if someone else has a fix for this, so I can change the speed without changing the trajectory?
As I understand it, having a Monster move toward the player involves 3 Scripts:
MoveTowardsPlayer.asm is the AI script
MoveTowardsPoint.asm is the macro from line 22 of the previous ASM
doMoveTowardsPoint.asm is the macro from line 22 of the previous ASM (coincidence??)
In doMoveTowardsPoint.asm you get tempA and tempB
TAY
LDA AngleToHVelLo,y
sec
sbc #$80
STA tempA
LDA AngleToVVelLo,y
CLC
ADC #$80
STA tempB
which are used in MoveTowardsPoint.asm as:
LDA tempA
STA Object_h_speed_lo,x
LDA #$00
STA Object_h_speed_hi,x
LDA tempB
STA Object_v_speed_lo,x
So its storing the H and V angle as the objects speed? If I increase either Object H or V speed variable it moves faster, but towards a different point. What is another way around this? I suppose I could offset the position it looks for to move to, but I wonder if someone else has a fix for this, so I can change the speed without changing the trajectory?
Last edited: