Well, back to a Macintosh Performa 5200 in 1996 in Saudi Arabia and my 2 sons: 1 and 4 years old, and this:
-
-
This was part of an Edmark CD-Rom called "Sammy's Science House":
-
-
https://en.wikipedia.org/wiki/Early_Learning_House
The idea behind this exercise was for small kids to drag beasties of various categories into various rubbish bins.
Mimicking this program is a wonderful way to get one's head round OXT's drag-&-drop capabilities.
Download the original here:
https://macintoshgarden.org/games/sammys-science-house
Back To The Future with Drag-&-Drop
- richmond62
- Posts: 4682
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Back To The Future with Drag-&-Drop
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4682
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Back To The Future with Drag-&-Drop
So, let's start off with a stack with 2 rubbish bins and 6 beasties: 3 insects, and 3 non-insects:
- -
- -
- Attachments
-
- SORTING.oxtstack.zip
- (52.66 KiB) Downloaded 154 times
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4682
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Back To The Future with Drag-&-Drop
Before we get into drag-and-drop we need to set up a button to return the animal to where they started:
- - -
- - -
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4682
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Back To The Future with Drag-&-Drop
So that we can move an image with the mouse we give it the following code:
- -
We put the grab me code inside a mouseDown command so when we release the mouse the image stops moving.
- -
We put the grab me code inside a mouseDown command so when we release the mouse the image stops moving.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4682
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Back To The Future with Drag-&-Drop
Now we have to make sure that when an image is dragged to the CORRECT rubbish bin it stays there, and when an image is dragged to the INCORRECT rubbish bin it is returned to its original location.
Here is the code for the 'ladybird':
- -
Line 6 checks if the ladybird overlaps the rubbish bin for insects.
If this is true,
Line 7 makes the ladybird invisible.
Line 8 sends the ladybird back to its start position.
If this is not true,
Line 10 sends the ladybird back to its start position.
Obviously we now have to put extra code into the RESTART button so all the animals become visible again:
-
Here is the code for the 'ladybird':
- -
Line 6 checks if the ladybird overlaps the rubbish bin for insects.
If this is true,
Line 7 makes the ladybird invisible.
Line 8 sends the ladybird back to its start position.
If this is not true,
Line 10 sends the ladybird back to its start position.
Obviously we now have to put extra code into the RESTART button so all the animals become visible again:
-
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4682
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Back To The Future with Drag-&-Drop
I am uploading the stack at this stage so that YOU can complete the exercise by yourself.
- Attachments
-
- SORTING.oxtstack.zip
- (53.21 KiB) Downloaded 151 times
https://richmondmathewson.owlstown.net/
Who is online
Users browsing this forum: No registered users and 0 guests