alice-teacher Combining objects 2.4.2

James Vanderhyde jvanderhyde at benedictine.edu
Thu Dec 4 09:57:12 EST 2014


There is no way to combine objects into 1 object in Alice 2. But there are some things you can do for a similar effect. If you want to access all the parts of the road in a program, then putting them in a list and using one of the list loop structures is the way to go. If you want to be able to move them all together, you can create a dummy object (or some other object that is easier to grab), and set the vehicle property of all the road pieces to the dummy object. Then when you move the dummy object, the whole road will go with it.

Now that I think about, if you combine these two approaches, you are essentially combining objects into 1 object. You can make the list of roads a property of the dummy object. I’m attaching a screenshot that shows an example. In my example, the vehicle property of the road pieces is set to the road sign.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu<mailto:jvanderhyde at benedictine.edu>
http://vanderhyde.us/~james/pro/


[cid:33BD5960-1FA2-469B-A998-35F79B502E8F at benedictine.edu]
On Dec 3, 2014, at 4:09 PM, Laurie Solomon Cohen <lscohen613 at aol.com<mailto:lscohen613 at aol.com>> wrote:

My students have created a circular race track with multiple parts of road, turn 2, turn 3, etc... Is there a way to combine all these to be 1 Object? Or would he have to just do a DoTogether with all of them?

Laurie Cohen
Yeshiva of Greater Washington
Silver Spring, MD
_______________________________________________
alice-teachers mailing list
alice-teachers at lists.andrew.cmu.edu<mailto:alice-teachers at lists.andrew.cmu.edu>
https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20141204/34dd2e1c/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2014-12-04 at 8.54.28 AM.png
Type: image/png
Size: 293377 bytes
Desc: Screen Shot 2014-12-04 at 8.54.28 AM.png
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20141204/34dd2e1c/attachment-0001.png 


More information about the alice-teachers mailing list