jrok Posted October 30, 2008 Share Posted October 30, 2008 (edited) I'm trying to write a tile-based adventure game, and was curious if there was any way in bB to use the "playfield:" definition to define the x,y positions of something other than a pfpixel. For example, right now the playfield definitions use "X" and "." to define the on/off state of a pfpixel. playfield: XXXXXXXXXXXXXX....XXXXXXXXXXXXXX X..............................X X..............................X XXXXXXX........XXX.............X ..............X...X............X ..............X...X............X ..............X...X............X XXXXXXX........XXX.............X X............................... X............................... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ end But I noticed that you could use just about any alpha-numeric symbol to determine value of the pixel, which will automatically be defined as "off" when compiled. For Example: playfield: XXXXXXXXXXXXXX....XXXXXXXXXXXXXX X..............................X X......................a.......X XXXXXXX...1....XXX.............X ..............X...X............X ..............X...X............X ..............X...X............X XXXXXXX........XXX........b....X X........2...................... X............................... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ end So my question is, would a superchip kernel be possible that would allow us to include user defined variables in playfield definitions? For instance, typing letter between a-z on a playfield could determine the starting location of a certain sprite or missile? I imagine such a kernel would have to use up two adjacent variables to perform that sort of function, but if you aren't using pfcolors or pfheights, could those vars be used? Or maybe I'm just thinking about this in the wrong way. Edited October 30, 2008 by jrok Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted October 30, 2008 Share Posted October 30, 2008 I'm trying to write a tile-based adventure game, and was curious if there was any way in bB to use the "playfield:" definition to define the x,y positions of something other than a pfpixel. For example, right now the playfield definitions use "X" and "." to define the on/off state of a pfpixel. playfield: XXXXXXXXXXXXXX....XXXXXXXXXXXXXX X..............................X X..............................X XXXXXXX........XXX.............X ..............X...X............X ..............X...X............X ..............X...X............X XXXXXXX........XXX.............X X............................... X............................... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ end But I noticed that you could use just about any alpha-numeric symbol to determine value of the pixel, which will automatically be defined as "off" when compiled. For Example: playfield: XXXXXXXXXXXXXX....XXXXXXXXXXXXXX X..............................X X......................a.......X XXXXXXX...1....XXX.............X ..............X...X............X ..............X...X............X ..............X...X............X XXXXXXX........XXX........b....X X........2...................... X............................... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ end So my question is, would a superchip kernel be possible that would allow us to include user defined variables in playfield definitions? For instance, typing letter between a-z on a playfield could determine the starting location of a certain sprite or missile? I imagine such a kernel would have to use up two adjacent variables to perform that sort of function, but if you aren't using pfcolors or pfheights, could those vars be used? Or maybe I'm just thinking about this in the wrong way. You can define the characters that mean "on" and "off," as described in the batari Basic help documentation, but right now there's no special compiler feature that lets you use different characters to mean different things than "on" and "off." It sounds like an interesting idea, but I'm not sure how that functionality could be added to the compiler. Michael Quote Link to comment Share on other sites More sharing options...
jrok Posted October 31, 2008 Author Share Posted October 31, 2008 You can define the characters that mean "on" and "off," as described in the batari Basic help documentation, but right now there's no special compiler feature that lets you use different characters to mean different things than "on" and "off." It sounds like an interesting idea, but I'm not sure how that functionality could be added to the compiler. Michael Thanks for the info, Michael. I assumed this was pretty set in stone. I've already begun work on a web-based level editor for my game that outputs bB formatted code. I will go ahead and incorporate this functionality into it. I'll try to generalize it as much as possible and shoot out a link when it feels like its reached a good place. I think it could be useful for certain types of Adventure-style games, and probably even for games like Combat with lots of selectable screens. Cheers, Jarod. 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.