-
Notifications
You must be signed in to change notification settings - Fork 14
Home
Welcome to the SPGL wiki!
SPGL (Simple Python Game Library) is a simple Python game library / framework used for creating simple 2D games. It is built on the Python Turtle module and is compatible with Python 2.x and 3.x.
The purpose of the Simple Python Game Library is to give beginning Python coders a simple framework to make basic 2D games. It is intended as an alternative to Pygame. As it is built on the Turtle module, it has the same features and limitations of that module. It does not require any external libraries to be added.
Version 0.7
This was a major update to the structure of the code. The code is structured a bit more logically to facilitate importing into the global namespace and to keep the code more consistent. Progroms written for Version 0.6 and below are not compatible with this version.
There are 2 ways to import the code:
1) Keep a separate namespace
import SPGL
class Player(SPGL.Sprite):
def __init__(self, shape, color, x, y):
SPGL.Sprite.__init__(self, shape, color, x, y)
# Initial Game setup
game = SPGL.Game()
# Keyboard Binding
game.set_keyboard_binding(SPGL.KEY_UP, player.accelerate)
2) Import into the global namespace
from SPGL import *
class Player(Sprite):
def __init__(self, shape, color, x, y):
Sprite.__init__(self, shape, color, x, y)
# Initial Game setup
game = Game()
# Keyboard Binding
game.set_keyboard_binding(KEY_UP, player.accelerate)
Version 0.6
SPGL.py
SPGL Class
- Added error logging
- Added basic button class
- Added method for clicking on the screen
- Simplified .load_data method
- .print_game_info() shows more information, including error logs
- Added default splash screen
- Added modal popups (ask_yes_no, show_info, show_warning)
Sprite class
- init can now take image file (.gif only) as shape argument (along with width and height arguents)
Label class
- Labels stored in Game.labels and automatically updated each tick
Button class
- Simple button class added
Version 0.5
A way to save and load data added .save_data(key, value) .load_data()
More work on the Splash Screen Done (Not finished yet)
Version 0.4
Added a basic Label class for adding text to the screen. Small engine improvements (turtle.setundobuffer(0))
Version 0.3
Initial version with basic game framework and Sprite class.
- Subscribe to my YouTube Channel.
- Follow me on Twitter - @tokyoedtech.
- Check out my blog.