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.
The following classes in the actual jsglib package are relevant for you (the rest is for internal use):
- Stage - provides the stage, input handling and counters
- StageObject - objects that can be moved, rotated, scaled, ...
- Tools - some useful static methods (print, read, wait, ...)
Installation
First, download the latest version here. Open the ZIP archive. It contains the following folders:
- doc - autogenerated Java docs for the relevant classes
- images - some background and object images
- src - jsglib and example packages
Eclipse
The archive structure equals Eclipse its hierarchy:
- Create your own Java project, e.g., C:\workspace\MyProject.
- Copy archive's images to this project folder, so that all images are in C:\workspace\MyProject\images.
- Copy archive's src/jsglib and all examples to your project's source folder C:\workspace\MyProject\src.
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.