Hey I had a really cool idea. I'm not amazing at BASIC, but I know all the basics, and I am using it to make a customizable text game. Basically, here is how it is; it starts with a menu asking to create or play a level. I am nowhere near the playing a saved level part. At the create area, there is a line at 7,1 (Output(7,1,"----------------") and then at the bottom it tells you that you can access the creation menu. Pretty easy. There, it asks you to select the sprites for the following: Character (Str1), Exit (Str2), Wall (Str3), Enemy (Str4), and a Teleporter (Str5). Also easy. During the level making process, there are hotkeys for each of those. Character - 1, Exit - 2, etc. The cursor is a +. I already have the cursor's moving down, but here is the problem. First of all, I don't know how to keep a character where you place it if you move the cursor over it (like you place a wall and move the cursor over it, it just deletes it.) Also, from before, I don't know how to limit the sprites to one character. Plus, I have no clue how to save the levels in the end. One idea I had is to save it to a matrix, but I'm not sure how to do that. Any help, please?
As far as saving the level into a matrix, just create an empty matrix at the begining of the level that is 8x16 since that is the size of the screen and then if they put a character which is sprite 1 just store a 1 at that position in the matrix.
For your problem with the cursor just have a group of ifs after you move it to check the position that you just moved from and replace it with whatever is stored in that spot. Most likely choice for this is a matrix as well.
For your problem with the cursor just have a group of ifs after you move it to check the position that you just moved from and replace it with whatever is stored in that spot. Most likely choice for this is a matrix as well.
To block your cursor from running into things you could just check so that before it changes the coordinates of the cursor, say X,Y, it would save it somewhere else such as (W,V). THen once you changed it you could check for the new values of (X,Y) if there is anything there already an if so, store (W,V) to (X,Y)...
But hmmm.. a text game? I would suggest using strings rather than matrices to create a single-stringed-map as your background containig the obstacles and exits... etc....
But hmmm.. a text game? I would suggest using strings rather than matrices to create a single-stringed-map as your background containig the obstacles and exits... etc....
Yeah, I definitely agree this is an application that you should be using strings for rather than matrices or lists.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement