mouse spirit
Well-known member
Heres a link to the original post.Scroll down past dale_coop's wonderful tutorial.
http://www.nesmakers.com/viewtopic.php?f=35&t=1777&hilit=janky
For the most part it works fine.Except if i hit left then turn to the right.
As you may be able to see, the sword sprite does not match the correct direction.
If someone could help me fix this it would be much appreciated.
http://www.nesmakers.com/viewtopic.php?f=35&t=1777&hilit=janky
For the most part it works fine.Except if i hit left then turn to the right.
As you may be able to see, the sword sprite does not match the correct direction.
If someone could help me fix this it would be much appreciated.
Code:
;; Nate's janky object parenting w/ melee weapon/ w/ edits from dale_coop
;;;;;;;;;;;for new jump attack and other stuff
LDX player1_object
LDA Object_animation_frame,x
STA temp
LDA Object_movement,x
AND #%00000111
STA temp3
TAY
LDA Object_x_hi,x
SEC
SBC #$10 ;; width of melee weapon
CLC
ADC weaponOffsetTableX,y
STA temp1
LDA Object_y_hi,x
CLC
ADC weaponOffsetTableY,y
SEC
SBC #$08 ;; height of melee weapon
STA temp2
LDX player1_weapon
LDA Object_type,x
CMP #OBJECT_PLAYER_MELEE
BNE +
LDA temp1
STA Object_x_hi,x
LDA temp2
STA Object_y_hi,x
LDA Object_movement,x
ORA temp3
STA Object_movement,x
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;