Skip to content

helanhalvan/rust-game-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository for making a game in Rust. In part to learn rust, in part to learn how to make videogames.

If you have trouble building this project, it's probably caused by the UI framework we are using: https://iced.rs/ it depends on some libraries which aren't pulled automatically by cargo. You also need deps for cairo-rs https://crates.io/crates/cairo-rs

Currently, this is barely a game, it's a bunch of systems that can later be used to make a proper fleshed out game. For example, like all numbers the games used a picked more or less at random.

The core of the system is src/celldata.rs, it contains the two central datastructures:

  • CellState the state of a cell on the game board, this data is what most other systems operate on
  • CellStateVariant the different types of cells on the board, this defines what behaviour a cell should have. It is the only mandatory component of CellState

src/hexgrid.rs provides a hexagonal i32 * i32 sized gird to operate on. It provides the main grid of CellStates that's rendered by the UI, but also supports the creation of other grids, which is handy if you need a datastructure which shares a cordinate system with the main board.

Image generation

The game generates images on-demand, picking random (but guided) combinations of colors, using unicode characters as icons. All images (and things needed to generate them) are stored in "./img/" to keep the theme consistent across program restarts, and avoiding to much re-generation. Here is a screenshot of what it looked like once:

image

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages