jcramer
New member
This is a tile that warps you after you collect all the tiles on screen. All your levels will need the same amount of collectables, unless you use the multi-tile or something.
Step 1. Create a variable called "myCollect" with an initial value of 0.
Step 2. Create a new tile.
CollectLevelClear.asm
Step 3. add these lines of code to Game > Subroutines > doLoadScreen.asm around line 495, this resets the count of collectables back to zero every time you die or leave the screen.
Step 1. Create a variable called "myCollect" with an initial value of 0.
Step 2. Create a new tile.
CollectLevelClear.asm
Code:
;;; COLLECT LEVEL CLEAR TILE
CPX player1_object
BEQ +isPlayer
JMP +notPlayer
+isPlayer
INC myCollect
LDA myCollect
CMP #$06 ;;;;;;; HOW MANY TO COLLECT????
BEQ +enough
JMP +notEnough
;;;;; BELOW WILL CHANGE TILE AT COLLISION.
+enough
JMP +doTheWarp
+notEnough
ChangeTileAtCollision #$00, #$00
;MACRO AddValue arg0, arg1, arg2, arg3
;arg0 = how many places this value has.
;arg1 = home variable
;arg2 = amount to add
;arg3 = what place value is receiving the addition?
;;; 0 = ones place, 1 = tens place, 2 = hundreds place, etc.
AddValue #$06, myScore, #$1, #$02
UpdateHudElement #$03
;PlaySound #sfx_cursor
+notPlayer
JMP +noWarpYet
+doTheWarp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CPX player1_object
BNE notPlayerForWarpTiles
WarpToScreen warpToMap, warpToScreen, #$01
;; arg0 = warp to map. 0= map1. 1= map2.
;; arg1 = screen to warp to.
;; arg2 = screen transition type - most likely use 1 here.
;; 1 = warp, where it observes the warp in position for the player.
notPlayerForWarpTiles:
+noWarpYet
Step 3. add these lines of code to Game > Subroutines > doLoadScreen.asm around line 495, this resets the count of collectables back to zero every time you die or leave the screen.
Code:
LDA #$00
STA myCollect