Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

Commit

Permalink
-- Screen transition fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Torbuntu committed Aug 26, 2019
1 parent 985035a commit 84640ae
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion assets/Data/system.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ btn_start=6
launch_title=_
axis_horizontal=0

terminal_mode=true
terminal_mode=false
17 changes: 9 additions & 8 deletions assets/Programs/WizRobo/Code/WizRobo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ class WizRobo extends leikr.Engine {
}

void update(float delta){
if(keyPress("F1")) DEBUG = !DEBUG
HOST_INFO()
if(keyPress("F1")) DEBUG = !DEBUG
debuglvl()
if(gameOver){
if(keyPress("Enter") || button("SELECT")){
Expand Down Expand Up @@ -665,10 +666,10 @@ class WizRobo extends leikr.Engine {
sprite(healthSpids[1], 96, 0)
sprite(healthSpids[2], 88, 0)

text("lvl:"+level, 112, 0, 32)
text("lvl:"+level, 112, 0, 1)

sprite(29, 160, 0)
text(":"+wizard.scrolls, 168, 0, 32)
text(":"+wizard.scrolls, 168, 0, 1)
}

void renderDefault(){
Expand Down Expand Up @@ -716,9 +717,9 @@ class WizRobo extends leikr.Engine {
}

void renderGameOver(){
text("Game Over!", 46, 32, 32)
text("Thanks for playing this demo.", 8, 42, 32)
text("Press Enter to play again.", 8, 54, 32)
text("Game Over!", 46, 32, 1)
text("Thanks for playing this demo.", 8, 42, 1)
text("Press Enter to play again.", 8, 54, 1)
}

void render(){
Expand All @@ -731,8 +732,8 @@ class WizRobo extends leikr.Engine {
if(title){
image("stonewall", 0,0)
map()
text("Escape the dungeon!", 46, 32, 32)
text("Move: arrows. Jump: Space. Charge: X. Shoot: Z. Start: Enter", 12, 110, 116, 32)
text("Escape the dungeon!", 46, 32, 1)
text("Move: arrows. Jump: Space. Charge: X. Shoot: Z. Start: Enter", 12, 110, 116, 1)
return
}else{
image("stonewall", 0,8)
Expand Down
2 changes: 1 addition & 1 deletion assets/Programs/WizRobo/program.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
max_sprites = 200
compile_source = false
use_compiled = true
use_compiled = false
title = WizRobo
type = Demo
author = Tor
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/leikr/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ public final void HOST_INFO() {
System.out.println("Total Mem: " + Mdx.platformUtils.getTotalMemory());
System.out.println("Free Mem : " + Mdx.platformUtils.getAvailableMemory());
System.out.println("Used Mem : " + Mdx.platformUtils.getUsedMemory());
System.out.println("UPS : " + Mdx.platformUtils.getAverageUpdateDuration());
System.out.println("Avg. UPD : " + Mdx.platformUtils.getAverageUpdateDuration());
System.out.println();
}

public long getFrame() {
Expand Down
9 changes: 6 additions & 3 deletions core/src/main/java/leikr/screens/ErrorScreen.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package leikr.screens;

import leikr.GameRuntime;
import leikr.customProperties.CustomSystemProperties;
import org.mini2Dx.core.game.GameContainer;
import org.mini2Dx.core.Graphics;
import org.mini2Dx.core.Mdx;
Expand All @@ -11,8 +12,6 @@
import org.mini2Dx.core.screen.GameScreen;
import org.mini2Dx.core.screen.ScreenManager;
import org.mini2Dx.core.screen.Transition;
import org.mini2Dx.core.screen.transition.FadeInTransition;
import org.mini2Dx.core.screen.transition.FadeOutTransition;
import org.mini2Dx.gdx.Input.Keys;

/**
Expand Down Expand Up @@ -58,7 +57,11 @@ public void initialise(GameContainer gc) {
public void update(GameContainer gc, ScreenManager<? extends GameScreen> sm, float f) {
if (MENU || Mdx.input.isKeyJustPressed(Keys.ESCAPE) || Mdx.input.isKeyJustPressed(Keys.ENTER) || Mdx.input.isKeyJustPressed(Keys.SPACE) || Mdx.input.isKeyJustPressed(Keys.Q)) {
MENU = false;
sm.enterGameScreen(MenuScreen.ID, new FadeOutTransition(Colors.TEAL()), new FadeInTransition(Colors.FOREST()));
if (CustomSystemProperties.TERMINAL_MODE) {
sm.enterGameScreen(TerminalScreen.ID, null, null);
} else {
sm.enterGameScreen(MenuScreen.ID, null, null);
}
}

if (Mdx.input.isKeyDown(Keys.CONTROL_LEFT) && Mdx.input.isKeyJustPressed(Keys.R) || Mdx.input.isKeyJustPressed(Keys.F5)) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-bin.zip

0 comments on commit 84640ae

Please sign in to comment.