Hi! I am making a game for school, and making an app similar to the game Simon, where you replay the colored buttons by memory. I have had very limited experience with App Inventor, and don't even know where to start. I am guessing I have to create a code that repeats itself randomly; however, how then do I create a code that will know if the user correctly replays the series of buttons? I am looking for any and all help regarding making this app. I have already created 4 buttons for the 4 buttons that will be used, as well as two others, pause and restart. I hope this makes sense, I have included a screenshot of what I have already completed.
You are building a complicated app, even complicated for an expert.
Do we have this correct:
Four buttons that the will start a color sequence, randomly changing the color of each button. A button will reset using a different random pattern. We do not know what you want to do with the pause button.
The user has to replay the colors shown in the buttons.
RED BLUE GREEN RED. Don't you need eight total buttons? Four for the app to display, four for the user to touch a pattern?
The app displays the above pattern, then hides the buttons from the User?
Then the user has Four buttons, RED BLUE GREEN ORANGE and has to properly press RED BLUE GREEN RED in sequence perhaps.
Is this the way the game would be played? Or is this a game I just invented? :)
You will need a List of four colors to be displayed randomly in the upper buttons.
You will need write a routine to randomly pick a color for each of the four upper buttons .... set Button1.BackgroundColor to ..... for each of the upper buttons.
Then using a Clock, you will have the buttons displayed for a number of seconds and then disappear? Set Button1.Visible to false; Button2.visible to false.etc,
Then the player tries to pick the color sequence Red Blue Green Red. If he pick the buttons in the correct order he/she wins? If not, a rooster crows mockingly? ...to do this, the correct sequence has to have been saved somewhere and the squence the play presses has to be recorded, then compared to the original.
Have you workout a chart showing how all this is supposed to work?
Have you done any tutorials?>
We want you to have fun with App Inventor so here are some resources to help you learn to use the AI2 tools A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles
How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .
Does this help you program. Please continue to ask questions here however if you read the information above, you will not have to wait for answers.
Just try some blocks and have fun.
To make this program, I would make several small Projects, creating the necessary parts for each step in the game. When you know howw to color the buttons randomly, save the result etc; then put all the pieces together in your Simon app perhaps?
--
Here are the rules ...
You will need to keep a list of button numbers (1-4) representing the button choices made by the game so far.
The list should start out empty, and grow by one random number (1,2,3,4) each round.
You will need 4 sound files, for the 4 buttons.
You will need a global variable to keep track of which step number in the choice list the computer is
going to play next, as the computer plays the sequence for the player to hear.
You will need another global variable to keep track of how far the player has gotten in the choice list
while trying to mimic what the computer just played.
You will need a global variable to keep track of whether the computer is playing or is listening.
You will probably need a score keeping label too.
You will need to keep a list of button components to use with the Any Button blocks to flash their colors
as the computer plays them.
That should get you started.
--
댓글 없음:
댓글 쓰기