View Full Version : Gatekeeper Help
tHobbs
10-13-2008, 10:02 AM
I am quite confused on the Gatekeeper Project (page 178, Learning To Program w/Alice book).
I cannot seem to think of a code to make two of the objects switch places, I can get one, but the getting the other is confusing.
Any suggestions?
lanceA
10-13-2008, 05:24 PM
I am quite confused on the Gatekeeper Project (page 178, Learning To Program w/Alice book).
I cannot seem to think of a code to make two of the objects switch places, I can get one, but the getting the other is confusing.
Any suggestions?
If you have two objects beside one another you probably need to determine which object was "clicked" first. Then you can use the function Object is to the left of (or right of). Then maybe use a Do Together and place statements like:
If object clicked is to the left of object NOT clicked
Do Together
Object1 move left Object1 Distance to Object2
Object2 move right Object2 Distance to Object1
otherwise the object clicked is on the right and you place the opposite code in your Else portion of the If statement.
I used the Do Together structure because this allows Alice to compute distances from each object before any of the objects move.
Good luck
dan2343
10-14-2008, 10:11 AM
Does anyone have a completed version of the gatekeeper?
tHobbs
10-14-2008, 06:05 PM
Does anyone have a completed version of the gatekeeper?
why would you want a complicated one?
lanceA
10-14-2008, 08:17 PM
Does anyone have a completed version of the gatekeeper?
I do, but I am a teacher and unfortunatly can not give it to you? Does your teacher also come here to see if any of his/her students are looking for others to do their homework? Several teachers have introduced themselves to their students in this forum.
It's extremely hard to learn to program unless you first try to do it yourself.
To solve this problem use my previous post about moving Objects. The solution to the project is to have the Gatekeeper in position 4.
As you already know, you will need to write your own methods and Event Handlers.
If you stop and thank about it the code will not be that difficult to write. Visualize the problem that you need to solve for this project, draw it on paper if you need to. Logically visualize the steps you need to go through in order to solve this problem.
Good luck, :)