Skip to content

A tiny tiny framework for tiny tiny games

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Creative0708/micropixel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micropixel

⚠️ Micropixel is still mostly under development. Expect bugs and some incomplete features. ⚠️

Micropixel is a minimalist game framework written in Rust. It only handles window creation, input handling, texture rendering, and sound; everything else is controlled by your code.

Example

use micropixel::*;

fn main() {
    let mut engine = EngineBuilder::default().dimensions(32, 32).build();

    engine.run(|ctx: &mut Context, _audio, pixels: &mut [[u8; 3]]| {
        let (width, height) = ctx.dimensions();
        for x in 0..width {
            for y in 0..height {
                pixels[(x + y * width) as usize] = [
                    [255, 0, 0],
                    [255, 255, 0],
                    [0, 255, 0],
                    [0, 255, 255],
                    [0, 0, 255],
                    [255, 0, 255],
                ][(x + y + ctx.current_frame() as u32 / 16) as usize / 2 % 6];
            }
        }
    });
}

↗ examples/window.rs

About

A tiny tiny framework for tiny tiny games

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published