GithubHelp home page GithubHelp logo

skii's Introduction

Skii

Skii is a 2D top-down skiing game with a procedurally generated landscape and fully json constumizable assets.

Alt Text

Building

Skii uses cargo, so compiling only consists in writing:

cargo build

If you want to directly play the game, you can also use:

cargo run --release

Dependecies

Skii has only one non-cargo handled dependecy, SDL, derived from ggez. To find instruction on how to install SDL, you may want to read this.

Modding

The game reads json file in resources/config to find info about the tiles, objects and player.

There are three types of description files: tile, object, and player.

Tile

  • type: the file type
  • properties: all the tile properties
    • texture: the tile texture, found in resources/textures
    • forward_friction: the forward friction with the skies
    • sideway_friction: the sideways friction with the skies
    • distribution: the base chance of generating the tile
{
    "type": "tile",
    "properties": {
        "texture": "deep_snow.png",
        "forward_friction": 0.2,
        "sideway_friction": 30.0,
        "distribution": 0.05
    }
}

Object

  • type: the file type
  • properties: all the object properties
    • texture: the object texture, found in resources/textures
    • distribution: the base chance of generating the object
    • hitbox: the object hitbox
      • width: the hitbox width
      • height: the hitbox height
{
    "type": "object",
    "properties": {
        "texture": "tree1.png",
        "distribution": 0.06,
        "hitbox": {
            "width": 1.0,
            "height": 1.0
        }
    }
}

Player

  • type: the file type
  • properties: all the object properties
    • texture: the player texture
{
    "type": "player",
    "properties": {
        "texture": "player.png"
    }
}

Generation

The generation algorithms, (found in src/generation.rs) are cellular automata inspired, and modify the generation chance starting from the distrubution value declared in the json files.

Tiles

if identical neighbors is between 1 and 3 => generating chance *= 2
if identical neighbors is more than 3 => generating chance /= 5

Objects

if objects in 3.0 radius are between 1 and 2 => generating chance *= 2
if objects in 3.0 radius are more than 2 => generating chance /= 6

Note that the objects in range do not need to be the same as the object we are considering to generate.

skii's People

Contributors

piripant avatar limeburst avatar

Watchers

İsmail Aslan avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.