Quote:
Originally Posted by rshoe
Mark:
Thanks for the information on the combo lock. I will look at it and make the changes..
As far as the Monty Game - I have made a list containing the three doors, and I set the car and the two monkeys to the doors as vehicle. I have made a method called swap with two doors as parameters. I'm not sure how to swap the doors and move them 2.5 meters in opposite direction with out moving them off the screen. I am having trouble starting this.
The book reads: "Use a method called swap that takes two doors as parameters. Swap the two doors by having them move 2.5 meters in opposite directions. Important: Two doors should swap only if they are different ( a door cannot swap places with itself).
Thank you for all your help.
Randy
|
Sorry for the delay in answering.
The short answer is you don't because the 2.5 meters will only work if the doors are (I am assuming) next to each other and if they are aligned exactly. This means they are not on an angle and one is not in front or behind another.
As in so many cases with Alice, setup is 80% of the exercise.
So the situation is as follows:
You have three doors, you want them spaced evenly and you want to know how far away each door is from the others. Lets look at one way to do this:
You already have your doors so this is what I would do:
- Pick a door to you want to be on the far left and move it to the center of the stage.
- Right click on the object in the list to the left of the stage, go to methods and select "turn to face" and pick the camera.
- Using the same "right click and pick a method" procedure move the door back far enough so that all three doors will fit in the scene.
- Still using the method above move the door to the left side of the scene.
You have one door where you want it for the start of the movie. I said to use methods instead of moving the object with the mouse so that the object's orientation to the camera does not change. And we started in the middle of the scene so that the door would be straight on to the camera. If the door were on the left and instructed to turn to face the camera, it would turn to the right some amount and the rest of our work would be slightly off.
- Make sure the Door you just positioned is selected.
- Drop a dummy object at the selected object. If you don't see the "Drop a dummy at the selected object" ensure you are in the "Add Objects" view and click the "more controls" button on the right under the icons.
- In the Object tree on the left click on the + sign to the left of Dummy
- Right click on the dummy object and name it left door.
- Select the right door
- Right click on the object tree, hover over methods and select "set point of view to" and pick the left door.
- Using the same procedure select "Move Right" and move the right door to the right of the screen. Keep track of how far you move it! and remember you can always use the undo button.
- Drop a dummy at the right door and name it right door.
- Follow the same procedure to orient and move the center door and move it 1/2 the distance you moved the right door.
- Again drop a dummy object and name it "center door"
You should now have 3 doors and more importantly you know how far to move a door so that it is in the place of another door. You should also be able to see that swapping one of the outside doors (right or left) with the center door will involve each door moving some distance while swapping the end doors will require each door to move twice that distance. If the door goes off the stage it is because it was moved in the wrong direction. In other words to swap the door on the left with the center door, we move the left door to the right and the center door the same amount to the left. Neither should leave the stage.
But wait there's more! You can now move the doors around without worrying about moving how far or in what direction or even which door is moving. How? By using the dummy objects!
- Pick two dummy objects.
- Find the doors with the same position as these dummy objects.
- Set the "point of view" of each door to the other dummy object.
Finding the doors with the same position as the selected dummy objects involves using the list methods, since you already said your doors were in a list.
Hope this helps
Mark