; Purpose: To status with translating and rotating a turtle. ; Copyright © 2004 by Rupert Russell ; e-mail: r.russell@ballarat.edu.au ; URL: http://velorum.ballarat.edu.au/~rrussell/microworlds/index.html ; Created: October 16, 2004 ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ; --------------------------------------------------------------------- to clear startup end to startup cg setsh "r_0 make "status "fliped_false cc t_a_r, setshape "a_r t_a_r, setpos [-38 -166 ] t_a_l, setshape "a_l t_a_l, setpos [-307 -166] t_flip, setshape "flip t_flip, setpos [-173 -166 ] talkto "t_horse setsh "r_0 cg set "button6 "size [135 27] set "button10 "size [135 27] set "button2 "size [135 27] set "button10 "pos [42 -126] set "button6 "pos [42 -155] set "button2 "pos [42 -184] end to flip talkto "t_horse if :status = "fliped_false [ setsh "f_r_0 make "status "fliped_true stop] if :status = "fliped_true [ setsh "r_0 make "status "fliped_false stop ] end to animate_clockwise if :status = "fliped_true [ a_f_r ] if :status = "fliped_false [ a_r ] end to animate_counterclockwise if :status = "fliped_true [ a_f_l ] if :status = "fliped_false [ a_l ] end to a_r ; animate turning right talkto "t_horse setshape [r_10 r_20 r_30 r_40 r_50 r_60 r_70 r_80 r_90 r_100 r_110 r_120 r_130 r_140 r_150 r_160 r_170 r_180 r_190 r_200 r_210 r_220 r_230 r_240 r_250 r_260 r_270 r_280 r_290 r_300 r_310 r_320 r_330 r_340 r_350 r_360] forever [talkto "t_horse fd 0 wait 0.1] end to a_l ; animate turning left talkto "t_horse setshape [r_360 r_350 r_340 r_330 r_320 r_310 r_300 r_290 r_280 r_270 r_260 r_250 r_240 r_230 r_220 r_210 r_200 r_190 r_180 r_170 r_160 r_150 r_140 r_130 r_120 r_110 r_100 r_90 r_80 r_70 r_60 r_50 r_40 r_30 r_20 r_10] forever [talkto "t_horse fd 0 wait 0.1] end to a_f_r ; animate Fliped Right talkto "t_horse setshape [f_r_0 f_r_15 f_r_30 f_r_45 f_r_60 f_r_75 f_r_90 f_r_105 f_r_120 f_r_135 f_r_150 f_r_165 f_r_180 f_r_195 f_r_210 f_r_225 f_r_240 f_r_255 f_r_270 f_r_285 f_r_300 f_r_315 f_r_330 f_r_345] forever [talkto "t_horse fd 0 wait 0.3] end to a_f_l ; animate Fliped left talkto "t_horse setshape [f_r_0 f_r_345 f_r_330 f_r_315 f_r_300 f_r_285 f_r_270 f_r_255 f_r_240 f_r_225 f_r_210 f_r_195 f_r_180 f_r_165 f_r_150 f_r_135 f_r_120 f_r_105 f_r_90 f_r_75 f_r_60 f_r_45 f_r_30 f_r_15] forever [talkto "t_horse fd 0 wait 0.3] end to spin_right ; animate turning right & stamp each time the turtle moves ; this way it leaves a trail showing where it has been. talkto "t_horse seth 90 setshape [r_10 r_20 r_30 r_40 r_50 r_60 r_70 r_80 r_90 r_100 r_110 r_120 r_130 r_140 r_150 r_160 r_170 r_180 r_190 r_200 r_210 r_220 r_230 r_240 r_250 r_260 r_270 r_280 r_290 r_300 r_310 r_320 r_330 r_340 r_350 r_360] forever [fd 10 wait 0.1 stamp] end to spin_left talkto "t_horse ; animate fliped left seth 270 setshape [f_r_0 f_r_345 f_r_330 f_r_315 f_r_300 f_r_285 f_r_270 f_r_255 f_r_240 f_r_225 f_r_210 f_r_195 f_r_180 f_r_165 f_r_150 f_r_135 f_r_120 f_r_105 f_r_90 f_r_75 f_r_60 f_r_45 f_r_30 f_r_15] forever [talkto "t_horse fd 10 wait 0.1 stamp] end