def Start(): global t, creater, omega, score, direction, s, bodyParts, canMove, wait, point, started, SCORE_TIMER, DEAD t = Turtle('circle') t.pu() t.ht() t.shapesize(0.5) creater = Turtle('circle') creater.pu() creater.ht() creater.color('yellow') omega = False started = False s = Screen() s.tracer(False) s.screensize(500, 500) score = Turtle() score.ht() score.pu() score.goto(-325, 350) score.color('green') direction = (10, 0) point = None wait = True canMove = True DEAD = 0 SCORE_TIMER = 50 bodyParts = [] started = True score.clearstamps() # s.clearscreen() for x in range(3): t.goto(x * 10, 0) bodyParts.append((t.pos(), t.stamp()))
t.home() t.sety(-30) stamp_range(t) t.home() t.sety(-60) stamps = stamp_range(t) for index, stamp in enumerate(stamps): if ((index % 3) == 0): t.clearstamp(stamp) t.home() t.sety(-90) stamps = stamp_range(t) t.clearstamps(len(stamps) // 3) t.clearstamps(-len(stamps) // 3) t.home() t.sety(-120) stamps = stamp_range(t) t.undo() t.home() t.sety(-150) undosize_before = t.undobufferentries() stamps = stamp_range(t) undosize_after = t.undobufferentries() undosize_delta = undosize_after - undosize_before for i in range(0, ((undosize_delta // 3) - ((undosize_delta // 3) % 3))): t.undo()