-
-
Notifications
You must be signed in to change notification settings - Fork 559
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from AlmasB/0.3.6
0.3.6
- Loading branch information
Showing
337 changed files
with
2,104 additions
and
598 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
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
fxgl-games/src/main/resources/assets/properties/system.properties
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-4.29 MB
fxgl-games/src/main/resources/assets/textures/spaceinvaders/explosion.png
Binary file not shown.
Binary file removed
BIN
-2.96 KB
fxgl-games/src/main/resources/assets/textures/spaceinvaders/life.png
Binary file not shown.
Binary file removed
BIN
-2.77 KB
fxgl-games/src/main/resources/assets/textures/spaceinvaders/player2.png
Binary file not shown.
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
File renamed without changes.
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 |
---|---|---|
|
@@ -16,11 +16,11 @@ | |
import com.almasb.fxgl.physics.BoundingShape; | ||
import com.almasb.fxgl.physics.HitBox; | ||
import com.almasb.fxgl.physics.PhysicsComponent; | ||
import com.almasb.fxgl.physics.box2d.dynamics.BodyType; | ||
import com.almasb.fxgl.physics.box2d.dynamics.FixtureDef; | ||
import com.almasb.fxglgames.breakout.control.BallControl; | ||
import com.almasb.fxglgames.breakout.control.BatControl; | ||
import com.almasb.fxglgames.breakout.control.BrickControl; | ||
import com.almasb.fxgl.physics.box2d.dynamics.BodyType; | ||
import com.almasb.fxgl.physics.box2d.dynamics.FixtureDef; | ||
|
||
/** | ||
* @author Almas Baimagambetov ([email protected]) | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -7,14 +7,15 @@ | |
|
||
import com.almasb.fxgl.app.ApplicationMode; | ||
import com.almasb.fxgl.app.GameApplication; | ||
import com.almasb.fxgl.audio.Music; | ||
import com.almasb.fxgl.ecs.Entity; | ||
import com.almasb.fxgl.entity.Entities; | ||
import com.almasb.fxgl.entity.EntityView; | ||
import com.almasb.fxgl.entity.GameEntity; | ||
import com.almasb.fxgl.input.Input; | ||
import com.almasb.fxgl.input.UserAction; | ||
import com.almasb.fxgl.physics.CollisionHandler; | ||
import com.almasb.fxgl.physics.PhysicsWorld; | ||
import com.almasb.fxgl.input.Input; | ||
import com.almasb.fxgl.settings.GameSettings; | ||
import com.almasb.fxgl.ui.WheelMenu; | ||
import com.almasb.fxglgames.geowars.component.GraphicsComponent; | ||
|
@@ -37,6 +38,9 @@ | |
|
||
import java.util.Map; | ||
|
||
import static com.almasb.fxgl.app.DSLKt.getd; | ||
import static com.almasb.fxgl.app.DSLKt.set; | ||
|
||
/** | ||
* @author Almas Baimagambetov (AlmasB) ([email protected]) | ||
*/ | ||
|
@@ -120,6 +124,13 @@ protected void onActionBegin() { | |
openWeaponMenu(); | ||
} | ||
}, MouseButton.SECONDARY); | ||
|
||
input.addAction(new UserAction("Time") { | ||
@Override | ||
protected void onActionBegin() { | ||
set("timeRatio", getd("timeRatio") == 1.0 ? 0.05 : 1.0); | ||
} | ||
}, KeyCode.G); | ||
} | ||
|
||
@Override | ||
|
@@ -128,9 +139,12 @@ protected void initGameVars(Map<String, Object> vars) { | |
vars.put("multiplier", 1); | ||
vars.put("kills", 0); | ||
vars.put("time", 180); | ||
vars.put("timeRatio", 1.0); | ||
vars.put("weaponType", WeaponType.NORMAL); | ||
} | ||
|
||
private Music music; | ||
|
||
@Override | ||
protected void initGame() { | ||
getAudioPlayer().setGlobalSoundVolume(0.2); | ||
|
@@ -145,7 +159,16 @@ protected void initGame() { | |
getMasterTimer().runAtInterval(() -> getGameWorld().spawn("Crystal", getRandomPoint()), Duration.seconds(4)); | ||
getMasterTimer().runAtInterval(() -> getGameState().increment("time", -1), Duration.seconds(1)); | ||
|
||
getAudioPlayer().playMusic("bgm.mp3"); | ||
music = getAssetLoader().loadMusic("bgm.mp3"); | ||
|
||
getGameState().<Double>addListener("timeRatio", (prev, now) -> { | ||
if (now != 1.0) { | ||
now = 0.85; | ||
} | ||
music.setRate(now); | ||
}); | ||
|
||
getAudioPlayer().playMusic(music); | ||
} | ||
|
||
@Override | ||
|
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,11 @@ | |
import com.almasb.fxgl.physics.BoundingShape; | ||
import com.almasb.fxgl.physics.HitBox; | ||
import com.almasb.fxgl.physics.PhysicsComponent; | ||
import com.almasb.fxgl.physics.box2d.dynamics.BodyType; | ||
import com.almasb.fxgl.physics.box2d.dynamics.FixtureDef; | ||
import javafx.scene.paint.Color; | ||
import javafx.scene.shape.Circle; | ||
import javafx.scene.shape.Rectangle; | ||
import com.almasb.fxgl.physics.box2d.dynamics.BodyType; | ||
import com.almasb.fxgl.physics.box2d.dynamics.FixtureDef; | ||
|
||
/** | ||
* @author Almas Baimagambetov (AlmasB) ([email protected]) | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.