• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Scala
  • Created about 11 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Some simple games ported to Scala-Js

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.

More Repositories

1

macropy

Macros in Python: quasiquotes, case classes, LINQ and more!
TSQL
3,278
star
2

Metascala

A JVM written in Scala
Scala
1,159
star
3

scala.rx

An experimental library for Functional Reactive Programming in Scala
Scala
984
star
4

autowire

Macros for simple/safe RPCs between Scala applications, including ScalaJS/ScalaJVM
Scala
379
star
5

Scalatex

Programmable, Typesafe Document Generation
Scala
290
star
6

workbench

Tooling around scala-js
Scala
234
star
7

workbench-example-app

An example application written in ScalaJS using scala-js-dom and scala-js-workbench
Scala
204
star
8

Scalite

An experimental whitespace-delimited syntax for the Scala programming language
Scala
149
star
9

hands-on-scala-js

Better documentation for Scala.js
Scala
142
star
10

SprayWebSockets

An implementation of a websocket server on top of spray.io
Scala
105
star
11

scala-js-fiddle

Source code for Scala.jsFiddle
Scala
86
star
12

scala-native-example-app

Example Scala-Native application using third party libraries and a test suite
Scala
53
star
13

scala-bench

Some benchmarks of memory and runtime performance of Scala's collections
Scala
43
star
14

roll

A work-in-progress game being developed using scala-js
JavaScript
34
star
15

6858

The World’s Most Advanced Sandbox™ (TWMAS) is a portable sandbox designed to safely run untrusted Java bytecode
Java
29
star
16

XMLite

XMLite is a lightweight markup language
Scala
16
star
17

autojit

Scala
13
star
18

opendata

Python
11
star
19

crdt

Pure-Scala CRDTs
Scala
11
star
20

sinject

SInject is a Scala compiler plugin which helps auto-generate implicit parameters
Scala
10
star
21

Java-Games

A collection of old games written in Java, dating back to 2004-2007
Java
10
star
22

boxer

Scala
3
star
23

mysite

Source code for my old, dead blog (without the content which is lost)
Python
2
star
24

empty

1
star
25

FSharpMetro

An attempt at making a Windows 8 game using F#
C#
1
star
26

utest-example-module

A skeleton for writing cross-platform Scala libraries
Scala
1
star