schooltools

JSGLib

Download jsglib-1.0.1.zip
[ All files ]

Introduction

The JSGLib (Java Simple Gaming Library) provides a Java package intended to teach object-oriented programming in a fun way. It is inspired by Scratch and similar to Greenfoot except that it is not a black box but an open source Java package that can be used with any IDE. It provides an easy-to-use Stage and StageObjects that can be modified and interact.

ex5_balloons
ex6_catnmouse
ex7_spaceshooter

The following classes in the actual jsglib package are relevant for you (the rest is for internal use):

Note, that Toolbox provides exactly the same functionality as Tools but with non-static methods. Use it if you want to avoid static methods.

Installation

First, download the latest version here. Open the ZIP archive. It contains the following folders:

Eclipse

The archive structure equals Eclipse its hierarchy:

  1. Create your own Java project, e.g., C:\workspace\MyProject.
  2. Copy archive's images to this project folder, so that all images are in C:\workspace\MyProject\images.
  3. Copy archive's src/jsglib and all examples to your project's source folder C:\workspace\MyProject\src.
That's it. It should look like this:
     MyProject
         images
         src
             ex1_sum
             ex2_guess
             ...
             jsglib

For your actual programs you create new packages in src like the examples.

JavaEditor

The only difference to Eclipse is that sglib and images are at the same level as there is no extra src directory for packages with JavaEditor. That is, e.g., if you work in C:\Java, you copy jsglib and images to C:\Java and create your own programs (e.g. mygame) as new folders in this directory:
     Java
         images
         jsglib
         mygame

Examples

You can have a look at the examples in src or at the following PDFs. Note, that these are not meant to teach object-oriented programming but to demonstrate how to use the jsglib. It is assumed that you have some basic understanding of programming.

A (german) course to teach object-oriented programming to students can be found here.

Documentation

The autogenerated Java documentation can be found here (for Stage.java, StageObject.java and Tools.java) and is also included to the archive for offline use.