Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygametiny-0.1.3-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

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

Hashes for pygametiny-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a1fcded07814b711db15cc348d2fa7cb0826ea0fb0aa14bb564e8cc33bd45ae9
MD5 50c5fca983bb745641064aeb2d8bfbbe
BLAKE2b-256 6ae9878949749a17914d1c7d001b34ab5a603bf3fa879522e3a4bea51c80fcb5

See more details on using hashes here.

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

Hashes for pygametiny-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d3d6e6b8d50bface59728c1f4854682bc3a64504517d441d18aeed3c37b0c533
MD5 e1c00e4ef30026bee06ef6ce55ae49a8
BLAKE2b-256 5f8b165c0db1b6fd51b0a801943f566cc146821a2310ce9ea5917c9dc31b55fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page