DarthAT
Member
Good morning NESMakers!
I have been playing around with scripts, attempting to teach myself the ASM 6502 language. My goal at this point, is to have an object that will be placed on screen as a game object with a special tile setting.
Special Item will be a Heart
It will be solid
It should be picked up with the A button and held over head (animation)
Once it has been picked up it will show in the HUD as being obtained (there will eventually be several other special Items to collect)
Eventually, after picking up all special items a secret passage will open.
What I have done so far:
Created game object (Heart) in position 0f
I have created user variable specialItem1 and set initial value to 0
I have created my HUD elements:
- Element 0 (Text: Special Items
- Element 1 (Var Tiles, specialItem1, Max Value 1)
I have added a tile type to 9 called special item and started editing the script (see below)
What I need to happen now...
I need to pick up the special item with button input with animation holding over head. The above script has set the tile set to solid (which is working) but now I want to pick it up and when I do it adds it to the HUD.
Would I continue to edit the tile script or would it be in another script? Also do I need to create another (new) input script to pick up the item (I ask because I do not see any "pick up item" inputs already built, but I may be over looking this.
Thank you for your help and time!
I have been playing around with scripts, attempting to teach myself the ASM 6502 language. My goal at this point, is to have an object that will be placed on screen as a game object with a special tile setting.
Special Item will be a Heart
It will be solid
It should be picked up with the A button and held over head (animation)
Once it has been picked up it will show in the HUD as being obtained (there will eventually be several other special Items to collect)
Eventually, after picking up all special items a secret passage will open.
What I have done so far:
Created game object (Heart) in position 0f
I have created user variable specialItem1 and set initial value to 0
I have created my HUD elements:
- Element 0 (Text: Special Items
- Element 1 (Var Tiles, specialItem1, Max Value 1)
I have added a tile type to 9 called special item and started editing the script (see below)
Code:
;;This script will pick up GameOgject and add it to HUD Element
;;Example: There are 5 random objects found on the map, as you find each element the character will walk up to it (push button) and pick up item (holding over head) adding it to 1 of 5 boxes in the HUD element
;;After all 5 elements have been found, a secret passage will open (I am thinking this will act like the monster block tile)
;; Step 1 Set object to solid -- WORKING!!!!
;; this block will become walkable after all monsters in a room are destroyed.
;; THIS PART DOES SOLID BEHAVIOR
LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid
;;Step 2 Set variable type SpecialItem1 to 0 with pickup type is gameobject 0f
LDA Object_type,x
CMP #$0f ;;What object is your pickup? 00 - 0f (Our gameobject is 0f)
BNE +notThisPickup
;;;;;;;;;;;;;;;;;;;;;;;;; What do you want to do to the value? (add 1 to HUD box)
;;;;;;;;;;;;;;;;;;;;;;;;; Increase? Decrease? Set it to a number? (Increase)
;;;;;;;;;;;;;;;;;;;;;;;;; Here, we are setting SpecialItem1 to 0.
LDA #$00
STA specialItem1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; Do we need to update the HUD to reflect this? (Yes0
;;;;;;;;;;;;;;;;;;;;;;;;; If so, which element is the above variable represented in? (We will use 1 for this one, 0 will be a text box)
UpdateHudElement #$01
JMP +endPickups
+notThisPickup
+endPickups
What I need to happen now...
I need to pick up the special item with button input with animation holding over head. The above script has set the tile set to solid (which is working) but now I want to pick it up and when I do it adds it to the HUD.
Would I continue to edit the tile script or would it be in another script? Also do I need to create another (new) input script to pick up the item (I ask because I do not see any "pick up item" inputs already built, but I may be over looking this.
Thank you for your help and time!