Hey,
So I'm following through in the adventure tutorial on youtube and it got to the part about putting brackets around the icon of the sword and crystal. The tutorial shows him opening the 'Handle Sprite Pre-Draw' Script, and it looked different than mine. I'm not sure if the code was added pre-video and I just can't see it as a download anywhere. I used the Adventure module that you download with the tutorial.
This is what mine says:
;; sprite pre-draw
;;; this will allow a user to draw sprites
;;; before object sprites are drawn.
;;; keep in mind, there are still only 64 sprites
;;; that can be drawn on a screen,
;;; and still only 8 per scan line!
;;; you can use DrawSprite macro directly using the following scheme:
;DrawSprite arg0, arg1, arg2, arg3, arg4
;arg0 = x
;arg1 = y
;arg2 = chr table value
;arg3 = attribute data
;arg3 = starting ram position
;; x and y are the direct positions on the screen in pixels.
;; chr table value is which sprite you'd like to draw from the ppu table.
;; attribute data is a binary number (starts with #%), and here are how the bits work:
;;; bit 7 - Flip sprite vertically
;;; bit 6 - Flip sprite horizontally
;;; bit 5 - priority (0 in front of background, 1 behind background)
;;; bit 4,3,2 - (null)
;;; bit 1,0 - subpalette used (00, 01, 10, 11)
;;; for starting ram position, use spriteOffset.
;; this is set to 0 just before entering this script (or 4 if sprite 0 hit was used).
;; ***remember to increase spriteOffset by 4 for every sprite that is drawn,
;; including after the last one drawn*****, so that the first object's sprite begins
;; in the next available spot.
This is what I tried to add based on what I could see in the video:
;;EXAMPLE:
;; DrawSprite #$80, #$80, #$10, #%00000000, spriteoffset
;; inc spriteOffset
;; inc spriteOffset
;; inc spriteOffset
;; inc spriteOffset
LDA weaponsunlocked
AND #%00000001
BEQ skipDrawingSwordInHud
;;; now, we would be ready for our next sprite.
DrawSprite #$74, #$14, #$2c, #%00000001, spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
skipDrawingSwordInHud:
LDA weaponsUnlocked
AND #%00000010
BEQ skipDrawingItemInHud
DrawSprite #$8c, #$14, #$29, #%00000001, spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
skipDrawingItemInHud:
This is the compiling error i receive:
Where'd I screw up?
So I'm following through in the adventure tutorial on youtube and it got to the part about putting brackets around the icon of the sword and crystal. The tutorial shows him opening the 'Handle Sprite Pre-Draw' Script, and it looked different than mine. I'm not sure if the code was added pre-video and I just can't see it as a download anywhere. I used the Adventure module that you download with the tutorial.
This is what mine says:
;; sprite pre-draw
;;; this will allow a user to draw sprites
;;; before object sprites are drawn.
;;; keep in mind, there are still only 64 sprites
;;; that can be drawn on a screen,
;;; and still only 8 per scan line!
;;; you can use DrawSprite macro directly using the following scheme:
;DrawSprite arg0, arg1, arg2, arg3, arg4
;arg0 = x
;arg1 = y
;arg2 = chr table value
;arg3 = attribute data
;arg3 = starting ram position
;; x and y are the direct positions on the screen in pixels.
;; chr table value is which sprite you'd like to draw from the ppu table.
;; attribute data is a binary number (starts with #%), and here are how the bits work:
;;; bit 7 - Flip sprite vertically
;;; bit 6 - Flip sprite horizontally
;;; bit 5 - priority (0 in front of background, 1 behind background)
;;; bit 4,3,2 - (null)
;;; bit 1,0 - subpalette used (00, 01, 10, 11)
;;; for starting ram position, use spriteOffset.
;; this is set to 0 just before entering this script (or 4 if sprite 0 hit was used).
;; ***remember to increase spriteOffset by 4 for every sprite that is drawn,
;; including after the last one drawn*****, so that the first object's sprite begins
;; in the next available spot.
This is what I tried to add based on what I could see in the video:
;;EXAMPLE:
;; DrawSprite #$80, #$80, #$10, #%00000000, spriteoffset
;; inc spriteOffset
;; inc spriteOffset
;; inc spriteOffset
;; inc spriteOffset
LDA weaponsunlocked
AND #%00000001
BEQ skipDrawingSwordInHud
;;; now, we would be ready for our next sprite.
DrawSprite #$74, #$14, #$2c, #%00000001, spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
skipDrawingSwordInHud:
LDA weaponsUnlocked
AND #%00000010
BEQ skipDrawingItemInHud
DrawSprite #$8c, #$14, #$29, #%00000001, spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
inc spriteoffset
skipDrawingItemInHud:
This is the compiling error i receive:
Where'd I screw up?