Trying to create object on a specific screen

pavement100

New member
Like the title says, I'm trying to create a monster generator but on a specific screen. This is the code I'm using for the doHandleGameTimer script and screen X=5 Y=3 is the screen I want the objects to be created on. Not the starting screen or any other. Thank you in advance for any and all help! :)

LDA gameTimerTicks
CLC
ADC #$01
STA gameTimerTicks

BCC +normalWhatev

CreateObjectOnScreen 80, 80, 10, 0, 53

+normalWhatev

LDA gameTimerLo
ADC #$00
STA gameTimerLo
LDA gameTimerHi
ADC #$00
STA gameTimerHi
 

Bucket Mouse

Active member
CreateObjectOnScreen doesn't do that. In fact I'm not entirely sure what it's for, but I do know it isn't for specifying a specific screen for a monster to appear on.

The current screen number is scored in currentNametable. I would compare that variable to the number of the screen you want, and if it doesn't match, it should branch. Otherwise it would draw that specific monster. That's how I'd do it.
 

nestique

New member
Using screen type I was able to add the following lines to the top of your code:
Code:
LDA screenType
CMP #9
BNE +normalWhatev
and changed the macro to CreateObject:
Code:
CreateObject #$70, #$00, #$33, #$00 ;;; x tile, y tile, object, actionstep
and it worked for me, monster generator on that screen type only.
 
Top Bottom