diff options
author | Walter Bender <walter@sugarlabs.org> | 2013-10-08 20:44:17 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-10-08 20:44:17 (GMT) |
commit | c80ccaf443dc6f1ea9dd59f45e60e8d7fa525fa1 (patch) | |
tree | 3acee3d12991adbfc2f49daf307df5ed4e949624 /TurtleArt/taturtle.py | |
parent | 3c02fe640e42fa8e7f1d6123330cb699e650b00f (diff) |
resync with 191 changes
Diffstat (limited to 'TurtleArt/taturtle.py')
-rw-r--r-- | TurtleArt/taturtle.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/TurtleArt/taturtle.py b/TurtleArt/taturtle.py index 5e24ce7..b87d0a6 100644 --- a/TurtleArt/taturtle.py +++ b/TurtleArt/taturtle.py @@ -34,6 +34,7 @@ from tacanvas import wrap100, COLOR_TABLE from sprites import Sprite from tautils import (debug_output, data_to_string, round_int, get_path, image_to_base64) +from TurtleArt.talogo import logoerror SHAPES = 36 DEGTOR = pi / 180. @@ -151,6 +152,27 @@ class Turtles: self._active_turtle.hide() self.set_turtle(self._default_turtle_name) + def get_turtle_x(self, turtle_name): + if turtle_name not in self.dict: + debug_output('%s not found in turtle dictionary' % (turtle_name), + self.turtle_window.running_sugar) + raise logoerror("#syntaxerror") + return self.dict[turtle_name].get_x() + + def get_turtle_y(self, turtle_name): + if turtle_name not in self.dict: + debug_output('%s not found in turtle dictionary' % (turtle_name), + self.turtle_window.running_sugar) + raise logoerror("#syntaxerror") + return self.dict[turtle_name].get_y() + + def get_turtle_heading(self, turtle_name): + if turtle_name not in self.dict: + debug_output('%s not found in turtle dictionary' % (turtle_name), + self.turtle_window.running_sugar) + raise logoerror("#syntaxerror") + return self.dict[turtle_name].get_heading() + def set_turtle(self, turtle_name, colors=None): ''' Select the current turtle and associated pen status ''' if turtle_name not in self.dict: |