Giter Site home page Giter Site logo

purplekingdomgames / snake-tutorial Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 1.51 MB

Snake demo to accompany a YouTube tutorial

Home Page: https://www.youtube.com/watch?v=YJtG5E_a9sw

Scala 49.74% Nix 7.13% Shell 43.13%
gamedev indigo scala scalajs tutorial youtube

snake-tutorial's Introduction

Snake Tutorial

This repository accompanies a video tutorial available on YouTube called Let's build Snake!, and contains the completed code.

To run the game as seen in the tutorial, please run yarn install or npm install from the root directory (where package.json is located).

As in the tutorial, if you'd like to start from scratch, please use Indigo's Giter8 template.

Please note that this repo contains Nix flake files. If you're not a Nix user, you can safely ignore / delete them.

This repo additionally contains a pre-compiled static website version of the game in the docs directory, which is served up by ghpages. It is the result of running ./mill snake.buildGameFull and copying the output into the docs directory.

You can play the game in three ways:

  1. Play online: https://purplekingdomgames.github.io/snake-tutorial/
  2. Running it yourself as in the tutorial: ./mill snake.runGame
  3. Via a local web server:
    1. yarn install
    2. cd docs
    3. npx http-server -c-1
    4. Visit http://localhost:8080, or whatever the output of the previous command says is the correct address.

Below follows the standard README from the Giter8 template.


Getting started with Mill

The repo contains a version of the millw launch script, so even if you have Mill installed globably, you're advised to use run Mill as ./mill <commands>.

Below is a list of useful commands, including some generally useful ones in case you're new to Mill.

Note that if you're using zsh, you may need to surround argument groups with single quotes, if you have special characters like hypens in your project name.

Quick command aliases

These are defined in the build.sc file in this project, they are a combination of other built-in commands

# Run your game via Electron using fast compilation
./mill snake.runGame

# Run your game via Electron using full compilation and compression
./mill snake.runGameFull

# Build your game as a static website using fast compilation
./mill snake.buildGame

# Build your game as a static website using full compilation and compression
./mill snake.buildGameFull

Basic Mill commands

# Compile everything
./mill __.compile

# Clean the game project
./mill clean snake

# Compile the game
./mill snake.compile

# Run your game modules tests
./mill snake.test

Scala.js commands

# Scala.js fast compile (large file size)
./mill snake.fastLinkJS

# Scala.js full compile and compress
./mill snake.fullLinkJS

Indigo commands

# Build your game as a static website using fast compilation, assumes you have already compiled to Scala.js using fastLinkJS
./mill snake.indigoBuild

# Build your game as a static website using full compilation and compression, assumes you have already compiled to Scala.js using fullLinkJS
./mill snake.indigoBuildFull

# Run your game via Electron using fast compilation, assumes you have already compiled to Scala.js using fastLinkJS
./mill snake.indigoRun

# Run your game via Electron using full compilation and compression, assumes you have already compiled to Scala.js using fullLinkJS
./mill snake.indigoRunFull

snake-tutorial's People

Contributors

davesmith00000 avatar

Stargazers

János Setény avatar  avatar

Watchers

 avatar David North avatar  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.