Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
165 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
CrystalChase/src/main/java/com/almasb/fxglgames/cc/CrystalApp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.almasb.fxglgames.cc; | ||
|
||
import com.almasb.fxgl.app.GameApplication; | ||
import com.almasb.fxgl.app.GameSettings; | ||
import com.almasb.fxgl.core.math.FXGLMath; | ||
import com.almasb.fxgl.dsl.FXGL; | ||
import javafx.geometry.Rectangle2D; | ||
import javafx.util.Duration; | ||
|
||
import static com.almasb.fxgl.dsl.FXGL.*; | ||
|
||
/** | ||
* @author Almas Baimagambetov (almaslvl@gmail.com) | ||
*/ | ||
public class CrystalApp extends GameApplication { | ||
|
||
private enum Type { | ||
PLAYER, CRYSTAL | ||
} | ||
|
||
@Override | ||
protected void initSettings(GameSettings settings) { | ||
settings.setTitle("Crystal Chase"); | ||
} | ||
|
||
@Override | ||
protected void initGame() { | ||
run(this::spawnCrystal, Duration.seconds(1)); | ||
} | ||
|
||
private void spawnCrystal() { | ||
var texture = texture("YellowCrystal.png"); | ||
|
||
|
||
entityBuilder().at(FXGLMath.randomPoint(new Rectangle2D(0, 0, getAppWidth() - 55, getAppHeight() - 55))) | ||
.type(Type.CRYSTAL) | ||
.view(texture.toAnimatedTexture(8, Duration.seconds(0.2)).loop()) | ||
.buildAndAttach(); | ||
} | ||
|
||
public static void main(String[] args) { | ||
launch(args); | ||
} | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 0 additions & 53 deletions
53
SlidingPuzzle/src/main/java/com/almasb/fxglgames/slidingpuzzle/SlidingPuzzleApp.java
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters