File tree Expand file tree Collapse file tree
src/org/openpatch/scratch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,18 @@ index: 4
44lang : en
55---
66
7+ ## 4.19.0
8+
9+ - 🚀 Feat: Add transitionToStage method to Window class.
10+
11+ You can now use the transitionToStage method for a smoothing transition between the current and the new stage.
12+
13+ ``` java
14+ window. transitionToStage(new MyStage (), 500 );
15+ ```
16+
17+ The DonutIO example shows the usage of the transitionToStage method.
18+
719## 4.18.1
820
921- 🐛 Fix: isTouchingSprite not working correctly, when the sprite is resized.
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public Game() {
1414 }
1515
1616 public static void main (String [] args ) {
17- Text .FONT_SIZES = new int [] {32 , 48 };
17+ Text .FONT_SIZES = new int [] { 32 , 48 };
1818 new Game ();
1919 }
2020}
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public void whenKeyPressed(int keyCode) {
3030 System .out .println (keyCode );
3131 if (keyCode == KeyCode .VK_SPACE ) {
3232 Game .LEVEL = 0 ;
33- Window .getInstance ().setStage (new WorldStage ());
33+ Window .getInstance ().transitionToStage (new WorldStage (), 500 );
3434 }
3535 }
3636}
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public StartStage() {
3737 public void whenKeyPressed (int keyCode ) {
3838 if (keyCode == KeyCode .VK_SPACE ) {
3939 Game .LEVEL = 0 ;
40- Window .getInstance ().setStage (new WorldStage ());
40+ Window .getInstance ().transitionToStage (new WorldStage (), 500 );
4141 }
4242 }
4343}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public WinStage() {
2929 public void whenKeyPressed (int keyCode ) {
3030 if (keyCode == KeyCode .VK_SPACE ) {
3131 Game .LEVEL += 1 ;
32- Window .getInstance ().setStage (new WorldStage ());
32+ Window .getInstance ().transitionToStage (new WorldStage (), 500 );
3333 }
3434 }
3535}
Original file line number Diff line number Diff line change @@ -53,11 +53,13 @@ public void run() {
5353 }
5454
5555 if (this .count (FollowDonut .class ) == 0 ) {
56- Window .getInstance ().setStage (new WinStage ());
56+ Window .getInstance ().transitionToStage (new WinStage (), 500 );
57+ return ;
5758 }
5859
5960 if (this .count (PlayerDonut .class ) == 0 ) {
60- Window .getInstance ().setStage (new GameOverStage ());
61+ Window .getInstance ().transitionToStage (new GameOverStage (), 500 );
62+ return ;
6163 }
6264
6365 if (this .isKeyPressed (KeyCode .VK_1 )) {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ author.url=https://openpatch.org
4040# This is NOT a direct link to where to download it.
4141
4242library.url =https://github.com/openpatch/scratch-for-java
43- library.version =4.18.1
43+ library.version =4.19.0
4444
4545
4646# Set the category (or categories) of your Library from the following list:
You can’t perform that action at this time.
0 commit comments