Skip to content

Commit

Permalink
Finishing touches.
Browse files Browse the repository at this point in the history
  • Loading branch information
DaanVanYperen committed Apr 24, 2018
1 parent 501cf43 commit c6bc92f
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 33 deletions.
29 changes: 7 additions & 22 deletions core/src/net/mostlyoriginal/game/screen/GameScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ protected World createWorld() {
new ChainingSystem(),
new EntitySpawnerSystem(),
new MapSystem(),
//new PuzzleDirectorSystem(),
new ParticleSystem(),
// new PowerSystem(),
new DialogSystem(),
//
new GameScreenAssetSystem(),
new ShipDataSystem(),
// new DialogDataSystem(),
new GameScreenSetupSystem(),
new FontManager(),
//
Expand All @@ -64,14 +61,11 @@ protected World createWorld() {
//
// // spawn
new TriggerSystem(),
// new FarewellSystem(),
// new SpoutSystem(),
//

// // Control and logic.
new CameraUnfreezeSystem(),
new EnemyCleanupSystem(),
new FollowSystem(),
//new FlightPatternControlSystem(),
new KeyboardInputSystem(),
new TutorialInputSystem(),
new CarControlSystem(),
Expand All @@ -82,18 +76,15 @@ protected World createWorld() {
new GridSnapSystem(),
new AttachmentSystem(),
new SpinoutSystem(),
// new BirdBrainSystem(),
//

// // Physics.
new GravitySystem(),
new MapCollisionSystem(),
new PlatformCollisionSystem(),
new PhysicsSystem(),
//
// // Effects.
// new FootstepSystem(),
new CarriedSystem(),
// new SocketSystem(),
new CrashSystem(),
new TireTrackSystem(),
//
Expand All @@ -105,28 +96,22 @@ protected World createWorld() {
new ScoreUISystem(),
new RewardSystem(),
new PriorityAnimSystem(),
//
// new JumpAttackSystem(),
//
new ClearScreenSystem(Color.valueOf("7B7A7F")),
// new RenderBackgroundSystem(),
new MapRenderSystem(),

//

renderBatchingSystem = new RenderBatchingSystem(),
new MyAnimRenderSystem(renderBatchingSystem),
new BoundingBoxRenderSystem(renderBatchingSystem),
new MyLabelRenderSystem(renderBatchingSystem),
new AdditiveRenderSystem(),
new MapRenderInFrontSystem(),
// new TerminalSystem(),
//new ExitSystem(),
// new DeathSystem(),
// new HealthUISystem(),

new SfxSystem(),
new TransitionSystem(GdxArtemisGame.getInstance())
).build());

new SfxSystem()
).with(WorldConfigurationBuilder.Priority.LOWEST,new TransitionSystem(GdxArtemisGame.getInstance()))
.build());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class ScoreUISystem extends BaseSystem {


private int score = 0;
private boolean finished;
private float finishedTime;
private boolean finished = false;
private float finishedTime =0;
private boolean pressed = false;
private TutorialInputSystem tutorialInputSystem;
private TransitionSystem transitionSystem;
Expand All @@ -57,12 +57,21 @@ public void displayScorecard() {

final String decimalScore = getDecimalFormattedString("" + score);
E.E()
.labelText((newHighscore ? "NEW HIGHSCORE! " : "SCORED ") + decimalScore)
.labelText((newHighscore ? "NEW HIGHSCORE! " : "SCORE ") + decimalScore)
.labelAlign(Label.Align.RIGHT)
.fontFontName("italshuge")
.tint(1f, 1f, 0f, 1f)
.pos(cameraSystem.camera.position.x, cameraSystem.camera.position.y)
.pos(cameraSystem.camera.position.x, cameraSystem.camera.position.y+16)
.renderLayer(G.LAYER_PLAYER + 100);

E.E()
.labelText(scoreAsText(score))
.labelAlign(Label.Align.RIGHT)
.fontFontName("ital")
.tint(1f, 1f, 0.2f, 1f)
.pos(cameraSystem.camera.position.x, cameraSystem.camera.position.y-20)
.renderLayer(G.LAYER_PLAYER + 101);

E.E()
.labelText("Play again? Press space")
.labelAlign(Label.Align.RIGHT)
Expand All @@ -71,13 +80,31 @@ public void displayScorecard() {
.pos(cameraSystem.camera.position.x, cameraSystem.camera.position.y - 40)
.script(sequence(
delay(milliseconds(250)),
JamOperationFactory.tintTo(Tint.WHITE)
JamOperationFactory.tintBetween(Tint.TRANSPARENT, Tint.WHITE, milliseconds(100))
))
.renderLayer(G.LAYER_PLAYER + 100);
.renderLayer(G.LAYER_PLAYER + 102);
}
finished = true;
}

private String scoreAsText(int score) {
if ( score > 1000000 ) return "TUGGIONAIRE";
if ( score > 500000 ) return "Wait, how, where!?";
if ( score > 400000 ) return "Ok this isn't possible is it?";
if ( score > 300000 ) return "Tugotron 5000";
if ( score > 200000 ) return "Lord of the Track";
if ( score > 150000 ) return "Bested the developers!";
if ( score > 100000 ) return "Tow King";
if ( score > 90000 ) return "Lord of the Pylons";
if ( score > 80000 ) return "Burning Rubber";
if ( score > 60000 ) return "Oil Slick";
if ( score > 40000 ) return "Abandoned Shopping Cart";
if ( score > 20000 ) return "Rally Granny";
if ( score > 10000 ) return "Sunday Driver";
if ( score > 1000 ) return "Parking Brake";
return "Didn't even try";
}

private boolean saveScore() {
Preferences prefs = Gdx.app.getPreferences("ld41wrecklessR2");
final String key = "highscore_" + mapSystem.activeLevel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class TransitionSystem extends EntityProcessingSystem {

private Game game;
private GameScreenAssetSystem assetSystem;
private boolean triggered=false;

public TransitionSystem(Game game) {
super(Aspect.all(Transition.class));
Expand All @@ -46,11 +47,14 @@ public void transition(Class<? extends Screen> screen, float delay) {

@Override
protected void process(Entity e) {
try {
assetSystem.stopMusic();
game.setScreen(ClassReflection.newInstance(E(e).transitionScreen()));
} catch (Exception ex) {
throw new RuntimeException(ex);
if ( !triggered ) {
triggered=true;
try {
assetSystem.stopMusic();
game.setScreen(ClassReflection.newInstance(E(e).transitionScreen()));
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
}
}

0 comments on commit c6bc92f

Please sign in to comment.