Quote:
Originally Posted by Anques
That's so funny that's exactly how I did it, except with circles But now how would I somehow, record it? Maybe so that it can be played back to the person if they missed the pattern. Also so that the program can check and make sure the right patterns were clicked by the user?
I'm new to this so bare with me.... I have alot of ideas but it's super complicating to execute things in my head.... when in actuality it's super simple....
And Thanks!
|
Refer to the first post I made on this thread, but I am assuming you are new programming in general? if you are, lets get you familiar with some key pieces of information that will help you become successful using Alice, Variables are are found in properties of either the world class (look at the object list on the left hand side of your Alice browser) or the properties of individual objects, it is best to use world variables when dealing with general things such as the program you are trying to make.
Okay, now since you know where the variables are located, how do you create one? The answer is click create variable, a menu will pop up, you have to name the variable(name it something appropriate to what it is doing, such as place_holder_1) Now you may be asking yourself what does number,boolean,object,and other mean, well a number variable deals with data that is only numbers, boolean variables are variables that say whether something is true or false, and we won't get to the other stuff for now.
You may still be confused as to what a variable is, so here is a short definition of what it is, a variable is a empty piece of data that can altered or changed while code is being executed(while the world is running)
Now you should have a good grasp of what a variable is, now lets use this information to put it to use in your game, I would create as many number variables as there are changes in the pattern you have.
so whenever the change in the pattern is being made, it can assign the appropriate ordered number variable what ever the change in the pattern was.
Now that the variables have something assigned to it, you can use these varibles to play the pattern back using if/else statements.
so if first_place_holder==1
set box color to green
if second_place_holder==2
set box color to blue
if third_place_holder==1
set box color to green
of course this is just an example, but apply this logic and knowledge to your game and you should be set to go