Skip to content

Releases: openpatch/scratch-for-java

v3.2.1

12 Mar 01:18
b58f284
Compare
Choose a tag to compare

v3.2.0

03 Mar 02:01
46869b4
Compare
Choose a tag to compare

v3.1.0

10 Feb 12:02
4a249c2
Compare
Choose a tag to compare

3.1.0

  • 🚀 Feat: The debug modus now shows the current FPS.
  • 🚀 Feat: isTouchingSprite(Class). IsTouchingSprite accepts also a Class, so you can check the collision with all objects of this class.

v3.0.0

30 Jan 23:34
d007d76
Compare
Choose a tag to compare

3.0.0

Scratch for Java will from now on focus on being a standalone library. Even though it can be used in processing.

We also provide os-specific jar files for the standalone version.

v2.1.0

11 Dec 21:14
ca34966
Compare
Choose a tag to compare

Changes

  • 🚀 Feat: Image, Text and Pen can now be added without being used in a Sprite. Example:
import org.openpatch.scratch.Stage;
import org.openpatch.scratch.extensions.Pen;

public class PenStandalone {
    public static void main(String[] args) {
        Stage s = new Stage(400, 400);
        Pen p = new Pen();
        p.down();
        p.setPosition(40, 40);
        p.setPosition(40, 100);
    }
}
  • 🚀 Feat: AnimatedSprite and Sprite now support SpriteSheets. Example:
import org.openpatch.scratch.AnimatedSprite;
import org.openpatch.scratch.Stage;

public class SpriteSheet {
    public static void main(String[] args) {
       Stage stage = new Stage() ;
       stage.add(new AnimatedBee());
    }
}

class AnimatedBee extends AnimatedSprite {
    public AnimatedBee() {
        this.addAnimation("idle", "bee_idle.png", 6, 36, 34);
    }

    public void run() {
        this.playAnimation("idle");
    }
}
  • 🐛 Fix: Pen did not include the first point

BREAKING CHANGES

  • 💥 Prefix Scratch is removed. For exmaple: ScratchSprite -> Sprite, ScratchStage -> Stage
  • 💥 getInstance and init got removed from Stage. You now have to instantiate a Stage like a normal Object new Stage(this) // Processing or new Stage(400, 400) // Standalone. Be aware that you can only have one Stage at a time.

v2.0.0

26 Nov 21:28
ac0f71e
Compare
Choose a tag to compare

The Processing library Scratch changed owners. It is now hosted under the OpenPatch organization, therefore the package name change. You can now access the classes of this library like so:

import org.openpatch.scratch.*

v1.15.0

25 Nov 07:49
bb6f470
Compare
Choose a tag to compare

The Standalone Release

This release does not change the behaviour of the Processing library!

You can now use the scratch-standalone.jar for using this library in any Java environment. When you use this library outside of processing, you have to create a new object of the class ScratchStage. The init-method will only work in Processing.

import eu.barkmin.processing.scratch.*;

public class MyProgram
{
    public MyProgram() {
        ScratchStage s = new ScratchStage(800, 400);
        s.addSprite(new Cat());   
    }
}

class Cat extends ScratchSprite
{
  public Cat() {
    this.addCostume("sitzen", "sprites/cat.png");
    this.setOnEdgeBounce(true);
  }
  
  public void run() {
      this.move(1);
  }
}

You can also use this library outside of Processing in a more imperative way, similar to Shapes and Sprites. For this to work, the wait-method was added to the ScratchStage class.

import eu.barkmin.processing.scratch.*;

public class MyProgram
{
    public MyProgram() {
        ScratchStage s = new ScratchStage(400, 400);
        ScratchSprite cat = new ScratchSprite(
            "sitzen", "sprites/cat.png"
        );
        s.addSprite(cat);
        
        cat.setOnEdgeBounce(true);
        
        while(!s.isKeyPressed(27)) {
            cat.move(1);
            s.wait(100);
        }
    }
}

v1.14.2

12 May 20:33
Compare
Choose a tag to compare
  • Remove System.out.print statements

v1.14.1

12 May 13:16
Compare
Choose a tag to compare
  • improve ScratchText rendering

v1.14.0

11 May 23:33
Compare
Choose a tag to compare
  • add think and say to ScratchSprite
  • add display to ScratchStage
  • add whenClicked to Sprite
  • add whenBackdropSwitches to Sprite