Before the weekend starts... let's write a quick tutorial for adding a blinking PRESS START on our Start Screen.
To do that, we will add a simple color palette cycling code (for the "Sub 3" palette, when the Start Screen is displayed).
1) Design your start screen and use the Sub 3 to write your PRESS START:
(here I used the start screen graphics that come with the tutorial demos)
2) Go to the "Project Settings > User Variables" and create a new variable named "palettesCycleTimer" with an initial value "0":
3) Now, we will modify the script that is assigned to the "Handle Game Time" in your "Project Settings > Script Settings". I'd suggest to create a new script (or duplicate the ordinal), name it for example "HandleGameTimer_withColorsCycling.asm", with that code:
4) And assign that "HandleGameTimer_withColorsCycling.asm" script, to the Handle Game Timer:
VoilĂ , now you should have every tiles that use the Sub 3, having the colors cycling.
(Note: If you want something just like blinking... set just one color, and keep the other ones black)
To do that, we will add a simple color palette cycling code (for the "Sub 3" palette, when the Start Screen is displayed).
1) Design your start screen and use the Sub 3 to write your PRESS START:
(here I used the start screen graphics that come with the tutorial demos)
2) Go to the "Project Settings > User Variables" and create a new variable named "palettesCycleTimer" with an initial value "0":
3) Now, we will modify the script that is assigned to the "Handle Game Time" in your "Project Settings > Script Settings". I'd suggest to create a new script (or duplicate the ordinal), name it for example "HandleGameTimer_withColorsCycling.asm", with that code:
Code:
HandleGameTimer:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; dale_coop : call of the palette cycling code (see the routine at the end of this script):
JSR handlePaletteCycleTimer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
DEC gameTimer
BNE dontUpdateGameTimer
LDA gameTimerLo
CLC
ADC #$01
STA gameTimerLo
LDA gameTimerHi
ADC #$00
STA gameTimerHi
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DO WHATEVER READS OF THE GAMETIMER YOU MIGHT WANT HERE.
JSR DoAlarm
;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDA #DayNightSpeed
STA gameTimer
dontUpdateGameTimer:
RTS
DoAlarm:
;;; we're going to edge-load monsters one at a time if they are of edge type and are not active.
LDX #$00
doLoadMonsterOnTimerLoop:
LDA edgeLoaderInCue
BEQ noEdgeMonstersInCue
LDA currentBank
STA prevBank
LDY #$1C ;; data bank
JSR bankswitchY
JSR CreateTimedEdgeSpawner
DEC edgeLoaderInCue
LDY prevBank
JSR bankswitchY
noEdgeMonstersInCue
RTS
;;;;;;;;;;;;;;;;;;; PALETTES CYCLE ;;;;;;;;;;;;;;;;;;;
handlePaletteCycleTimer:
;; On START SCREEN :
LDA update_screen_details ;; special screen (start/win screens)?
BNE endPaletteCycleTimer ;; if not skip the pal cycle code
LDA currentScreen ;; screen 0 (the start one)?
BNE endPaletteCycleTimer ;; if not skip the pal cycle code
;; from here, DO the palette cycle:
LDA palettesCycleTimer
BNE dontUpdatePaletteCycleTimer
JSR pickPaletteToCycle
LDA #$10 ;; HERE !!! the SPEED of the cycling
STA palettesCycleTimer
dontUpdatePaletteCycleTimer:
DEC palettesCycleTimer
endPaletteCycleTimer:
RTS
pickPaletteToCycle:
LDA #$02 ;; HERE !!! the "Sub 3" palette
ASL
ASL ;; these multiply your literal or variable with 4 so we can get the right offset for each palette in increments of 4.
TAX
LDY bckPal+1,x ;; pocket colour 1 in reg y
LDA bckPal+2,x
STA bckPal+1,x ;; move colour 2 to 1
LDA bckPal+3,x
STA bckPal+2,x ;; move colour 3 to 2
TYA
STA bckPal+3,x ;; move pocket (y) to 3
LDA #$01
STA updatePalettes ;; loading anything but zero into this value tells NESmaker it needs to update palettes.
RTS
4) And assign that "HandleGameTimer_withColorsCycling.asm" script, to the Handle Game Timer:
VoilĂ , now you should have every tiles that use the Sub 3, having the colors cycling.
(Note: If you want something just like blinking... set just one color, and keep the other ones black)