sábado, 7 de junio de 2008

More update to sensors

I'm working fast this night, I changed the way the sensor reads pixel data, now it should return unsigned bytes, also I created a subclass called ColorSensor, which looks for a specific color, when its found sensor pixel is set to True, otherwise False.

Finally I created a small event dispatcher class to handle sensor events, when the sensor is updated an event is raised and appropriate functions are called, this is very useful for ColorSensor, I exposed this functionality to level scripting and created a demo level where you need to get your car to a specific color block.

Now I can mark sensors as done on my TODO list :-), next thing should be a better showcase demo! with some winning conditions thrown in :)

No hay comentarios: