I will admit, I am relatively new to assembly code. I started an Adventure Module-based game recently, and I have been trying to get a sword-esque attack working. When the attack is used, I want the sword to face away from the player as you may expect. However, whenever I use the attack, the weapon faces down? Every time?
Here is a section of the code I have for "ChangeToAttack_AdventureBase":

The arrows are current placeholders and all face down. They should face away?
Not sure what's going on here. I assumed that the code of "#WEAPON_LEFT_STATE" or RIGHT_STATE and otherwise would change the direction/animation of the object.
Does anybody know how to fix this?
Here is a section of the code I have for "ChangeToAttack_AdventureBase":
As well here is a screenshot of my issue:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Now, we have to create the object.
;; We will need to determine the direction
;; of the player.
LDX player1_object
TXA
STA temp
GetObjectDirection temp ;; temp still observed from above.
;;; this object's direction is now loaded into the
;;; accumulator for comparison after the macro.
;; 0 = down
;; 1 = downright
;; 2 = right
;; 3 = upright
;; 4 = up
;; 5 = upleft
;; 6 = left
;; 7 = downleft
BNE +notDown ;; jump if not equal to zero.
;;; CREATE DOWN WEAPON
;;; create an object for the weapon.
;;; create it at the down positions.
;;; create it with the down state
LDX player1_object
LDA Object_x_hi,x
CLC
ADC #WEAPON_POSITION_DOWN_X
STA tempA
LDA Object_y_hi,x
CLC
ADC #WEAPON_POSITION_DOWN_Y
STA tempB
LDY weaponChoice
LDA weaponObjectTable,y
STA tempC
;; use this is you want to always create a single object, based on
;; the constant above.
; CreateObject tempA, tempB, #WEAPON_OBJECT, #WEAPON_DOWN_STATE, currentNametable
;;; use this if you want to create a variable object based on
;;; the weaponChoice varaible.
CreateObject tempA, tempB, tempC, #WEAPON_DOWN_STATE, currentNametable ;originally tempC after tempB
LDA #%00110000
STA Object_direction,x
JMP +doneWithCreatingWeapon
+notDown
CMP #$02
BNE +notRight
;;; CREATE RIGHT WEAPON
LDX player1_object
LDA Object_x_hi,x
CLC
ADC #WEAPON_POSITION_RIGHT_X
STA tempA
LDA Object_y_hi,x
CLC
ADC #WEAPON_POSITION_RIGHT_Y
STA tempB
LDY weaponChoice
LDA weaponObjectTable,y
STA tempC
;; use this is you want to always create a single object, based on
;; the constant above.
; CreateObject tempA, tempB, #WEAPON_OBJECT, #WEAPON_RIGHT_STATE, currentNametable
;;; use this if you want to create a variable object based on
;;; the weaponChoice varaible.
CreateObject tempA, tempB, tempC, #WEAPON_RIGHT_STATE, currentNametable
LDA #%11000000
STA Object_direction,x
JMP +doneWithCreatingWeapon
+notRight
CMP #$04
BNE +notUp
;;; CREATE UP WEAPON
LDX player1_object
LDA Object_x_hi,x
CLC
ADC #WEAPON_POSITION_UP_X
STA tempA
LDA Object_y_hi,x
CLC
ADC #WEAPON_POSITION_UP_Y
STA tempB
LDY weaponChoice
LDA weaponObjectTable,y
STA tempC
;; use this is you want to always create a single object, based on
;; the constant above.
; CreateObject tempA, tempB, #WEAPON_OBJECT, #WEAPON_DOWN_STATE, currentNametable
;;; use this if you want to create a variable object based on
;;; the weaponChoice varaible.
CreateObject tempA, tempB, tempC, #WEAPON_UP_STATE, currentNametable
LDA #%00100000
STA Object_direction,x
JMP +doneWithCreatingWeapon
+notUp
CMP #$06
BNE +notLeft
;;; CREATE LEFT WEAPON
LDX player1_object
LDA Object_x_hi,x
CLC
ADC #WEAPON_POSITION_LEFT_X
STA tempA
LDA Object_y_hi,x
CLC
ADC #WEAPON_POSITION_LEFT_Y
STA tempB
LDY weaponChoice
LDA weaponObjectTable,y
STA tempC
;; use this is you want to always create a single object, based on
;; the constant above.
; CreateObject tempA, tempB, #WEAPON_OBJECT, #WEAPON_DOWN_STATE, currentNametable
;;; use this if you want to create a variable object based on
;;; the weaponChoice varaible.
CreateObject tempA, tempB, tempC, #WEAPON_LEFT_STATE, currentNametable
LDA #%10000000
STA Object_direction,x
JMP +doneWithCreatingWeapon
+notLeft
+doneWithCreatingWeapon
RTS
weaponChoiceTable:
.db #%00000001, #%00000010, #%00000100, #%00001000
.db #%00010000, #%00100000, #%01000000, #%10000000
weaponObjectTable:
.db #$01, #$06, #$03, #$03, #$03, #$03, #$03, #$03

The arrows are current placeholders and all face down. They should face away?
Not sure what's going on here. I assumed that the code of "#WEAPON_LEFT_STATE" or RIGHT_STATE and otherwise would change the direction/animation of the object.
Does anybody know how to fix this?