Skip to content

Commit

Permalink
Merge remote-tracking branch 'bjasspa/master' into mediumSpeed
Browse files Browse the repository at this point in the history
  • Loading branch information
CmdrStardust committed Jan 23, 2016
2 parents 4973924 + 8676224 commit 2635bde
Show file tree
Hide file tree
Showing 16 changed files with 275 additions and 254 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ tags
*~
bin/
gen/R.java.d
main.*.de.phbouillon.android.games.alite.obb
26 changes: 26 additions & 0 deletions obb_build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off

if "%1." == "." goto usage_help

set fname=main.%1%.de.phbouillon.android.games.alite.obb

java -jar jobb.jar -d Resources -o %fname% -pn de.phbouillon.android.games.alite -pv %1
set ERRORLEV=%ERRORLEVEL%

if NOT "%ERRORLEV%" == "0" goto build_exit

FOR %%A IN (%fname%) DO set fsize=%%~zA

echo.
echo EXTENSION_FILE_LENGTH = %fsize%l;

goto build_exit

:usage_help

echo.
echo Usage: build_obb ^<obb_version^>

:build_exit

EXIT /B %ERRORLEV%
12 changes: 6 additions & 6 deletions src/de/phbouillon/android/framework/impl/gl/font/GLText.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ public class GLText {
public final static int CHAR_START = 32; // First Character (ASCII Code)
public final static int CHAR_END = 126; // Last Character (ASCII Code)

// 169: ©
// 201: É
// 233: é
// 235: ë
// 176: °
// 169: copyright
// 201: E-acute
// 233: e-acute
// 235: e-diaeresis
// 176: degree sign
public final static int [] ADDITIONAL_CHARS = new int [] {169, 201, 233, 235, 176};
public final static char [] ADDITIONAL_CHARS_STR = new char [] {', 'É', 'é', 'ë', '°'};
public final static char [] ADDITIONAL_CHARS_STR = new char [] { '\u00a9', '\u00c9', '\u00e9', '\u00eb', '\u00b0' };

public final static int CHAR_CNT = (((CHAR_END - CHAR_START + ADDITIONAL_CHARS.length) + 1) + 1); // Character
// Count
Expand Down
3 changes: 3 additions & 0 deletions src/de/phbouillon/android/games/alite/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class Settings {
public static boolean laserButtonAutofire = true;
public static boolean hasBeenPlayedBefore = false;
public static boolean dockingComputerFast = false;
public static boolean dockingComputerMed = false;
public static int [] buttonPosition = new int[12];
public static boolean engineExhaust = true;
public static boolean targetBox = true;
Expand Down Expand Up @@ -136,6 +137,7 @@ public static void load(FileIO files) {
flatButtonDisplay = Boolean.parseBoolean(in.readLine());
volumes[Sound.SoundType.COMBAT_FX.getValue()] = Float.parseFloat(in.readLine());
vibrateLevel = Float.parseFloat(in.readLine());
dockingComputerMed = Boolean.parseBoolean(in.readLine());
} catch (Throwable t) {
// Ignore
} finally {
Expand Down Expand Up @@ -193,6 +195,7 @@ public static void save(FileIO files) {
out.write(Boolean.toString(flatButtonDisplay) + "\n");
out.write(Float.toString(volumes[Sound.SoundType.COMBAT_FX.getValue()]) + "\n");
out.write(Float.toString(vibrateLevel) + "\n");
out.write(Boolean.toString(dockingComputerMed) + "\n");
} catch (Exception e) {
// Ignore
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* Alite - Discover the Universe on your Favorite Android Device
* Copyright (C) 2015 Philipp Bouillon
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License, or
Expand Down Expand Up @@ -38,15 +38,15 @@ public class SaveScreen extends CatalogScreen {
private final Button saveNewCommanderButton;
private boolean confirmedSave = false;
private String pendingMessage;

public SaveScreen(Game game, String title) {
super(game, title);
saveNewCommanderButton = new Button(50, 950, 500, 100, "Save New Commander", Assets.regularFont, null);
saveNewCommanderButton.setGradient(true);
deleteButton = null;
pendingMessage = null;
}

public SaveScreen(Game game, String title, String msg) {
super(game, title);
saveNewCommanderButton = new Button(50, 950, 500, 100, "Save New Commander", Assets.regularFont, null);
Expand All @@ -58,7 +58,7 @@ public SaveScreen(Game game, String title, String msg) {
public static boolean initialize(Alite alite, final DataInputStream dis) {
alite.setScreen(new SaveScreen(alite, "Save Commander"));
return true;
}
}

@Override
public void activate() {
Expand All @@ -70,22 +70,22 @@ public void activate() {
confirmedSave = pendingMessage != null;
pendingMessage = null;
}

@Override
protected void processTouch(TouchEvent touch) {
super.processTouch(touch);
if (getMessage() != null) {
return;
}
if (confirmedSave) {
newScreen = new SaveScreen(game, "Save Commander", pendingMessage);
newScreen = new StatusScreen(game);
confirmedSave = false;
}
if (touch.type == TouchEvent.TOUCH_UP) {
if (saveNewCommanderButton.isTouched(touch.x, touch.y)) {
SoundManager.play(Assets.click);
final Alite alite = (Alite) game;
TextInputScreen textInput = new TextInputScreen(alite, "New Commander Name", "Enter the name for the new commander", alite.getPlayer().getName(), this, new TextCallback() {
TextInputScreen textInput = new TextInputScreen(alite, "New Commander Name", "Enter the name for the new commander", alite.getPlayer().getName(), this, new TextCallback() {
@Override
public void onOk(String text) {
String fileName;
Expand All @@ -98,7 +98,7 @@ public void onOk(String text) {
pendingMessage = "Commander " + text + " saved successfully.";
confirmedSave = true;
}

@Override
public void onCancel() {
}
Expand All @@ -119,39 +119,39 @@ public void onCancel() {
alite.getFileUtils().saveCommander(alite, selectedCommanderData.get(0).getName(), selectedCommanderData.get(0).getFileName());
setMessage("Commander " + selectedCommanderData.get(0).getName() + " saved successfully.");
SoundManager.play(Assets.alert);
confirmedSave = true;
confirmedSave = true;
} catch (IOException e) {
setMessage("Error while saving commander " + selectedCommanderData.get(0).getName() + ": " + e.getMessage());
}
}
}
clearSelection();
messageResult = 0;
}
}
}

@Override
public void present(float deltaTime) {
public void present(float deltaTime) {
if (disposed) {
return;
}
super.present(deltaTime);
Graphics g = game.getGraphics();
saveNewCommanderButton.render(g);
}

@Override
public void pause() {
super.pause();
}

@Override
public void resume() {
super.resume();
}
}

@Override
public int getScreenCode() {
return ScreenCodes.SAVE_SCREEN;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ public void getNextShip() {
else if (currentShip instanceof WolfMkII) currentShip = new Gopher(a); // Textur fehlt
else if (currentShip instanceof Gopher) currentShip = new Coral(a); // Ok
else if (currentShip instanceof Coral) currentShip = new Bushmaster(a); // Invertiert!
else if (currentShip instanceof Bushmaster) currentShip = new Rattlesnake(a); // Schönes Teil
else if (currentShip instanceof Bushmaster) currentShip = new Rattlesnake(a); // Schones Teil
else if (currentShip instanceof Rattlesnake) currentShip = new Mussurana(a); // Invertiert?!
else if (currentShip instanceof Mussurana) currentShip = new Dugite(a); //Invertiert? Schön!
else if (currentShip instanceof Mussurana) currentShip = new Dugite(a); //Invertiert? Schon!
else if (currentShip instanceof Dugite) currentShip = new Yellowbelly(a); //Ok. Auch invertiert?
else if (currentShip instanceof Yellowbelly) currentShip = new Indigo(a); // Yay!!
else if (currentShip instanceof Indigo) currentShip = new Harlequin(a); // Yeaah!!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public void present(float deltaTime) {
}
centerTextWide(currentShip.getName(), 80, Assets.titleFont, AliteColors.get().shipTitle());
g.drawText("Alite is inspired by classic Elite", 1450, 1020, AliteColors.get().mainText(), Assets.smallFont);
g.drawText("© Acornsoft, Bell & Braben", 1450, 1050, AliteColors.get().mainText(), Assets.smallFont);
g.drawText("\u00a9 Acornsoft, Bell & Braben", 1450, 1050, AliteColors.get().mainText(), Assets.smallFont);
debugExhausts();
((Alite) game).getTextureManager().setTexture(null);
yesButton.render(g);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void drawInformation(final Graphics g) {
}
g.drawText(player.getCondition().getName(), 400, 230, player.getCondition().getColor(), Assets.regularFont);
g.drawText(player.getLegalStatus().getName(), 400, 270, AliteColors.get().legalStatus(), Assets.regularFont);
g.drawText(player.getRating().getName(), 400, 310, AliteColors.get().rating(), Assets.regularFont);
g.drawText(player.getRating().getName() + " - " + player.getScore(), 400, 310, AliteColors.get().rating(), Assets.regularFont);
g.drawText(String.format("%d.%d Light Years", player.getCobra().getFuel() / 10, player.getCobra().getFuel() % 10), 400, 350, AliteColors.get().remainingFuel(), Assets.regularFont);
g.drawText(String.format("%d.%d Credits", player.getCash() / 10, player.getCash() % 10), 400, 390, AliteColors.get().balance(), Assets.regularFont);
if (!player.getActiveMissions().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public class ControlOptionsScreen extends OptionsScreen {
private Button laserAutoFire;
private Button radarTapZoom;
private Button autoId;
private Button buttonPositionOptions;
private Button reverseDiveClimb;
private Button flatButtons;
private Button buttonPositionOptions;
private Button reverseDiveClimb;
private Button flatButtons;

private Button back;
private boolean forwardToIntroduction;
Expand All @@ -68,7 +68,7 @@ public void activate() {
autoId = createSmallButton(2, true, "Auto Id: " + (Settings.autoId ? "On" : "Off"));
buttonPositionOptions = createSmallButton(2, false, "Configure Button Positions");
buttonPositionOptions.setVisible(!forwardToIntroduction);
dockingSpeed = createSmallButton(3, true, "Docking Computer: " + (Settings.dockingComputerFast ? "Fast" : "Slow"));
dockingSpeed = createSmallButton(3, true, "Docking Computer: " + (Settings.dockingComputerFast ? "Fast" : (Settings.dockingComputerMed ? "Medium" : "Slow")));
keyboardLayout = createSmallButton(3, false, "Keyboard: " + Settings.keyboardLayout);

laserAutoFire = createSmallButton(4, true, "Laser: " + (Settings.laserButtonAutofire ? "Auto Fire" : "Single Shot"));
Expand Down Expand Up @@ -169,8 +169,15 @@ protected void processTouch(TouchEvent touch) {
Settings.save(game.getFileIO());
} else if (dockingSpeed.isTouched(touch.x, touch.y)) {
SoundManager.play(Assets.click);
Settings.dockingComputerFast = !Settings.dockingComputerFast;
dockingSpeed.setText("Docking Computer: " + (Settings.dockingComputerFast ? "Fast" : "Slow"));
if(Settings.dockingComputerFast) {
Settings.dockingComputerFast = false;
Settings.dockingComputerMed = true;
} else if(Settings.dockingComputerMed) {
Settings.dockingComputerMed = false;
} else {
Settings.dockingComputerFast = true;
}
dockingSpeed.setText("Docking Computer: " + (Settings.dockingComputerFast ? "Fast" : (Settings.dockingComputerMed ? "Medium" : "Slow")));
Settings.save(game.getFileIO());
} else if (laserAutoFire.isTouched(touch.x, touch.y)) {
SoundManager.play(Assets.click);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ public void execute(float deltaTime) {
// ALSO wird _AUCH_ (!) der Destruction Callback serialisiert.
// DER wiederum muss die Referenz auf die TutorialLine halten --- was knallt, weil
// die nicht serializable ist.
// LÖSUNG: Vor dem write Object die destruction Callbacks der Targets löschen...
// LOSUNG: Vor dem write Object die destruction Callbacks der Targets loschen...
if (target2.getDestructionCallbacks().isEmpty()) {
target2.addDestructionCallback(new DestructionCallback() {
transient TutorialLine tLine = line;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class AboutScreen extends GlScreen {
"[ 602.0y]Steven Phillips\n" +

"[2501.5y]Alite is inspired by classic Elite\n" +
"[ 601.5y]© Acornsoft, Bell & Braben\n" +
"[ 601.5y]\u00a9 Acornsoft, Bell & Braben\n" +

"[2501.5w]Intro Movie\n" +
"[1001.5w]Production, Modeling, Rendering\n" +
Expand Down Expand Up @@ -145,7 +145,7 @@ public class AboutScreen extends GlScreen {
"[ 902.0y]Giles Williams\n" +
"[ 902.0y]Jens Ayton\n" +
"[ 902.0y]Clym Angus\n" +
"[ 902.0y]Marko Susimetsä\n" +
"[ 902.0y]Marko Susimets\u00e4\n" +
"[ 902.0y]ADCK\n" +
"[ 902.0y]Captain Beatnik\n" +
"[ 902.0y]DeepSpace\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
import de.phbouillon.android.games.alite.Alite;
import de.phbouillon.android.games.alite.AliteLog;
import de.phbouillon.android.games.alite.Assets;
import de.phbouillon.android.games.alite.Settings;
import de.phbouillon.android.games.alite.SoundManager;
import de.phbouillon.android.games.alite.model.PlayerCobra;
import de.phbouillon.android.games.alite.screens.opengl.objects.AliteObject;
import de.phbouillon.android.games.alite.screens.opengl.objects.space.AIState;
import de.phbouillon.android.games.alite.screens.opengl.objects.space.AiStateCallback;
Expand Down Expand Up @@ -148,6 +150,9 @@ final void engage() {
active = true;
inGame.setPlayerControl(false);
dcaUpdater.orientationFound = false;
if (Settings.dockingComputerMed) {
alite.setTimeFactor(PlayerCobra.SPEED_UP_FACTOR);
}
if (Assets.danube == null) {
Assets.danube = alite.getAudio().newMusic("music/blue_danube.ogg", Sound.SoundType.MUSIC);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,10 @@ public void performUpdate(float deltaTime) {
performScreenChange(newScreen);
} else {
if (star != null) {
star.applyDeltaRotation(0.0f, (float) Math.toDegrees(0.02f * deltaTime), 0.0f);
star.applyDeltaRotation(0.0f, (float) Math.toDegrees(0.02f * dtf), 0.0f);
}
if (planet != null) {
planet.applyDeltaRotation(0.0f, (float) Math.toDegrees(0.015f * deltaTime), 0.0f);
planet.applyDeltaRotation(0.0f, (float) Math.toDegrees(0.015f * dtf), 0.0f);
}

if (spaceStation != null) {
Expand Down
Loading

0 comments on commit 2635bde

Please sign in to comment.