+Random Terrain Posted September 25, 2005 Share Posted September 25, 2005 1. What is the best way to get rid of a sprite or missile or ball? (Please don't say change the color to the background color.) 2. Can you define part of a sprite using data statements? I know you can use this to create a sprite: player0: %00100010 %01110111 %01111111 end but it would be nice to be able to use data statements. Say I want to have an enemy that always looks different. I could have a bunch of top halves and a bunch of bottom halves in data that could be combined to create a new looking enemy each time you play. Is that possible? Thanks. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted September 25, 2005 Share Posted September 25, 2005 1. What is the best way to get rid of a sprite or missile or ball? (Please don't say change the color to the background color.) 2. Can you define part of a sprite using data statements? I know you can use this to create a sprite: player0: %00100010 %01110111 %01111111 end but it would be nice to be able to use data statements. Say I want to have an enemy that always looks different. I could have a bunch of top halves and a bunch of bottom halves in data that could be combined to create a new looking enemy each time you play. Is that possible? Thanks. 937872[/snapback] The easiest way to get rid of a sprite when you don't want it anymore is to define it as one 0 byte: player1: %00000000 end It might also be possible to just set the player1height to 0, but I haven't tried that to see if it works. As far as using data tables for sprites, again I haven't tried it to see if it works, but there's a player0pointer (and player1pointer, etc.) that points to the two-byte ROM address where the player data starts, so you could probably set the pointer values yourself-- but be sure to use the correct format, which I think is LSB/MSB, so for example if you know the starting byte for the data you want is in address $FA23, you would set player1pointer[0] to $23 and set player1pointer[1] to $FA. The trick would be having to know the addresses for the bytes you want to use, and you'd also need to set the height value appropriately so bB knows where the data ends. As for creating mixed-up sprites that combine a varying top half with a varying bottom half, I doubt if you can do that in 0.35, because you won't be able to play with the pointers enough to achieve that. But it may be possible with a multiplayer kernel once that gets added to bB, if you define the top half as a player and the bottom half as another version of the same player. It would probably be tricky to do even in that case, and might not be doable, depending on the limits/constraints of the multiplayer kernel. Michael Rideout Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 25, 2005 Author Share Posted September 25, 2005 Thanks. Now I can get the first draft of this test game finished. Quote Link to comment Share on other sites More sharing options...
potatohead Posted September 26, 2005 Share Posted September 26, 2005 Why not just define all the sprite pieces and use an on-goto to sort 'em out at run time? Either way, the data sits in ROM, it's just how you address it. eg: player0: %00100010 %01110111 %01111111 end on bottomhalf goto 10 20 30 10 player1: %00100010 %01110111 %01111111 end goto skiphalf 20 player1: %00100010 %01110111 %01111111 end goto skiphalf 30 player1: %00100010 %01110111 %01111111 end skiphalf (rest of game) Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 26, 2005 Author Share Posted September 26, 2005 That's what I'd like to do since it's easier to understand, but that just redefines the sprite each time instead of adding to it as far as I know. It would be cool if a future version of bB let you tell the program exactly where in the sprite you would like the next stuff to go. For example, the following would start on the fifth line of a sprite: player0(5): %00100010 %01110111 %01111111 %01111111 end Quote Link to comment Share on other sites More sharing options...
+batari Posted September 26, 2005 Share Posted September 26, 2005 (edited) 1. What is the best way to get rid of a sprite or missile or ball? (Please don't say change the color to the background color.) Not sure if it's "best" but to "get rid" of objects I just move them off of the visible screen. e.g. if you make player0y=255, the sprite will not display. 2. Can you define part of a sprite using data statements? I know you can use this to create a sprite: player0: %00100010 %01110111 %01111111 end but it would be nice to be able to use data statements. Say I want to have an enemy that always looks different. I could have a bunch of top halves and a bunch of bottom halves in data that could be combined to create a new looking enemy each time you play. Is that possible? Thanks. 937872[/snapback] The problem here is all sprite data must be contiguous, and stored in ROM. It is generally necessary to write display kernels this way. If you wanted a separate top and bottom, you would need to define all combinations of tops and bottoms and select from one of those randomly. Probably the only way around this would be if someone modified bB to use a bankswitching scheme with additional RAM or something of that sort. That way the sprites could be put in RAM and individual lines could be modified. While such a thing is possible, it's unlikely to happen any time soon Edited September 26, 2005 by batari 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.