figs 0.0.1

Simple 2D game framework using MiniFB
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::collections::HashMap;

use crate::entity::Entity;

pub type Pnt = (f32, f32);
pub type FigResult<T> = Result<T, Box<dyn std::error::Error>>;
pub type EntityMap = HashMap<String, Entity>;

pub fn pnt_to_buf(pnt: Pnt, width: usize) -> usize {
    let x = pnt.0.round() as usize;
    let y = pnt.1.round() as usize;

    return x + y * width;
}