Skip to content

A minimal Scala library for beginner-friendly 2D game programming.

License

Notifications You must be signed in to change notification settings

bjornregnell/simplecanvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simplecanvas

This repo is a playground that was created to experiment with beginner friendly game programming in Scala. The released results of these experiments are available here: https://github.com/lunduniversity/introprog-scalalib

This repo includes a JavaFX version of PixelWindow that was removed from introprog-scalalib, as Oracle has decided that JavaFX will not be included out-of-the-box:

The introprog.fx package in this repo demonstrates how to hide the underlying special treatment of the JFX application frame. A possible future extension is to provide a declarative, general GUI api that works the same on ScalaJS and on ScalaJVM and perhaps as well as Scala Native.

How to play with the code in this repo?

  • Download the latest jar from the release page:

  • Put the jar on your classpath manually:

> scalac -cp jarfile.jar yourcode.scala
> scala -cp "jarfile.jar:." yourpackage.YourMain
  • Or use sbt console after placing the jar in a lib sub-folder you can e.g.:
scala> val w = new introprog.PixelWindow()
w: introprog.PixelWindow = introprog.PixelWindow@7cf7ecf0

scala> w.drawText("HELLO WORLD!", 100, 100)

scala> w.fill(10,10,20,30)

How to build a jar yourself?

Clone this repo and then enter sbt package in terminal. You need the Scala Build Tool on your path:

How to contribute?

About

A minimal Scala library for beginner-friendly 2D game programming.

Resources

License

Stars

Watchers

Forks

Packages

No packages published