PDA

View Full Version : universal parameter


karel
10-06-2008, 05:42 AM
I want to create a world full of tiles, and an object walking on them. Now I have a colorsensor connected to alice which gives colorvalues in numers 0 to 17.

I want to change the color of the tile where the object is standing on to the value of the color sensor. But when I move to a different block I want to that to be given a different color regarding to whatever the colorsensor gives.

I want to use some sort of a collide statement which checks if the object is colliding with ANYTHING. If it is colliding(it is on op of something (anything) it needs to change that objects color.

How do I create that universal anything ??? can I do it with treshold? or should I us some sort of universal parameter?

HELP?

DrJim
10-08-2008, 03:37 PM
I don't really understand all your question - but briefly, in Alice you cannot create a "universal" parameter. Parameters are assocated with specific methods.

You can create a "world" variable - which is essentially universal, since the world is always running. It can then be passed to a method when the method is called.