gsa 0.2.1

Game development library modelled after an imaginary console
Documentation
use crate::BACKGROUND_MAX_SIZE;
use glam::IVec2;

/// Tilemap which will be rendered on screen
pub struct Background {
    /// Tiles in idx, accessible via \[x\]\[y\], x and y 0..[BACKGROUND_MAX_SIZE]
    pub tiles: Vec<Vec<u16>>,
    /// Camera scroll (negative draw offset) for rendering
    pub scroll: IVec2,
    /// Are tiles indices half-tile indices?
    pub half_tile: bool,
}

impl Default for Background {
    fn default() -> Self {
        let row = vec![0u16; BACKGROUND_MAX_SIZE];
        let tiles = vec![row; BACKGROUND_MAX_SIZE];
        Self {
            tiles,
            scroll: IVec2::ZERO,
            half_tile: false,
        }
    }
}