change warp tiles to doors

digit2600

Member
I wanna mess with the code for warp tiles so that they only work when you press up while standing in front of them... I have a vague idea of how to do this, but I'm not sure where to begin here...

Normally, I'd just do a if(player hits warp && key up pressed){do the thing}...

Can I just fire off some sort of code in the input editor like

Cmp warptile (whatever the variable is)
Lda gamepad
And %#0000001
Bne +
Warpout (whatever that variable is)
 

Mugi

Member
LDA gamepad
AND #%00010000 ; is up pressed ?
BNE gosomewhere ; up is pressed, do something
JMP goSomewhereElse ; up was not pressed, jump to RTS or whaever else you want to do
gosomewhere:
this is where you go if up was pressed
RTS
goSomewhereElse:
this is where you come when up was not pressed (just put RTS here to terminate the code)
 

digit2600

Member
Mugi said:
LDA gamepad
AND #%00010000 ; is up pressed ?
BNE gosomewhere ; up is pressed, do something
JMP goSomewhereElse ; up was not pressed, jump to RTS or whaever else you want to do
gosomewhere:
this is where you go if up was pressed
RTS
goSomewhereElse:
this is where you come when up was not pressed (just put RTS here to terminate the code)

Am i editing the warp tile code for this ?
 

Mugi

Member
np :)

it's more or less a straight copypaste of one of my custom tiles so i was pretty confident it works.
 

digit2600

Member
Only problem now is... warping isn't cooperating lol...
It's blasting me out to some blank screen i'm getting snagged on ?
 

Mugi

Member
try this one:

http://nesmakers.com/viewtopic.php?f=60&t=2084&p=12552&hilit=warp+problem#p12552
 

baardbi

Well-known member
I can't get this to work. I have edited WarpToScreen.asm for SimplePlatformer, but it's like the script doesn't trigger. The character warps as soon as I come in contact with the door. Am I changing the wrong script?

Here's my WarpToScreen.asm file:


; cpx player1_object
; BNE dontDoWarp_tile
; LDA warpMap
; sta currentMap
; clc
; ADC #$01
; STA temp
; GoToScreen warpToScreen, temp

; dontDoWarp_tile

LDA gamepad
AND #%00010000 ; is up pressed ?
BNE gosomewhere ; up is pressed, do something
JMP goSomewhereElse ; up was not pressed, jump to RTS or whaever else you want to do

gosomewhere:

LDA #$00
STA newGameState
LDA warpMap
sta currentMap
clc
ADC #$01
STA temp
GoToScreen #$00, temp, #$03
LDA #$00
STA playerToSpawn
LDX player1_object
DeactivateCurrentObject
LDA #$01
STA loadObjectFlag

LDA mapPosX
STA newX
LDA mapPosY
STA newY
RTS

goSomewhereElse:

RTS
 
Top Bottom