Squeak

 

3D Objects and Alice 1

Page history last edited by aikidave 3 yrs ago

I have some questions about using E-Toys to script 3-D objects in Alice.

 

It's amazingly cool. There's a lot of power here in getting

non-technical peole interested in Squeak and in programming, I

believe. I played with it with my 9 year old son, Matthew, last

night. It was striking to me that the E-Toy scripting stuff pulled

him in, but he quickly wanted to do things that were easier in the

Alice/text-scripting window. I built him a game using joystick

control of objects (see below), but when he started building his own

world, he was often asking me about the textual side of things.

"dragon1 move: up" was faster for him than finding the dragon1

viewer, finding the y, and increasing it enough.

 

Questions:

 

- I know (from talking to Andreas) that the plugin currently doesn't

support 3-D, so we can't use Alice in the browser. Is there a way to

add-in 3-D support if we need it, e.g., put a DLL in the VM

directory, add a file-in to the image, etc.? Or are there any plans

to eventually add 3-D to the existing plugin?

 

- I was trying to figure out how to make one object respond to

another one being close. I wanted to make a sound occur when the

WhiteRabbit got close to the banana in my world. I found that I

could create a tile phrase WhiteRabbit distanceTo: banana, but this

returned a number. I couldn't figure out how to set up a test with

this, e.g., when the distance to the banana is less than 0.5 meter.

I eventually changed my script into text and typed in the test I

wanted, and then it worked.

 

- Alice objects don't understand a lot of the basic operations of

Morphic objects, e.g., Alice objects can't make sounds. Is there a

technical reason for this, or is it something that might be added

later? I used one of my joysticks for sounding the alarm when the

WhiteRabbit was near the banana, but that led to fairly strange

looking code: "When the WhiteRabbit is within 0.5 meters of the

banana, have the joystick make a crashing sound." :-)

 

- The most complex part right now is adding objects to the world.

The first problem is being on a Macintosh -- the collection of Alice

objects that are available

(http://www.cs.cmu.edu/~jpierce/squeak/SqueakObjects.zip) use long

filenames that don't work on Macs. When you make an actor from

these, you frequently have to help Alice guess the right filenames.

The second problem is just the process of "w makeActorFrom:

'blahblahblah.mdl'" I had an idea of how to deal with this that I

wanted to bounce off y'all. What do you think about this: if

yellow-button click on a .mdl file gave you a menu option to add the

model as an actor in an existing Wonderland (if one is open in the

current World), or, to open a Wonderland and stuff the actor into it?

I gave it a shot, and the attached change set seems to do it.


> > - I was trying to figure out how to make one object respond to

> > another one being close. I wanted to make a sound occur when the

> > WhiteRabbit got close to the banana in my world. I found that I

> > could create a tile phrase WhiteRabbit distanceTo: banana, but this

> > returned a number. I couldn't figure out how to set up a test with

> > this, e.g., when the distance to the banana is less than 0.5 meter.

>

>You need to get a "Test" tile out of the scriptor. Then you can construct

>your test as follows:

> Test (WhiteRabbit distanceTo: banana) < 0.5

> Yes "Do something"

> No "Do something else"

 

I got the Test tile, but I couldn't figure out how to get the "<".

Where do I get one of those in the tiling world?

 

Answer: Drop some numeric-valued tile (such as, say, "WhiteRabbit's heading")

into the TEST pane. Because a TEST pane requires a boolean-valued

expression, this will magically get expanded into a related

boolean-valued expression -- in this case "WhiteRabbit's heading <

5". Now it should be straightforward to edit that into the

expression you really want.

Comments (0)

You don't have permission to comment on this page.