home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / logo / labybug / dyna.bug < prev    next >
Text File  |  1984-03-14  |  512b  |  38 lines

  1. to "startup  
  2. draw
  3. make "vx 0
  4. make "vy 0
  5. end
  6.  
  7. to "readkey  
  8. if rc? output readcharacter
  9. output "
  10. end
  11.  
  12. to "command  
  13. make "com readkey
  14. if :com = "r  right 30 stop
  15. if :com = "l  left 30  stop
  16. if :com = "k  kick     stop
  17. end
  18.  
  19. to "moveturtle  
  20. setxy  xcor + :vx   ycor + :vy
  21. end
  22.  
  23. to "dt  
  24. repeat 1000 [setxy  xcor + :vx   ycor + :vy    if rc? [command] ]
  25. dt
  26. end
  27.  
  28. to "kick  
  29. make "vx :vx + sin heading
  30. make "vy :vy + cos heading
  31. end
  32.  
  33. make "vx "'0
  34. make "vy "'0
  35. [command] ]
  36. dt
  37. end
  38.