> Based on your guidance, I figured it out.  I need to use a return 
> statement, which I had not encountered before.  Now I wrote my 
> definitions in this way:
> 
> def collided():
>    if player_x == robot_x+0.5 and player_y == robot_y+0.5:
>       return True
 
This could be simplified more.
Here's an example as a hint. These two functions are the same.

def f():
  if a == b and c == d:
    return True

def g():
  return (a==b and c == d)


> Then I use that value in another definition like this:
> 
> def check_collisions():
>    if collided() == 1:
>       print "You have been caught"

And ~

if collided():
  print "You have been caught"
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to