Start a new topic

Problems with Ollie Sensors (Collision, Velocity, Speed)

Ollies are new to my class this year so I'm learning with the students.


I've assigned my students the task of programming an Ollie to navigate a random maze.  The idea is that they will place Ollie into the maze, and each time Ollie detects a collision, it will trigger an On Collision event that will allow it to change course.  We've been having problems getting Ollie to react to more than one collision.


An alternative attempt was made to use an if-statement to allow Ollie to react if Velocity == 0.  My test program was set as follows:


direction = 0

roll 2sec 80 direction

set color Green

loop forever

    roll .1sec 80 direction

    if (speed == 0)

        set color Yellow

        set direction = direction + 90

    // end if

// end loop


Using this code, my Ollie would start rolling forward then, after 2 seconds, turn Yellow (while in motion) and start the segment within the if-statement.  I also tried substituting velocity with each of its individual parameters with the same result.


Anyone run into this before?


Rob


Rob Schultz

Math and Computer Science

Bellbrook High School


1 person has this question
1 Comment

I have the same question.  Any way you can print out the speed value in the Lighting Lab id like to know what the value actually is because this never seems to work, so when is the speed zero. 

Login or Signup to post a comment