Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .changeset/pen-sprites.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changeset/preview.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/tiled-spawn.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/window-first.md

This file was deleted.

41 changes: 40 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
---
name: Changelog
index: 76
index: 77
lang: en
---

## 6.0.0



`TiledMap.spawn("Objects")` creates a sprite for each object of a layer whose
type (Tiled's "class") is the name of a sprite class, puts it where the object
is and adds it to the stage. Objects drawn as areas give their sprite that area
as its hitbox. The sprite class needs a constructor taking the `MapObject`, one
taking `(double x, double y)`, or one without parameters.


A sprite that only draws with its pen no longer shows the red "?" marker for a
missing costume. The marker (and its warning) now appears only for a sprite that
stays without a costume, a hitbox and a used pen for a second.


Editors can show a preview of a stage: started with
`-Dscratch4j.preview=<folder>`, a program draws the first frame of its stage,
saves it as `frame.png` with the sprites described in `stage.json`, and ends.
`-Dscratch4j.preview.stage=<Class>` previews another stage, and
`-Dscratch4j.preview.omit=<fields>` leaves the sprites in those fields out of
the picture.


💥 BREAKING CHANGE: A stage no longer opens the window itself. Create the window
first and put the stage into it:

```java
Window myWindow = new Window(480, 360);
myWindow.setStage(new MyStage());
```

`new Stage(width, height)` and `new Stage(width, height, assets)` are gone: a
stage is always as big as the window it is shown in, so the size (and the assets
folder) go to `new Window(...)`. Remove `super(width, height)` from your stages.
A stage made before there is a window says how to fix it, and a window nobody
put a stage into says so too.


## 5.8.0

Add the Scratch for Java cat as built-in sprites. Its animations - idle, walk, crouch, jump, fall, land, punch, hurt, ko, cheer and climb - load by name, for example `addAnimation("walk", "cat_walk_%d", 6)`. Coffee beans, a bug, a goal mug and hearts for a platformer come with it. The new Cat Platformer example shows them all in a game.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.openpatch</groupId>
<artifactId>scratch</artifactId>
<version>5.8.0</version>
<version>6.0.0</version>
<packaging>jar</packaging>

<name>Scratch for Java</name>
Expand Down
Loading