[A83] Re: Mario Side-Scroller


[Prev][Next][Index][Thread]

[A83] Re: Mario Side-Scroller




When you use crashman's tilemap routine, you can't use any normal sprite 
display code, in fact you shouldn't even think about touching plotsscreen or 
savesscreen (and if you never relocated the 1k block to there, then you lose 
your programs and variables at the end of ram). You have to use the masked 
sprite routine that comes with it, which writes to the Tilemap Compatible 
graphmem.

To move sprites based on new X coordinates vs old X coordinates, just 
subtract the screen's X position from the sprite's X position, then draw it 
there.

You might want to try storing your map data compressed, then there are no 
line length problems.  If you want to take compression even farther, you 
could attempt Nintendo's very own system that they used in Mario 1.  They 
fit all world 1-1 through 8-4 into less than 5000 bytes of space!

>From: Sk8a4good@aol.com
>Reply-To: assembly-83@lists.ticalc.org
>To: assembly-83@lists.ticalc.org
>Subject: [A83] Mario Side-Scroller
>Date: Sat, 26 May 2001 20:59:37 EDT
>
>
>If I have a level for a game like mario, how do I display it and then 
>scroll
>it left and right when the right button is pressed.  I used crashman's
>routine demo at first, and I could get it to draw and scroll the level, but 
>I
>couldn't get it to draw the sprites and do the stuff I wanted to happen in
>the mainloop.  Also, how do I make a map over 32 wide?  When I use the 'db'
>statements it says max # of args exceeded.  Thanks
>-Cole South
>
>mapbuffer:
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>.DB   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
>
>map:
>  .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;Row 
>0
>  .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;Row 
>1
>  .db $00,$00,$00,$00,$00,$00,$08,$00,$00,$00,$00,$00,$00,$00,$00,$00 ;Row 
>2
>  .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$1A,$00,$00,$00,$00,$00 ;Row 
>3
>  .db $00,$00,$00,$00,$00,$00,$00,$00,$00,$1A,$1A,$00,$00,$00,$15,$00 ;Row 
>4
>  .db $00,$00,$00,$17,$1C,$1C,$1C,$1C,$1C,$1C,$1C,$18,$00,$00,$16,$00 ;Row 
>5
>  .db $01,$01,$01,$1B,$1B,$1B,$1B,$1B,$1B,$1B,$1B,$1B,$01,$01,$01,$01 ;Row 
>6
>  .db $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02 ;Row 
>7
>
>rMario:
>  .db $3C,$48,$44,$38,$54,$6C,$6C,$38
>
>graphic_source:
>  ;Tile 0
>  .db $00,$00,$00,$00,$00,$00,$00,$00
>  ;Tile 1
>  .db $FF,$04,$00,$20,$AA,$55,$AA,$55
>  ;Tile 2
>  .db $55,$AA,$55,$AA,$55,$AA,$55,$AA
>  ;Tile 3
>  .db $3C,$42,$81,$81,$FF,$6A,$56,$3C
>  ;Tile 4
>  .db $01,$02,$04,$09,$10,$21,$42,$A5
>  ;Tile 5
>  .db $80,$40,$20,$90,$08,$84,$42,$A5
>  ;Tile 6
>  .db $FA,$FD,$FF,$FF,$FF,$FF,$FF,$FF
>  ;Tile 7
>  .db $5F,$BF,$FF,$FF,$FF,$FF,$FF,$FF
>  ;Tile 8
>  .db $7E,$DB,$A5,$89,$99,$81,$DB,$7E
>  ;Tile 9
>  .db $7E,$E7,$DB,$F7,$E7,$FF,$E7,$7E
>  ;Tile 10
>  .db $18,$24,$4A,$4A,$4A,$42,$24,$18
>  ;Tile 11
>  .db $00,$00,$FF,$57,$2F,$37,$2F,$37
>  ;Tile 12
>  .db $00,$00,$FF,$EA,$F4,$EC,$F4,$EC
>  ;Tile 13
>  .db $2F,$37,$2F,$37,$2F,$37,$2F,$37
>  ;Tile 14
>  .db $F4,$EC,$F4,$EC,$F4,$EC,$F4,$EC
>  ;Tile 15
>  .db $F5,$EA,$FF,$FF,$FF,$FF,$FF,$FF
>  ;Tile 16
>  .db $AF,$57,$FF,$FF,$FF,$FF,$FF,$FF
>  ;Tile 17
>  .db $3C,$48,$44,$38,$54,$6C,$6C,$38
>  ;Tile 18
>  .db $3C,$12,$22,$1C,$2A,$36,$36,$1C
>  ;Tile 19
>  .db $3C,$7E,$DB,$FF,$FF,$7E,$3C,$42
>  ;Tile 20
>  .db $3C,$7E,$DB,$FF,$FF,$7E,$3C,$24
>  ;Tile 21
>  .db $00,$3C,$7E,$FF,$FF,$FF,$FF,$FF
>  ;Tile 22
>  .db $FF,$F9,$F9,$FF,$FF,$FF,$FF,$FF
>  ;Tile 23
>  .db $7F,$84,$80,$A0,$80,$82,$80,$90
>  ;Tile 24
>  .db $FE,$21,$01,$05,$01,$41,$01,$09
>  ;Tile 25
>  .db $FE,$05,$01,$21,$AB,$55,$AB,$55
>  ;Tile 26
>  .db $2B,$55,$2B,$55,$2B,$55,$2B,$FF
>  ;Tile 27
>  .db $40,$04,$00,$20,$AA,$55,$AA,$55
>  ;Tile 28
>  .db $FF,$20,$00,$02,$00,$40,$04,$00
>  ;Tile 29
>  .db $00,$00,$00,$00,$00,$00,$00,$00
>  ;Tile 30
>  .db $00,$00,$00,$00,$00,$00,$00,$00
>  ;Tile 31
>  .db $00,$00,$00,$00,$00,$00,$00,$00
>  ;Tile 32
>  .db $00,$00,$00,$00,$00,$00,$00,$00
>
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com