Skip to content

DimaGutierrez/Python-Games

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍Python Games with turtle graphics 🐢

Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzeig, Seymour Papert and Cynthia Solomon in 1967

Install on terminal

C:\Users\Pavilio.Notebook>pip install turtle

Go to proyect!

import turtle
import time

Python "tetris" Game 🏆

Легендарная игра от создателя Алексей Пажитнов!

https://github.com/dimagutierrez

Settings 💻

Run > tetris_turtle.py

тетрис controls 🎮

🕹️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")

Python "Pong" Game 🏓

https://github.com/dimagutierrez

Settings 💻

Run > pong.py

Controls 🎮

🕹️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")

Python "Turtle Race" 🏁

https://github.com/dimagutierrez

Settings 💻

Run > turtle race.py

from turtle import *
from random import *
import turtle
import time

Python "tetris" One block version 🟨

https://github.com/dimagutierrez

Settings 💻

Run > tetris_one_block.py

тетрис controls 🎮

🕹️Move (← ) (→ )

This simple version has a score counter

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'))

Enjoy the games! 🐍

Python

Portfolio:

Wix

Contacto:

Email