DEV Community

Nathan C.
Nathan C.

Posted on

Pux: Bringing Pygame to Rux

I've been working on a project called Pux, a set of Pygame bindings for Rux.

The goal is simple: make it easy to create graphical applications and games in Rux while leveraging the power and maturity of Pygame behind the scenes.

Why?

Rux already provides a clean and modern programming experience, but graphics and game development are areas where a lot of developers expect batteries included.

Instead of building an entire graphics stack from scratch, Pux acts as a bridge between Rux and Pygame, allowing Rux programs to access graphics, input, timing, and other game-development features through a familiar API.

Current Features

So far, Pux includes functionality such as:

  • Window creation
  • Simple event polling
  • Drawing rectangles
  • Screen clearing
  • Frame presentation
  • Basic timing and frame control

Example:

import Pux::{
    pg_init,
    pg_running,
    pg_clear,
    pg_draw_rect,
    pg_present,
    pg_quit,
};

func Main() -> int {
    var x = 0;
    pg_init(
        800,
        700
    );

    while pg_running() == 1 {
        pg_clear(255, 255, 255);

        pg_draw_rect(
            x,
            x,
            200,
            150,
            175,
            175,
            175
        );

        x += 1;

        pg_present();
    }

    pg_quit();

    return 0;
}
Enter fullscreen mode Exit fullscreen mode

What's Next?

Some features I'm considering:

Drawing circles, lines, and polygons
Text rendering
Image loading and rendering
Keyboard and mouse input helpers
Audio support

Contributing

Pux is still in active development, and contributions are always welcome!

If you'd like to help improve Pux, feel free to open an issue or submit a pull request. Repo: https://github.com/Natuworkguy/Pux

Whether it's bug fixes, new features, documentation improvements, examples, or code cleanup, every contribution helps make Pux better for the entire Rux community.

Top comments (0)