fjamesfernandez
Member
Hello everyone. I hope everyone has enjoyed their weekend and that each and everyone made progress goals on your projects. So I ran into some issues with Melee and Text while making my game in Adventure module. While following Joe's 3hr Adventure tutorial to make the weapon and such, I noticed that when I followed along with my own asset for some reason it was drawing the weapon on tile 8 and 9 on the player's asset. Of course I can really read what's, what on ASM so I did some digging in the forums and saw Dale's realy Melee tutorial. but After doing so I realized it was for platform module... I contacted Dale to see what he thought and made some adjustments (Thank you!) But it only works well with Down and Up attacks.
Am I suppose to use Melee only while doing the offset or is that part of project tile? In Joes video he used Projectile for Left and Right. Also I tried using a B_Text script but for some reason its making the Player/NPC/Monster all disappear. This time ive been smart enough to test things on a testing project and not the main build project.
B_Weapon
B_Text
Am I suppose to use Melee only while doing the offset or is that part of project tile? In Joes video he used Projectile for Left and Right. Also I tried using a B_Text script but for some reason its making the Player/NPC/Monster all disappear. This time ive been smart enough to test things on a testing project and not the main build project.
B_Weapon
Code:
LDA gameHandler
AND #%00100000
BEQ notNPCstate_attack
JMP doneAttacking
notNPCstate_attack:
LDA weaponsUnlocked
AND #%00000001
BNE canAttack
JMP doneAttacking
canAttack:
LDX player1_object
GetCurrentActionType player1_object
CMP #$02
BNE notAlreadyAttacking
JMP doneAttacking
notAlreadyAttacking:
;;; don't attack if already attacking.
;;; do we have to check for hurt here?
;;;;; Here, we WOULD create melee
ChangeObjectState #$02, #$05
LDA Object_movement,x
AND #%00001111
STA Object_movement,x
LDA #$00
STA Object_h_speed_hi,x
STA Object_h_speed_lo,x
STA Object_v_speed_hi,x
STA Object_v_speed_lo,x
LDA Object_x_hi,x
STA temp
LDA Object_y_hi,x
STA temp1
LDA Object_movement,x
AND #%00000111
STA temp2
TAY
LDA Object_x_hi,x
SEC
SBC #$08 ;; <<--- HERE, you have to set width of melee weapon in HEX (1 tile = 8px, 8 in decimal = #$08 in hex. Use the binary <-> hex converter plugin)
STA temp
LDA Object_scroll,x
SBC #$00
STA temp3
LDA temp
;;; offset x for creation
CLC
ADC weaponOffsetTableX,y
STA temp
LDA temp3
ADC #$00
STA temp3
LDA Object_y_hi,x
CLC
ADC weaponOffsetTableY,y
SEC
SBC #$10 ;; <<--- HERE, you have to set height of melee weapon in HEX (1 tile = 8px, 8 in decimal = #$08 in hex. Use the binary <-> hex converter plugin)
STA temp1
CreateObject temp, temp1, #OBJECT_PLAYER_MELEE, #$00, temp3
meleeCreated:
;;;; x is now the newly created object's x.
LDA Object_movement,x
ORA temp2
STA Object_movement,x
;PlaySound #SND_SLASH
doneAttacking:
RTS
B_Text
Code:
LDA textboxHandler ;; dale_coop: check if the text is already displayed
AND #%11000000
BEQ +
RTS
+
;; from here, the normal script...:
LDA textboxHandler
AND #%00010000 ;; if the b button is pressed
;; but the box + text have been activated
;; and also the 'do box' bit is OFF
;; that means this is ready to "go away".
BEQ checkToTurnTheTextboxOn ;; hasn't started yet
;; begin turning the textbox off.
LDA gameHandler
ORA #%00100000
STA gameHandler
;;; are we turning this on or off?
;;; check for more
;;; check for 'choice'.
LDA #$00
STA updateNT_offset
STA updateNT_H_offset
STA updateNT_V_offset
LDA #%10001000
STA textboxHandler
RTS
checkToTurnTheTextboxOn:
LDA npc_collision
BEQ noNPCcollision
LDA textboxHandler
AND #%10000000
BNE noNPCcollision
LDA gameHandler
ORA #%00100000
STA gameHandler
;;; are we turning this on or off?
;;; check for more
;;; check for 'choice'.
turnTheTextboxOn:
LDA #%10000000
STA textboxHandler
noNPCcollision:
RTS