a framework based on pygame
Project description
pygametiny is a simple lib based on pygame by MRanos
to make a screen:
from pygametiny import pygametiny
game = pygametiny(400,400)
def update():
pass
game.start(update)
to change background color :
from pygametiny import pygametiny
game = pygametiny(400,400)
def update():
game.bg((255,255,255))
game.start(update)
to make a sprite:
from pygametiny import pygametiny
game = pygametiny(400,400)
player = game.load("player.png")
player_x,player_y=50,50
def update():
game.bg((255,255,255))
game.draw(player,player_x,player_y)
game.start(update)
to make the sprite move:
from pygametiny import pygametiny
game = pygametiny(400,400)
player = game.load("player.png")
player_x,player_y=50,50
def update():
global player_x,player_y
game.bg((255,255,255))
game.draw(player,player_x,player_y)
player_x = game.movex(player_x,1)
player_y = game.movex(player_y,1)
game.start(update)
to play sound:
from pygametiny import pygametiny
game = pygametiny(400,400)
test = game.sound("test.wav")
def update():
game.bg((255,255,255))
game.play_sound(test)
game.start(update)
to add text:
from pygametiny import pygametiny
game = pygametiny(400,400)
def update():
game.bg((255,255,255))
simple_text = game.text("hello world",25)
game.draw(simple_text,50,50)
game.start(update)
to change the title and icon:
from pygametiny import pygametiny
game = pygametiny(400,400)
game.title("hello world")
game.icon("logo.png")
def update():
game.bg((255,255,255))
game.start(update)
how use collision:
from pygametiny import pygametiny
game = pygametiny(400,400)
player = game.load("player.png")
player_x,player_y=50,50
enemy = game.load("enemy.png")
enemy_x,enemy_y=100,100
def update():
global player_x,player_y,enemy_x,enemy_y
game.bg((255,255,255))
game.draw(player,player_x,player_y)
player_x = game.movex(player_x,1)
player_y = game.movex(player_y,1)
if game.collisionx(player_x,enemy_x,enemy) and game.collisiony(player_y,enemy_y,enemy):
print("the player lose")
game.start(update)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pygametiny-0.1.3.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygametiny-0.1.3.tar.gz.
File metadata
- Download URL: pygametiny-0.1.3.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1fcded07814b711db15cc348d2fa7cb0826ea0fb0aa14bb564e8cc33bd45ae9
|
|
| MD5 |
50c5fca983bb745641064aeb2d8bfbbe
|
|
| BLAKE2b-256 |
6ae9878949749a17914d1c7d001b34ab5a603bf3fa879522e3a4bea51c80fcb5
|
File details
Details for the file pygametiny-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pygametiny-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d6e6b8d50bface59728c1f4854682bc3a64504517d441d18aeed3c37b0c533
|
|
| MD5 |
e1c00e4ef30026bee06ef6ce55ae49a8
|
|
| BLAKE2b-256 |
5f8b165c0db1b6fd51b0a801943f566cc146821a2310ce9ea5917c9dc31b55fb
|