Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Spikatrix committed Sep 10, 2020
2 parents 4b199b6 + 1924837 commit 0cdd83c
Show file tree
Hide file tree
Showing 65 changed files with 1,441 additions and 743 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
overwrite: true
prerelease: true
release_name: "Zoned Developer Build"
body: "Latest bleeding edge version of Zoned. Might be buggy"
body: "Latest bleeding edge version of Zoned"

- name: Upload apk release
uses: kittaakos/upload-release-action@GH-26
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Zoned   [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Version: 0.0.2-beta](https://img.shields.io/badge/version-0.0.2--beta-orange)](https://github.com/Spikatrix/Zoned/releases/tag/v0.0.2-beta)
# Zoned   [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![Version: 0.0.3-dev](https://img.shields.io/badge/version-0.0.3--dev-orange)](https://github.com/Spikatrix/Zoned/releases/tag/v0.0.3-dev)

<img src="https://i.stack.imgur.com/cunrq.png" alt="Zoned Icon" align="left" style="margin: 10px 20px 10px 10px; border-radius: 20%; box-shadow: 0 6px 20px 2px black" height="162px">

Expand Down
Binary file removed android/assets/fonts/austere.otf
Binary file not shown.
Binary file added android/assets/fonts/recharge.otf
Binary file not shown.
Binary file modified android/assets/icons/ic_libgdx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/assets/icons/ic_loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions android/assets/neon-skin/neon-ui.atlas
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ select-box-pressed
orig: 52, 42
offset: 0, 0
index: -1
select-box-disabled
rotate: false
xy: 263, 164
size: 52, 42
split: 18, 22, 14, 22
pad: 15, 23, 14, 14
orig: 52, 42
offset: 0, 0
index: -1
slider
rotate: false
xy: 228, 341
Expand Down
35 changes: 20 additions & 15 deletions android/assets/neon-skin/neon-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@
"name": "select-box-pressed",
"color": "color"
},
"select-box-disabled-c": {
"name": "select-box-disabled",
"color": "color"
},
"slider-before-c": {
"name": "slider-before",
"color": "color"
Expand Down Expand Up @@ -247,7 +251,7 @@
"checkboxOn": "checkbox-pressed-c",
"checkboxOff": "checkbox-c",
"checkboxOver": "checkbox-over-c",
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"downFontColor": "text-selected",
"checkedFontColor": "text-selected"
Expand All @@ -256,7 +260,7 @@
"checkboxOn": "radio-pressed-c",
"checkboxOff": "radio-c",
"checkboxOver": "radio-over-c",
"font": "regular-font",
"font": "regular",
"fontColor": "custom-color",
"downFontColor": "selected",
"checkedFontColor": "text-themed"
Expand All @@ -271,7 +275,7 @@
},
"com.badlogic.gdx.scenes.scene2d.ui.ImageTextButton$ImageTextButtonStyle": {
"default": {
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"downFontColor": "text-selected",
"up": "button-c",
Expand All @@ -284,7 +288,7 @@
"imageOver": "checkbox-over-c",
"imageChecked": "checkbox-pressed-c",
"imageCheckedOver": "checkbox-pressed-over-c",
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"downFontColor": "text-selected",
"checkedFontColor": "text-selected"
Expand All @@ -295,25 +299,25 @@
"imageOver": "radio-over-c",
"imageChecked": "radio-pressed-c",
"imageCheckedOver": "radio-over-c",
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"downFontColor": "text-selected",
"checkedFontColor": "text-selected"
}
},
"com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle": {
"default": {
"font": "regular-font",
"font": "regular",
"fontColor": "text"
},
"themed": {
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed"
}
},
"com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle": {
"default": {
"font": "regular-font",
"font": "regular",
"fontColorSelected": "selected",
"fontColorUnselected": "text-themed",
"selection": "color",
Expand Down Expand Up @@ -342,12 +346,13 @@
},
"com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle": {
"default": {
"font": "regular-font",
"font": "regular",
"background": "select-box-c",
"scrollStyle": "default",
"listStyle": "default",
"backgroundOver": "select-box-over-c",
"backgroundOpen": "select-box-pressed-c"
"backgroundOpen": "select-box-pressed-c",
"backgroundDisabled": "select-box-disabled-c"
}
},
"com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle": {
Expand Down Expand Up @@ -376,7 +381,7 @@
},
"com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle": {
"default": {
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"downFontColor": "text-selected",
"up": "button-c",
Expand All @@ -386,23 +391,23 @@
},
"com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle": {
"default": {
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"background": "textfield-c",
"focusedBackground": "textfield-selected-c",
"cursor": "color",
"selection": "selected"
},
"login": {
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"background": "textfield-login-c",
"focusedBackground": "textfield-login-selected-c",
"cursor": "color",
"selection": "selected"
},
"password": {
"font": "regular-font",
"font": "regular",
"fontColor": "text-themed",
"background": "textfield-password-c",
"focusedBackground": "textfield-password-selected-c",
Expand Down Expand Up @@ -432,7 +437,7 @@
"com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle": {
"default": {
"background": "window-c",
"titleFont": "regular-font",
"titleFont": "regular",
"titleFontColor": "text-themed"
}
}
Expand Down
Binary file modified android/assets/neon-skin/neon-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ android {
minSdkVersion 14
targetSdkVersion 29
versionCode 2
versionName "0.0.2-beta"
versionName "0.0.3-dev"
// Remember to update the GAME_VERSION in Constants.java
// And project.setVersion in Desktop's build.gradle
// And the version in the badge in the README file
// Or for Linux users, use the versionUpdate.sh script

setProperty("archivesBaseName", "${appName}-${versionName}")
}
buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion android/src/com/cg/zoned/AndroidLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ private void startGame() {
config.useCompass = false;
config.hideStatusBar = true;
config.useImmersiveMode = true;
initialize(new Zoned(), config);
initialize(new Zoned(null), config); // Discord RPC is not available on Android, hence null
}
}
14 changes: 4 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'org.wisepersist:gwt-gradle-plugin:1.0.9'
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:3.6.3' // Updating this might break shit so meh
}
}

Expand All @@ -20,11 +20,7 @@ allprojects {
version = '1.0'
ext {
appName = "Zoned"
gdxVersion = '1.9.10'
roboVMVersion = '2.3.6'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'
aiVersion = '1.8.0'
gdxVersion = '1.9.10' // Should I update? Hmm
pieMenuVersion = '4.2.0'
}

Expand Down Expand Up @@ -75,7 +71,7 @@ project(":android") {
}
}

// No HTML support since the game uses Kryonet which isn't supported there
// No HTML support since the game uses Kryonet and generated FreeTypeFonts which isn't supported there
/*project(":html") {
apply plugin: "gwt"
apply plugin: "war"
Expand All @@ -98,9 +94,7 @@ project(":core") {

api "com.esotericsoftware:kryonet:2.22.0-RC1"
api "com.github.payne911:PieMenu:$pieMenuVersion"
// Pie menu depends on ShapeDrawer, so that'll get imported as well

implementation files("libs/discord-rpc.jar")
// Piemenu depends on ShapeDrawer, so that'll get imported as well
}
}

Expand Down
31 changes: 31 additions & 0 deletions core/src/com/cg/zoned/Assets.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,35 @@ public void setAssetManager(AssetManager assetManager) {
public void dispose() {
assetManager.dispose();
}

// TODO: The default font size is way too big (really noticeable on mobile screens)
public enum FontManager {
STYLED_LARGE ("recharge.otf", 65),
STYLED_SMALL ("recharge.otf", 24),
REGULAR ("glametrix.otf", 32), // Default font, required to be named as 'REGULAR'
SMALL ("bebasneue.otf", 18),
PLAYER_LABEL_NOSCALE("bebasneue.otf",
(int) (Map.playerLabelRegionScale * (Constants.CELL_SIZE - (2 * Constants.MAP_GRID_LINE_WIDTH))));
// Player label font height is based on cell size minus a bit of line width as calculated above

private String fontFileName;
private int fontSize;

FontManager(String fontFileName, int fontSize) {
this.fontFileName = fontFileName;
this.fontSize = fontSize;
}

public int getFontSize() {
return fontSize;
}

public String getFontName() {
return this.toString().toLowerCase();
}

public String getFontFileName() {
return fontFileName;
}
}
}
54 changes: 11 additions & 43 deletions core/src/com/cg/zoned/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.util.Map;

public final class Constants {
public static final String GAME_VERSION = "0.0.2-beta";
public static final String GAME_VERSION = "0.0.3-dev";
// Remember to update the versionName in Android's build.gradle
// And project.setVersion in Desktop's build.gradle
// And the version in the badge in the README file
Expand Down Expand Up @@ -57,7 +57,7 @@ public final class Constants {
*/
public static final Map<String, Color> PLAYER_COLORS = new LinkedHashMap<String, Color>() {
{
put("GREEN", new Color(0, 0.8f, 0, 1.0f));
put("GREEN", new Color(0, 0.8f, 0, 1.0f)); // Alpha won't matter
put("RED", new Color(0.8f, 0, 0, 1.0f));
put("BLUE", new Color(0, 0, 0.8f, 1.0f));
put("YELLOW", new Color(0.8f, 0.8f, 0, 1.0f));
Expand Down Expand Up @@ -86,49 +86,17 @@ public final class Constants {

public static final float DESKTOP_FONT_SCALE_FACTOR = 1.0f;
// Values from https://developer.android.com/training/multiscreen/screendensities
public static final float ANDROID_LDPI_FONT_SCALE_FACTOR = 0.75f;
public static final float ANDROID_MDPI_FONT_SCALE_FACTOR = 1.0f;
public static final float ANDROID_HDPI_FONT_SCALE_FACTOR = 1.5f;
public static final float ANDROID_XHDPI_FONT_SCALE_FACTOR = 2.0f;
public static final float ANDROID_XXHDPI_FONT_SCALE_FACTOR = 3.0f;
public static final float ANDROID_LDPI_FONT_SCALE_FACTOR = 0.75f;
public static final float ANDROID_MDPI_FONT_SCALE_FACTOR = 1.0f;
public static final float ANDROID_HDPI_FONT_SCALE_FACTOR = 1.5f;
public static final float ANDROID_XHDPI_FONT_SCALE_FACTOR = 2.0f;
public static final float ANDROID_XXHDPI_FONT_SCALE_FACTOR = 3.0f;
public static final float ANDROID_XXXHDPI_FONT_SCALE_FACTOR = 4.0f;

public static final String LOG_TAG = "ZONED";

public static final String ZONED_PREFERENCES = "Zoned_Preferences";
public static final String FPS_PREFERENCE = "FPS_Preference";
public static final String CONTROL_PREFERENCE = "Control_Preference";
public static final String NAME_PREFERENCE = "Name_Preference"; // The last used name
public static final String SHOW_TUTORIAL_PREFERENCE = "Show_Tutorial_Preference"; // Shows the tutorial dialog prompt the first time
public static final String SPLITSCREEN_PLAYER_COUNT_PREFERENCE = "Splitscreen_Player_Count_Preference";
public static final String MAP_START_POS_SPLITSCREEN_COUNT_PREFERENCE = "Map_Start_Pos_Splitscreen_Count_Preference";
public static final String DEV_MODE_PREFERENCE = "Dev_Mode_Preference";

public static final int PIE_MENU_CONTROL = 0;
public static final int FLING_CONTROL = 1;

public enum Direction {UP, LEFT, DOWN, RIGHT}

public enum FONT_MANAGER {
LARGE("large-font", 80),
REGULAR("regular-font", 32),
SMALL("small-font", 18),
PLAYER_LABEL("player-label-font-noscale", 20);

private String name;
private int size;

FONT_MANAGER(String name, int size) {
this.name = name;
this.size = size;
}

public int getSize() {
return size;
}

public String getName() {
return name;
}
}
// Preferences moved to Preferences.java
// Directions moved to Player.java
// Controls moved to managers/ControlManager.java
// Fonts moved to Assets.java
}
13 changes: 13 additions & 0 deletions core/src/com/cg/zoned/GameMode.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.cg.zoned;

public class GameMode {
public String previewLocation;
public String name;
public Class targetClass;

public GameMode(String name, String previewLocation, Class targetClass) {
this.name = name;
this.previewLocation = previewLocation;
this.targetClass = targetClass;
}
}
6 changes: 4 additions & 2 deletions core/src/com/cg/zoned/KryoHelper.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
package com.cg.zoned;

import com.cg.zoned.Constants.Direction;
import com.cg.zoned.Player.Direction;
import com.cg.zoned.buffers.BufferClientConnect;
import com.cg.zoned.buffers.BufferDirections;
import com.cg.zoned.buffers.BufferGameStart;
import com.cg.zoned.buffers.BufferMapData;
import com.cg.zoned.buffers.BufferNewMap;
import com.cg.zoned.buffers.BufferPlayerData;
import com.cg.zoned.buffers.BufferPlayerDisconnected;
import com.cg.zoned.buffers.BufferServerRejectedConnection;
import com.esotericsoftware.kryo.Kryo;

public class KryoHelper {

public static void registerClasses(Kryo kryo) {
kryo.register(BufferServerRejectedConnection.class);
kryo.register(BufferPlayerDisconnected.class);
kryo.register(BufferClientConnect.class);
kryo.register(BufferPlayerData.class);
kryo.register(BufferDirections.class);
kryo.register(BufferGameStart.class);
kryo.register(BufferMapData.class);
kryo.register(BufferNewMap.class);
kryo.register(Direction[].class);
kryo.register(Direction.class);
kryo.register(String[].class);
kryo.register(byte[].class);
kryo.register(int[].class);
}
}
Loading

0 comments on commit 0cdd83c

Please sign in to comment.