@gabbyneve/

NeveTurtle

Python (with Turtle)

No description

fork
loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import turtle 
import math 

x = 0.0
y = 0.0

angle = 70.0
power = 8.0

rv = power*math.cos(math.radians(angle))
uv = power*math.sin(math.radians(angle))
x_offset = -200
y_offset = -200

colors = ["aqua", 'blue']

t= turtle.Turtle()
t.shape("arrow")
t.up()
t.speed(0)
t.goto(0+x_offset,0+ y_offset)
t.down()
t.speed(6)
t.setheading(90)

def flingturtle (x, y,rv,uv):
 s=0
 while y >=0:
   t.color(colors[s % len(colors)])
   s = s + 1
   x = x + rv 
   y = y + uv
   angle = math.degrees(math.atan(uv/rv))
   t.speed(0)
   t.setheading(angle)
   t.speed(6)
   uv = uv - 0.2
   t.goto(x + x_offset,y + y_offset)
 return (x,y,rv,uv)

while x < 500:
 (x,y,rv,uv)=flingturtle(x,0,rv,uv)
 uv = -0.8*uv
result
console