Giter Site home page Giter Site logo

love.js's Introduction

Love.js

This is LÖVE ported to the web using Emscripten.

It differs from Motor or Punchdrunk in that it is not a reimplementation but a direct port of the existing LÖVE v0.10.0 code with very few code modifications. As such, it should be at feature parity, as long as the browser it's running in supports a given feature.

Examples

Here are some live games:

Dependencies

  • Python 2.7

Python 2.7 will allow you to package your game into a format that Emscripten can read. It will also let you run a simple web server for testing. Python 3.5 is not supported at this time.

Usage

Get the code.

  1. Clone the repository. git clone https://github.com/TannerRogalsky/love.js.git
  2. Clone the submodules: git submodule update --init --recursive

Package your game

  1. Navigate into the debug folder.
  2. Package your game.
  • python ../emscripten/tools/file_packager.py game.data --preload [path-to-game]@/ --js-output=game.js
  • This should output two files: game.data and game.js into the debug folder.
  • Make sure you include the '@/' after the path to your game source. This will tell the file packager to place your game at the root of Emscripten's file system.
  • Make sure your [path-to-game] does not contain any non ascii characters

Test it

  1. Run a web server.
  • python -m SimpleHTTPServer 8000 will work.
  1. Open localhost:8000 in the browser of your choice.

Release it

  1. If everything looks good, nagivate to the release folder. Package and test your game for release.
  2. The release-compatibility folder can now be copied to a webserver. A simple static webserver should suffice.

Release Types

release-compatibility is recommended if the performance it yields is adequate. The difference between compatibility and performance is that performance is compiled with exception catching disabled and memory growth disabled. This means that you will not be able to rely on catching exceptions from C++ in your code and you may need to set TOTAL_MEMORY on the Module object to indicate how much memory your game will require.

Issues

Some things, like threads, don't have browser support yet. Please check the project issues for known problems.

Contributing

Please consider submitting a test. Any functionality that isn't covered in spec/tests would be very useful.

The build process for this project is still a very manual process and is not ready to be shared. Feel free to keep an eye on the emscripten branch of my LÖVE fork if you're really curious.

love.js's People

Contributors

tannerrogalsky avatar janwerder avatar npinochet avatar rm-code avatar

Watchers

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