graywest Posted February 24, 2015 Share Posted February 24, 2015 Hello all. I'm fairly new to Batari Basic, but I have played around some. Is there a way to create a variable player sprite? Basically, I would like to create enemies that are built from various pre-defined pieces: heads, torsos and legs that can combine in different ways. Do you have to define the player sprites in one uninterrupted block? I tried to use if/then statements in the middle of the player definition, but it didn't seem to work. Could be that I am not doing it right... Or is there another way to do this? Are there reserved variables (like the playfield variables) that contain the player data? Thanks for the help. Quote Link to comment Share on other sites More sharing options...
bogax Posted February 24, 2015 Share Posted February 24, 2015 with bB I think you'd have to put the sprite data in RAM where you could manipulate it and point the sprite pointer(s) at the ram (normaly the sprites are just blocks in ROM you can choose diferent ones but you can't change them) Quote Link to comment Share on other sites More sharing options...
graywest Posted February 24, 2015 Author Share Posted February 24, 2015 with bB I think you'd have to put the sprite data in RAM where you could manipulate it and point the sprite pointer(s) at the ram (normaly the sprites are just blocks in ROM you can choose diferent ones but you can't change them) I think I see what you're getting at. So instead of the normal player definition like: if r = 0 then player0: %00001000 I could set a variable like: a = %00001000 b = etc... c = etc... And then define the player: player0: a b c end Will something like that work? Quote Link to comment Share on other sites More sharing options...
bogax Posted February 24, 2015 Share Posted February 24, 2015 dim rand16 = z dim count = y rem the location of variable a is $00D6 player0pointerhi = $00 player0pointerlo = $D6 rem the sprite will be 10 bytes, 0..9 rem here that's variables a..j rem the tenth location, location 9 rem is the top player0height = 9 player0x = 80 player0y = 40 rem just to show us where we are j = $FF loop count = count - 1 COLUP0 = $3A drawscreen if count then loop count = 30 rem just scrolls some random rem stuff through the sprite to rem show something happening for temp1 = 0 to 8 temp2 = temp1 + 1 a[temp1] = a[temp2] next rem j is a[9] the top of the sprite j = rand goto loop 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.