Install on terminal
C:\....\....>pip install turtle
Go to proyects!
import turtle
import time
import random
import winsound
Легендарная игра от создателя Алексей Пажитнов!
Run > tetris_turtle.py
🕹️Move (← A ) (→ D )
🕹️Rotate = space
# Keyboard
wn.listen()
wn.onkeypress(lambda: shape.move_left(grid), "a")
wn.onkeypress(lambda: shape.move_right(grid), "d")
wn.onkeypress(lambda: shape.rotate(grid), "space")
many functions available here, movements and statistics, graphic animations, sound efects!
import turtle
import random
import winsound
Run > space_shooting_turtle.py
the py file and the images must be in the same folder
🕹️Move (← ◄ ) (→ ► ) (↑ ▲ ) (↓ ▼ )
🕹️Shooting = space
# Keyboard binding
wn.listen()
wn.onkeypress(quit_game, "q")
wn.onkeypress(player.up, "Up")
wn.onkeypress(player.down, "Down")
wn.onkeypress(player.move_left, "Left")
wn.onkeypress(player.move_right, "Right")
wn.onkeypress(fire_missile, "space")
def fire_missile():
for missile in missiles:
if missile.state == "ready":
missile.fire()
winsound.PlaySound("SS_missile.wav",winsound.SND_ASYNC)
break
Run > cherno_bird.py
the py file and the images must be in the same folder
Theme & graphic design Dima Gutierrez
🕹️Fly press space маленькая птичка летит 🐤
Run > pong.py
🕹️Player A (↑ W ) (↓ S )
🕹️Player B (↑ ▲ ) (↓ ▼ )
# Keyboard
wn.listen()
wn.onkeypress(paddle_a_up, "w")
wn.onkeypress(paddle_a_down, "s")
wn.onkeypress(paddle_b_up, "Up")
wn.onkeypress(paddle_b_down, "Down")
Run > turtle race.py
from turtle import *
from random import *
import turtle
import time
Run > tetris_one_block.py
🕹️Move ( ← ◄ ) ( → ► )
score_count = 0
score = turtle.Turtle()
score.color('red')
score.up()
score.hideturtle()
score.goto(60,-300)
score.write('Score: 0', align='center', font=('Courier', 24, 'normal'))
Visit > discussions/