Skip to content

mitsuji/kawakudari_nannou

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kawakudari-nannou

This project implements part of the std15.h API (from c4ij) with nannou, and Kawakudari Game on top of it.

It will allow programming for IchigoJam-like targets that display IchigoJam FONT on screen using a Rust programming language.

fn update(_app: &App, model: &mut Model, _update: Update) {
    if model.running {
        if model.frame % 3 == 0 {
            let std15 = &mut model.std15;
            std15.locate(model.x,5);
            std15.putc('0');
            std15.locate(random_range::<i32>(0,32),23);
            std15.putc('*');
            std15.scroll(Direction::Up);
            if std15.scr(model.x,5) != '\0' {
              std15.locate(0,23);
              std15.putstr("Game Over...");
              std15.putnum(model.frame as i32);
              model.running = false;
            }
        }
    }
    model.frame +=1;
}

fn event(_app: &App, model: &mut Model, event: WindowEvent) {
  match event {
    KeyPressed(Key::Left)  => model.x -= 1,
    KeyPressed(Key::Right) => model.x += 1,
    _ => ()
  }
}

fn view(app: &App, _model: &Model, frame: Frame) {
    _model.std15.draw_screen(app,&frame);
}

Prerequisite

  • Video card and driver that supports Vulkan installed.
  • This project using programming language Rust, so you need rustup build tool properly installd to run example code.

How to use

To just run example

$ cargo run

To build executeble and run example

$ cargo build
$ target/debug/kawakudari_nannou

License

Creative Commons License CC BY mitsuji.org

This work is licensed under a Creative Commons Attribution 4.0 International License.

About

The project implements part of the std15.h API (from c4ij) with nannou, and Kawakudari Game on top of it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages