LoginLogin

Game Ideas

Root / Programming Questions / [.]

KevinTheDumbCatCreated:
I know this already exists,but... Let's be honest: I'm a noob at SB, and every game idea I come up with is too advanced. So I'm creating this thread to compensate for my lack of creativity. I hope at least one person shares something on here... PLEASE SHARE SOMETHING

circle game tap inside a randomly placed circle and tap the next one as fast as you can

Simple incremental game where you push a button and you get more money which lets push the button more and more. Something like that..

Simple incremental game where you push a button and you get more money which lets push the button more and more. Something like that..
🤔 hmmmm

Ok, I am going to try to keep things text mode only. Let's start at the start. 1. Hello World. Literally write a program that says "Hello, World". I will even provide the code to you.
PRINT "Hello, World!"
The point of this is to get to know the development environment more than anything else. Learn how to save your program, how to load the program and how to run the program. Simply writing in the read eval print loop isn't what you want to learn from this. 2. Let's elaborate on the previous program, put that in a loop and try to print "Hello, World" a bunch of times, or even forever. Try using a FOR/NEXT loop, a WHILE/WEND loop, and a REPEAT/UNTIL loop. Don't use GOTO, it is bad and rots your brain. When you are done you should be able to tell me that FOR/NEXT is great for executing a loop a set number of times. That a WHILE loop is top tested and that a REPEAT loop is bottom tested, and that you might want to choose one or the other depending on if you want the loop to be evaluated at least once. This is slow moving so far. 3. Lets do some input/output. Write a program that asks the user their name. Then after they enter it, print out Hello + their name. Next ask their age after they enter it, print out how old they will be in 10 years. Finally if they are less than 8 years old tell them they are a kid, if they are over 30 tell them they are old news, if they are in between 9 and 29 just say "cool". You should be learning to read input from the keyboard with INPUT. You should be seeing the difference between number and string variables (age, and name). You should also be learning to do a IF/ELSE IF/ELSE conditional statement (don't just use three IF statements please). So far you can do all of this in one sitting in less time than this took to type up. 4. The next one is still not a game. I want you to make a program that will ask the user a temperature in degrees Celsius then print out the same Temperature in Fahrenheit. Then do the reverse ask for a temperature in Fahrenheit and print the equivalent temperature in degrees Celsius. However, the trick is I want you to do the Fahrenheit to Celsius and Celsius to Fahrenheit calculations in separate functions (using DEF). The last trick is I want you to also make a subroutine that just prints out 20 copies of a character you pass in as a parameter (all on the same line), and call it between the two temperature calculations. What are you learning in this one? You are learning to create functions, to return a value and about the syntax difference between a procedure and a function (hint parameter parenthesize, and RETURNing values). This teaches you to decompose your code into smaller reusable chunks. Do NOT use goto or gosub. 5. Ok, on to a real game. Guess the number. The computer thinks of a number between 1 and 10 (or 1 and 100 you decide). You take turns trying to guess the number. If it is too small the computer says so, if it is too large the computer says that too, if it is a match you win. You can also put in a maximum number of tries before you lose, or reverse the game and you get to think of a number and the computer tries to guess it. What are you learning? You are learning to generate random numbers (RND), and how to structure a game loop. You also just made a game, congratulations. Feel free to gold plate it with back ground colors, or sound effects using BEEP. Ok, now we are going to start making larger games in bigger steps. 6.Hangman. I want you to have a separate file with a list of words (comma separated values would be great). Load the text file, read though the big string that smile basic gives you back and fill up an array with the possible words (see PUSH/POP) (don't just use READ/DATA, I want you to learn to read a file). Pick a random number between 0 and one less than the length of the array of words. That will be the index into the array of your secret word. Use ASCII art to draw the man in a function. If you have no wrong guesses draw nothing, one wrong guess you draw a head, 2 = a head and torso, 3 and 4 add an arm each, 5 and 6 add a leg each.At 6 wrong guesses the game ends in failure and the man should have X's for eyes. The game should have an array of guessed letters. It should ask the user for a letter. This time read the keyboard using INKEY$ so they don't have to hit ENTER. Ignore keypresses that are not A-Z (optionally convert a-z to A-Z) or any guesses already typed. You should also have a display with the word with guessed letters shown and missing letters replaced with underscores (_) (if the word is guess, and I chose S, I should see both S's). You should print out the list of guessed letters too.If the user guesses all of the letters in the word before they run out of limbs, they win. If they win or lose ask them if they want to play again and if so, reset all of the local variables (keep the word list) so that none of the previous game bleeds through (do pick a new word each time). What did you learn, a lot actually. You learned to read a file from disk (or SD card), you learned to parse though a large string, you learned how to fill and use ARRAYS. 7. Quiz, a small variation on hang man.Again use a file. We load in a list of questions plus their multiple choice possible answers, and which is the right answer. Again I would put things in an array or set of arrays. Then pick ten or so random questions, ask the user for the correct answer. Let them choose, and tell them if they are right or wrong, with a final score at the end of the game (with a try again option). The tricky part I am adding is lets put the multiple choice questions in a menu. I want you to read button state using BUTTON, use LOCATE to position the cursor, and potentially change the COLOR to highlight a word and allow the user to use up and down to scroll through menu choices (you can have four as the maximum number of choices, I'm not cruel), then press A to make a selection. So it should look something like:
Which is the Fire Lizard PokeMon?
  Bulbasaur
> Charmander
  Squirtle
What are you learning? How to read the input from the buttons, how to read and create more structured data (harder than just a word list), and how to position text and change text color on screen. Do try to keep the menu in a function, you are likely to want to reuse it later. 8. ASCII art Whack a Mole. I want the program to draw text on the touch screen. There will be at least four areas on the screen. Randomly one of the areas will be filled with an ASCII art Mole. The mole will only stay for a second (or less). The user should tap the screen where the mole is. If they hit the right area, they get a point. If they hit an area without a mole they lose a life. If the mole leaves without being tapped on, this also causes the user to lose a life. It is game over when they miss too many times. Please use sound effects, one for a hit, another for a miss. What are you learning? Convert text to pixel coordinates (hint characters are 8x8 pixels), how to read input from the touch screen, and timing (gotta make the moles appear and disappear on time) 9. Tic Tac Toe / Naughts and Crosses. I want you to allow player versus player, player versus computer and computer versus computer play. Now you need to learn how to make a computer AI opponent. It also has to be generalized enough to be put on either one player, both players, or neither player. You also need to put in game rules that will figure out a win a loss, or a draw. Bonus points if you put in something like min/max search with alpha beta pruning. 10. Choose your own Adventure Story. See cyoa.com, if you don't know what this is. The trick is of course I want you to read the parts of the story from disk again. The last part should either give you a ending or a choice of options (please re-use the menu function from earlier). Choosing an option should load a matching file for the next part of the story. At a THE END allow the user to start over again from the first file of the story. The tricky part, is I want you to paginate the story. If a story page is too big to fit on one screen, then you should allow the user to page back and forth through it (bonus points if you give them touch screen buttons). What are you learning? Pagination of long text strings, code reuse, and mapping user input to commands. 11. Word Jumble. You get a word from a dictionary of words (go ahead and re-use the word list from hangman). Scramble to word, and ask the user to figure out what it is. They lose if it takes too many guesses. Guessing correctly chooses a new word. What did you learn? Well nothing new really, just extra practice. 12. PONG. Make a text mode version of PONG. I would again like flexible user versus computer options. What do you learn. Real-time updates of the screen at a fast frame-rate (hopefully), physics to make the ball bounce, and why making a perfect AI computer opponent gets really old really fast (make it flawed but not too easy). 13. Since you made PONG, you should probably make BREAK OUT too. Not much more to learn except we now have many more objects to bounce into. I also want bricks to have a different number of hit points based on their color. Try to design nice level patterns and read them from disk. 14. Moving right along on the text mode puzzle game train, how about TETRIS (columns , puyo pop, or Dr. Mario are also acceptable but may be harder in text mode). Hmm, the what you learned part is getting pretty slim now. 15. Maze. Using Depth first search see (https://en.wikipedia.org/wiki/Maze_generation_algorithm) Generate a maze, choose a starting and ending location, and have the user find their way from the start to the end. This can go on endlessly if you would like. 16. Text Adventure game. You should have a series of interconnected rooms. You move between rooms by entering commands to the computer such as GO NORTH, or just NORTH, or maybe just N. The rooms should be able to have at least one object inside that you can pick up (like say treasure or a weapon). Some random monsters to fight is also good to put in. Try to tell a story. We are going for a Dungeons and Dragons sort of thing here with the computer a dungeon master. Put in as good of a parser as you can to read text input from the user and translate it into actions in the game. When you are done you should have the idea that if this had actual graphics and a mouse interface/button interface you could make something like kings quest or maniac mansion. At this point you are probably read to move on to graphics. Try remaking some of this with drawings/sprites.

Wow... I didn't think anyone would actually comment/post on this thread. This is definitely a good start. Thanks!

...read through the big string that smile basic gives you back and fill up an array with the possible words...
I just can't figure it out. I've searched the internet. Nothing. I tried to figure it out for myself. Nothing. I just can't seem to figure out how to check if there's a comma in a string, and then save the word that came beforehand. I'm completly stuck. HELP

You want to look at string functions. LEFT$(string, count) returns the first count characters of a string. RIGHT$(string, count) returns the last count characters of a string. MID$(string, index, count) returns count characters from a string starting at index (zero based if I remember correctly). Gives you a section of a string. INSTR(index, string_to_search_through, string_to_look_for). Searches for a string within another string. Returns -1 if not found and the character index if it was. LEN(string) returns number of characters in a string. Works for arrays too. You could probably get away with looping over every character in the file with MID$, but I would recommend using INSTR as it should be a lot faster. So you would have an index variable starting at zero, find the index of the next comma with INSTR. Grab the characters in between the current and previous comma with MID$. Use PUSH to add the sub string to a word list array, then move your index forward to one past the ending location of the last find and continue until you run out of matches. You will need some special code to handle the last word. You may also want to trim off any trailing or leading spaces, tabs CHR$(9), or Carriage Return/Line Feed CHR$(10), CHR$(13), and skip adding empty (zero length) strings to the word array. DIM word$[0] should get you an empty string array to add words to with PUSH. Hope that helps.

That definitely helps. Now I think I'm ready to try this. Thanks!

I decided to make hangman myself. It sounded like fun. For practice I made it in Fuze Basic on my PC. Hopefully it will get me ready for the Switch version. It came in at 432 lines. P.S. The word is INSECT