Giter Site home page Giter Site logo

led-games's Introduction

Led Games

The code base to play games in your led strips.

With gaming in your Christmas tree as an example

Video tutorial

You can check this video tutorial explaining how the project works

Installation

Check out the repository

git clone [email protected]:JordyMoos/led-games.git

Configure the led controller

The leds are controller by a Teensy and the code is located here:

./src/led-controller/led-controller.ino

You should change these values to match your led setup.

const int ledsPerStrip = 100;
const int strips = 8;

And after that you should upload that file to your Teensy.

See the official teensy documentation how that is done.

Run the game engine

Go to the game engine directory

cd src/game-engine

Install the python dependencies

python3 -m pip install -r requirements.txt

Run the game engine:

python3 ./main.py run snake

Tip: Use the virtual renderer if you do not have the leds

python3 ./main.py run snake --renderer PYGAME

Use the list command to view the games

python3 ./main.py list

Run the command with the -h flag to see the options

python3 ./main.py run -h

Optionally: You can change the default settings in defaults.py

Game Controls

The game engine has these buttons defined

In code Description
Buttons.up Used for movement / navigation
Buttons.right Used for movement / navigation
Buttons.down Used for movement / navigation
Buttons.left Used for movement / navigation
Buttons.ok The default "submit" button. Used in TicTacToe to select a field
Buttons.cancel Not used yet
Buttons.start Not used yet - it is meant to get into the game menu
Buttons.select Not used yet

Player One Keyboard

In code Key on keyboard
Buttons.up w
Buttons.right d
Buttons.down s
Buttons.left a
Buttons.ok q
Buttons.cancel e
Buttons.start z
Buttons.select x

Player Two Keyboard

In code Key on keyboard
Buttons.up i
Buttons.right l
Buttons.down k
Buttons.left j
Buttons.ok u
Buttons.cancel o
Buttons.start m
Buttons.select , (Comma)

DualShock 4

In code On controller
Buttons.up Left stick up
Buttons.right Left stick right
Buttons.down Left stick down
Buttons.left Left stick left
Buttons.ok X
Buttons.cancel O
Buttons.start Options
Buttons.select Share

led-games's People

Contributors

jordymoos avatar

Stargazers

 avatar Hannes Campidell avatar Smettus avatar  avatar  avatar  avatar antonyb avatar  avatar  avatar Matheus Marques avatar Łukasz Lach avatar Chris Sharp avatar  avatar Alejandro Juan Garcia avatar Jan-Willem avatar  avatar  avatar  avatar  avatar  avatar Jérémie Zarca avatar  avatar Remzi Cavdar avatar Raymond Meester avatar Pieter Wigboldus  avatar Vulpecula avatar  avatar  avatar Faheem Pervez avatar  avatar Victor Rachieru avatar Roelof Ruis avatar

Watchers

James Cloos avatar  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.