Giter VIP home page Giter VIP logo

luniland's Introduction

LuniLand

A JavaSript homage to Atari's classic Lunar Lander game.

How To Play

A running version can be found at luniland.halabe.com. To play, use the up / down arrows to control the ship's engine thrust and the left / right arrows to control the ship's orientation. Land on the flat pads; feet down, at a slow rate of descent and not too much lateral speed.

Just like a real moon landing, it takes a few tries to get the hang of it. If your crash, reload the page and try again. If you land, increase engine thrust to take off again. Make sure you manage your fuel state because when you are out of fuel - you drop like a lunar rock!

How It Works

The app's main dependency is Two.js, a 2D drawing API that can render WebGL, SVG and canvas.

The app (app.js) instantiates a two instance, builds a ship (Ship.js) and a fractal terrain (Terrain.js), and starts a simple state machine that runs the game (with states like flying, landing, crashing).

On each render, the app performs physics on the ship, computing an acceleration vector from lunar gravity and engine thrust (DynamicObject.js and Ship.js). As the ship nears the terrain, the two objects perform hit testing, comparing points on the ship's hull to a small polygon of terrain near the ship.

License

This project is licensed under an MIT License - see the LICENSE.md.

Acknowledgments

luniland's People

Contributors

halaprop avatar stlsmiths avatar

Stargazers

Ishwar avatar adrian avatar Ben Andrews avatar Dmitry S. avatar Russell Matney avatar  avatar Ryan Mortier avatar frankfanslc avatar  avatar

Watchers

 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.