Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

scala-js-games

Some simple games ported to Scala-Js

Subscribe to updates I use scala-js-games


Statistics on scala-js-games

Number of watchers on Github 95
Number of open issues 3
Main language Scala
Average time to merge a PR about 3 hours
Open pull requests 2+
Closed pull requests 0+
Last commit over 5 years ago
Repo Created over 6 years ago
Repo Last Updated about 2 years ago
Size 952 KB
Homepage http://lihaoyi.gi...
Organization / Authorlihaoyi
Contributors3
Page Updated
Do you use scala-js-games? Leave a review!
View open issues (3)
View scala-js-games activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating scala-js-games for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Scala-Js Games

This is a collection of games ported from Java to Scala-Js: the source for each game is written in Scala, and cross compiled to run in the browser targeting the HTML5 Canvas. The original games can be found here and targeting Java/Swing. Although this is basically a complete rewrite, the user-facing side of the game should be exactly the same. Try out the live demo

The games are, in order:

  • Asteroids: shoot down the asteroid swarms and avoid getting hit!
  • Astrolander: bring your lander to a a gentle landing on flat ground before you run out of fuel.
  • Snake: eat apples to grow long and don't crash into walls!
  • Pong: outsmart your AI opponent to get the ball past his paddle (right) to score points!
  • Brick: use your paddle to bounce the ball up, destroying all the bricks before you run out of balls.
  • Tetris: collect points by clearing rows and don't let the screen fill with blocks.

The controls are generally up-down-left-right and spacebar; they aren't very complex games. Click on a game to start playing and click somewhere else to pause it.

How to build

  • Clone the repo
  • Hit sbt packageJS
  • Open /index-dev.html in your favorite browser and play the games!
  • Hit sbt optimizeJS. This may cause SBT to run out of memory. See here for how to give it more.
  • Open /index.html in your favorite browser and play the games!

License

The MIT License (MIT)

Copyright (c) 2013 Li Haoyi

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

scala-js-games open issues Ask a question     (View All Issues)
  • over 4 years HTMLCanvasElement now in dom.html package
scala-js-games open pull requests (View All Pulls)
  • updated project to scala 2.11, scala-js-dom 0.9.0, and sbt-scalajs 0.6.7
  • Make the games work again with latest Scala and Scala.js versions
scala-js-games list of languages used
Other projects in Scala