Quote:
Originally Posted by foobangdao
I would like to do the initial selection process parts, male/female skater gender and novice/normal/hard difficulty.
|
1. Learn about variables to do this first part you need to understand what a variable is how to make them change them and use them.
- Variables are place holders.
- Variables are created with a certain "type" numbers, Booleans, objects ...
- The value that the variable is holding can be retrieved (Get) or changed (Set.)
So
- In the left top list make sure that "world" is selected.
- In the lower left dialog select the properties tab.
- At the top of the dialog press the "create new variable" button.
- Give the variable a name, something tied to what it is for is usually best, in this case maybe "difficulty" would be good.
- Pick the type, for this example we want a number.
- Select OK to close the dialog
The variable should be visible above the "create new variable" button.
Now PLAY until you understand what is going on.
- At the bottom of the right side grab "print" and drag it to the "world.my first method" method. In the pop-up select "object"
- Now select the variable "world.difficulty"
Run the movie and look below the screen, you should see the value of your variable.
Grab the variable and drag it into the method. Choose "set value" and give the difficulty variable a new value.
Copy the print instruction and move the copy below the "set" instruction.
Run the movie.
So the variable "difficulty" is a number that you can use to set the difficulty of the game. For example: Move skateBoarder up 1 meter duration 5/difficulty. Here, the larger the number the faster the skateBoarder character will move.
Add your two skateboarders to the movie and create a variable of type "object" to hold the selected skateboarer.
Write a method to do something using one of your skateboarders when it is working replace the skateboarder with the variable you created. Now changing the value of the variable will change the skateboarder who is being used.