Computer Science, asked by eliteforces, 2 days ago

program in which a turtle will be controlled using arrow keys (python)

Answers

Answered by r27272278
1

import turtle

#Screen

wn = turtle.Screen()

wn.bgcolor("lightblue")

#Turtle Player

spaceship = turtle.Turtle()

spaceship.color("red")

spaceship.penup()

#Constant

speed = 1

def up():

if spaceship.heading() != 270:

spaceship.setheading(90)

def down():

if spaceship.heading() != 90:

spaceship.setheading(270)

Similar questions