Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Share a mini 2d pixel art game engine: rust_pixel

A topic by zipxing created Jun 14, 2024 Views: 334 Replies: 3
Viewing posts 1 to 5
(1 edit)

RustPixelis a 2D game engine written in the Rust language, supporting both text and graphical rendering modes. The text mode runs in the terminal, while the graphical mode supports both SDL standalone window mode and browser-based wasm web mode:

  1. Text Mode:
    Built with the crossterm module, it runs in the terminal and uses ASCII and Unicode Emoji for drawing.
  2. Graphical Mode (SDL Mode):
    Built with sdl2, it runs in a standalone window and uses the PETSCII character set and custom graphical patterns for rendering.
  3. Graphical Mode (Web Mode):
    Similar to the SDL mode, but the core logic is compiled into wasm and rendered using WebGL and JavaScript (refer to rust-pixel/web-template/pix.js).

RustPixel implements game loops, a Model/Render common pattern, and a messaging mechanism to support the construction of small games. It also includes some common game algorithms and tool modules. Additionally, RustPixel comes with small games like Tetris, Tower, and Poker, which can serve as references for creating your own games and terminal applications. It also includes examples of wrapping core game algorithms into ffi and wasm.

Overall, RustPixel is suitable for creating 2D pixel-style games, rapid prototyping, and especially for developing and debugging CPU-intensive core algorithm logic. It can be compiled into ffi for game front-end and back-end use, and also into wasm for web-based small games.


Moderator moved this topic to General Development
Moderator

Okay, so, do you have a link or something?

Oh...     https://github.com/zipxing/rust_pixel

Palette is a terminal tool developed by  : rust_pixel

It supports many different color spaces: SRGB, CMYK, HSL, OKLAB, OKLCH, HCT(google) ...