Door Warp Tile [4.5.6]

AllDarnDavey

Active member
Someone on the NESmaker facebook group was looking for this.
DoorWarpTile.gif


It's a warp tile that only warps when the player is pressing up while on the tile, useful for doing doors that you have to press up to enter.
Make a new tile script named "warpToScreen_OnPressUp.asm" assign it to a tile type, and give it this code:
Code:
	CPX player1_object
	BNE +notPlayerForWarpTile
	LDA gamepad
	AND #%00010000
	CMP #%00010000
	BNE +notPlayerForWarpTile
	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.
+notPlayerForWarpTile:

This only works for player one, but it wouldn't be too hard to make a 2 player version, just add a player2 and gamepad2 check to it.
 

dale_coop

Moderator
Staff member
Old thread but curious.

Can I just integrate the d pad into the standard warp tile to make it check for pressing "up"
yes, just add:
Code:
LDA gamepad
AND #%00010000  ;; UP button pressed?
BNE +yesPressed
    ;; not pressed, we stop the script here
    RTS
+yesPressed:

at the very beginning of your warp tile script.
 
Top Bottom