This project, pygame lua bindings, aims to streamline the process of simple Pygame development tasks through the use of the Lua scripting language while utilizing the robust feature set of Pygame with a custom main loop and event handler system. The idea is to create a framework for fast Pygame prototyping that could possibly even work as an embedded application.
Lua (using lua bindings):
1
2
clear_canvas()
draw_text(50, 50, "Hello Pygame from lua!", "Arial", 30, 'red')
Compare to vanilla pygame:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pygame
pygame.init()
screen = pygame.display.set_mode((800, 600))
font = pygame.font.SysFont('Arial', 30)
red = (124, 0, 0)
green = (0, 255, 0)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill((0, 0, 0))
screen.blit(font.render('Hello Pygame from python!', True, red), (50, 50))
pygame.display.flip()
pygame.quit()
Features π
- Lua-Pygame Bindings: Seamlessly integrates Lua scripting capabilities with Pygameβs graphical functions.
- High-Level Abstractions: Handles events and main game loop through Lua, reducing the need for verbose Python code.
- Cross-Platform Compatibility: Works across different systems where Python can run.
View all the ported and extra implemented methods on the wiki.
View all the examples, ported games, demos, and souce code in the /examples directory of the repo.
License π
This project is licensed under the GNU GPL 3.0 License - see the LICENSE file for details.
Edit this pageβs markdown on github.