gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin
This is a problem that I skipped over a while ago in order to focus on getting a single room to work, but now I would like to have more than one room actually functional (think Adventure for the 2600, or any overhead action-adventure). I have different backgrounds, attributes, and palettes loading, but the question is: how to get different sprites for different rooms, while keeping the location of the hero sprite dependent on player input. If a looped sprite table is used, as found in the NN tutorials, the hero’s position understandably jumps to whatever location it is assigned in the table. If a routine similar to the UpdateSprites routine in NN Week 9 is used in place of this, and in combination with a routine that sets the initial position of the hero (similar to the "update ball stats here" section near the beginning of NN Week 9), hero movement is fluid, but all addresses must be individually declared. Further, all sprite locations ($0200, $0201, etc.) must first have a variable assigned to them (herox, heroy, etc.), creating a ton of extra variables that may or may not be needed. This becomes more confusing when the whole SPRITE_ constant system is used, since herox, heroy, etc. can all be replaced with SPRITE_ and function just fine. What exactly needs to be done when loading a new room to ensure that the hero’s location is kept, and that new enemy sprites are loaded? Should some sort of routine that stores and loads the hero’s last location be used? The looped table is really appealing, but it also seems to be fairly rigid when it comes to moving beyond single screen games (although I am hopefully just using it wrong). Do there need to be long lists of Update____ for each room (i.e. UpdateEneniesRoom1, UpdateEnemiesRoom2, etc.)? Any help would be greatly appreciated, and if this does not make sense just ask. I am guessing that this is a fairly easy problem, but something is wrong in my logic (brain or computer). I am more than ready to start playing around with sprites, but have been hung up on this problem for a while.
 
Examples of the three systems discussed above:
Room1spr: ; Table, there would be one of these for each room, or one at the
;vert tile attr horiz ; beginning of the playing state?
.db $C0, $00, $00, $70 ;Hero
.db $FE, $FE, $00, $FE
or
UpdateHeroSprite:
LDA HeroY ;;update all hero sprite info
STA $0200
LDA #$00
STA $0201
LDA #$00
STA $0202
LDA HeroX
STA $0203
RTS
In conjunction with:
SetInitialHeroLocation: ; Only used once at the beginning of the Playing State
LDA #$C0
STA HeroY
LDA #$20
STA HeroX
LDA #$01
STA InitialState
.Done
RTS
gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin
gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin