Updated Libgdx to a newer version to add gui to the game. This sadly broke the player sprite :/
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
84
build.gradle
@@ -1,84 +1,44 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url "https://plugins.gradle.org/m2/" }
|
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
||||||
jcenter()
|
|
||||||
google()
|
google()
|
||||||
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
||||||
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
apply plugin: "eclipse"
|
apply plugin: 'eclipse'
|
||||||
|
apply plugin: 'idea'
|
||||||
version = '1.0'
|
|
||||||
ext {
|
|
||||||
appName = "my-gdx-game"
|
|
||||||
gdxVersion = '1.9.11-SNAPSHOT'
|
|
||||||
roboVMVersion = '2.3.8'
|
|
||||||
box2DLightsVersion = '1.4'
|
|
||||||
ashleyVersion = '1.7.0'
|
|
||||||
aiVersion = '1.8.0'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configure(subprojects) {
|
||||||
|
apply plugin: 'java-library'
|
||||||
|
sourceCompatibility = 8.0
|
||||||
|
compileJava {
|
||||||
|
options.incremental = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subprojects {
|
||||||
|
version = '0.0.1-SNAPSHOT'
|
||||||
|
ext.appName = 'Collevtor'
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
jcenter()
|
jcenter()
|
||||||
google()
|
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project(":desktop") {
|
// Clearing Eclipse project data in root folder:
|
||||||
apply plugin: "java-library"
|
tasks.eclipse.doLast {
|
||||||
|
delete '.project'
|
||||||
|
delete '.classpath'
|
||||||
dependencies {
|
delete '.settings/'
|
||||||
implementation project(":core")
|
|
||||||
api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
|
||||||
api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
|
|
||||||
api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
|
||||||
api "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-desktop"
|
|
||||||
api "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop"
|
|
||||||
api "de.tomgrill.gdxdialogs:gdx-dialogs-desktop:1.2.5"
|
|
||||||
compile "org.mini2Dx:universal-tween-engine:6.3.3"
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project(":core") {
|
|
||||||
apply plugin: "java-library"
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
api "com.badlogicgames.gdx:gdx:$gdxVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"
|
|
||||||
api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
|
|
||||||
api "com.badlogicgames.ashley:ashley:$ashleyVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
|
|
||||||
api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
|
|
||||||
api "com.esotericsoftware.spine:spine-libgdx:3.6.53.1"
|
|
||||||
api "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:0.1.0"
|
|
||||||
api "com.kotcrab.vis:vis-ui:1.3.0"
|
|
||||||
api "net.dermetfan.libgdx-utils:libgdx-utils:0.13.4"
|
|
||||||
api "net.dermetfan.libgdx-utils:libgdx-utils-box2d:0.13.4"
|
|
||||||
api "de.tomgrill.gdxdialogs:gdx-dialogs-core:1.2.5"
|
|
||||||
api "com.github.czyzby:gdx-kiwi:1.9.1.9.6"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,23 @@
|
|||||||
apply plugin: "java"
|
|
||||||
|
|
||||||
sourceCompatibility = 1.7
|
|
||||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||||
|
eclipse.project.name = appName + '-core'
|
||||||
|
|
||||||
sourceSets.main.java.srcDirs = [ "src/" ]
|
dependencies {
|
||||||
|
api "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||||
eclipse.project.name = appName + "-core"
|
api "com.badlogicgames.gdx:gdx-ai:$aiVersion"
|
||||||
|
api "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
|
||||||
|
api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
|
||||||
|
api "com.badlogicgames.ashley:ashley:$ashleyVersion"
|
||||||
|
api "com.badlogicgames.box2dlights:box2dlights:$box2dlightsVersion"
|
||||||
|
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
||||||
|
api "com.badlogicgames.gdx:gdx-bullet:$gdxVersion"
|
||||||
|
api "com.github.czyzby:noise4j:$noise4jVersion"
|
||||||
|
api "com.github.ykrasik:jaci-libgdx-cli-gwt:$jaciGwtVersion"
|
||||||
|
api "com.sudoplay.joise:joise:$joiseVersion"
|
||||||
|
api "com.github.czyzby:gdx-kiwi:$kiwiVersion"
|
||||||
|
api "de.tomgrill.gdxdialogs:gdx-dialogs-core:$dialogsVersion"
|
||||||
|
api "com.strongjoshua:libgdx-inGameConsole:$inGameConsoleVersion"
|
||||||
|
api "net.dermetfan.libgdx-utils:libgdx-utils:$utilsVersion"
|
||||||
|
api "net.dermetfan.libgdx-utils:libgdx-utils-box2d:$utilsBox2dVersion"
|
||||||
|
api "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:$overlap2dVersion"
|
||||||
|
api "com.github.ykrasik:jaci-libgdx-cli-java:$jaciVersion"
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
package com.mygdx.game.Dimension;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
|
||||||
|
|
||||||
public class Block {
|
|
||||||
private String name;
|
|
||||||
private Texture texture;
|
|
||||||
private Boolean harvestable;
|
|
||||||
private Boolean breakable;
|
|
||||||
private Boolean passable;
|
|
||||||
|
|
||||||
public Block(String name) {
|
|
||||||
this.name = name;
|
|
||||||
this.texture = new Texture("core/assets/" + name + ".png");
|
|
||||||
this.harvestable = true;
|
|
||||||
this.breakable = true;
|
|
||||||
this.passable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Texture getTexture() {
|
|
||||||
return texture;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTexture(Texture texture) {
|
|
||||||
this.texture = texture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
package com.mygdx.game;
|
|
||||||
|
|
||||||
public class Storage {
|
|
||||||
}
|
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
package com.mygdx.game.Character;
|
package Collector.Character;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.Input;
|
import com.badlogic.gdx.Input;
|
||||||
import com.badlogic.gdx.graphics.g2d.Animation;
|
import com.badlogic.gdx.graphics.g2d.Animation;
|
||||||
import com.badlogic.gdx.math.Vector3;
|
import com.badlogic.gdx.math.Vector3;
|
||||||
import com.mygdx.game.Dimension.Chunks;
|
import Collector.Dimension.Chunks;
|
||||||
import com.mygdx.game.Restrictions;
|
import Collector.Restrictions;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import static com.mygdx.game.Main.cam;
|
import static Collector.Main.cam;
|
||||||
|
|
||||||
public class InputController implements Restrictions {
|
public class InputController implements Restrictions {
|
||||||
|
|
||||||
private Player player;
|
private final Player player;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
private final HashMap<String, Animation<com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion>> animations;
|
private final HashMap<String, Animation<com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion>> animations;
|
||||||
|
|
||||||
public InputController(Player player) {
|
public InputController(Player player) {
|
||||||
|
this.player = player;
|
||||||
animations = new HashMap<>();
|
animations = new HashMap<>();
|
||||||
|
/*
|
||||||
animations.put("Up", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "Up")));
|
animations.put("Up", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "Up")));
|
||||||
animations.put("UpRight", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "UpRight")));
|
animations.put("UpRight", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "UpRight")));
|
||||||
animations.put("UpLeft", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "UpLeft")));
|
animations.put("UpLeft", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "UpLeft")));
|
||||||
@@ -28,7 +30,7 @@ public class InputController implements Restrictions {
|
|||||||
animations.put("Left", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "Left")));
|
animations.put("Left", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "Left")));
|
||||||
animations.put("Right", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "Right")));
|
animations.put("Right", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "Right")));
|
||||||
|
|
||||||
this.player = player;
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleInput() {
|
public void handleInput() {
|
||||||
@@ -59,28 +61,28 @@ public class InputController implements Restrictions {
|
|||||||
|
|
||||||
if (Gdx.input.isKeyPressed(Input.Keys.W) && Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) {
|
if (Gdx.input.isKeyPressed(Input.Keys.W) && Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("UpLeft");
|
//player.setAnimation(animations.get("UpLeft"));
|
||||||
Player.addX(-MOVEMENT_SPEED);
|
Player.addX(-MOVEMENT_SPEED);
|
||||||
Player.addY(MOVEMENT_SPEED);
|
Player.addY(MOVEMENT_SPEED);
|
||||||
cam.translate(-MOVEMENT_SPEED, MOVEMENT_SPEED);
|
cam.translate(-MOVEMENT_SPEED, MOVEMENT_SPEED);
|
||||||
}
|
}
|
||||||
else if (Gdx.input.isKeyPressed(Input.Keys.W) && Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) {
|
else if (Gdx.input.isKeyPressed(Input.Keys.W) && Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("UpRight");
|
//player.setAnimation(animations.get("UpRight"));
|
||||||
Player.addX(MOVEMENT_SPEED);
|
Player.addX(MOVEMENT_SPEED);
|
||||||
Player.addY(MOVEMENT_SPEED);
|
Player.addY(MOVEMENT_SPEED);
|
||||||
cam.translate(MOVEMENT_SPEED, MOVEMENT_SPEED);
|
cam.translate(MOVEMENT_SPEED, MOVEMENT_SPEED);
|
||||||
}
|
}
|
||||||
else if (Gdx.input.isKeyPressed(Input.Keys.S) && Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) {
|
else if (Gdx.input.isKeyPressed(Input.Keys.S) && Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("DownLeft");
|
//player.setAnimation(animations.get("DownLeft"));
|
||||||
Player.addX(-MOVEMENT_SPEED);
|
Player.addX(-MOVEMENT_SPEED);
|
||||||
Player.addY(-MOVEMENT_SPEED);
|
Player.addY(-MOVEMENT_SPEED);
|
||||||
cam.translate(-MOVEMENT_SPEED, -MOVEMENT_SPEED);
|
cam.translate(-MOVEMENT_SPEED, -MOVEMENT_SPEED);
|
||||||
}
|
}
|
||||||
else if (Gdx.input.isKeyPressed(Input.Keys.S) && Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) {
|
else if (Gdx.input.isKeyPressed(Input.Keys.S) && Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("DownRight");
|
//player.setAnimation(animations.get("DownRight"));
|
||||||
Player.addX(MOVEMENT_SPEED);
|
Player.addX(MOVEMENT_SPEED);
|
||||||
Player.addY(-MOVEMENT_SPEED);
|
Player.addY(-MOVEMENT_SPEED);
|
||||||
|
|
||||||
@@ -88,33 +90,29 @@ public class InputController implements Restrictions {
|
|||||||
}
|
}
|
||||||
else if (Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) {
|
else if (Gdx.input.isKeyPressed(Input.Keys.A) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("Left");
|
//player.setAnimation(animations.get("Left"));
|
||||||
Player.addX(-MOVEMENT_SPEED);
|
Player.addX(-MOVEMENT_SPEED);
|
||||||
cam.translate(-MOVEMENT_SPEED, 0);
|
cam.translate(-MOVEMENT_SPEED, 0);
|
||||||
}
|
}
|
||||||
else if (Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) {
|
else if (Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("Right");
|
//player.setAnimation(animations.get("Right"));
|
||||||
Player.addX(MOVEMENT_SPEED);
|
Player.addX(MOVEMENT_SPEED);
|
||||||
cam.translate(MOVEMENT_SPEED, 0);
|
cam.translate(MOVEMENT_SPEED, 0);
|
||||||
}
|
}
|
||||||
else if (Gdx.input.isKeyPressed(Input.Keys.S) && i > KEY_DELAY) {
|
else if (Gdx.input.isKeyPressed(Input.Keys.S) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("Down");
|
//player.setAnimation(animations.get("Down"));
|
||||||
Player.addY(-MOVEMENT_SPEED);
|
Player.addY(-MOVEMENT_SPEED);
|
||||||
cam.translate(0, -MOVEMENT_SPEED);
|
cam.translate(0, -MOVEMENT_SPEED);
|
||||||
}
|
}
|
||||||
if (Gdx.input.isKeyPressed(Input.Keys.W) && i > KEY_DELAY) {
|
if (Gdx.input.isKeyPressed(Input.Keys.W) && i > KEY_DELAY) {
|
||||||
i = 0;
|
i = 0;
|
||||||
directionAnimation("Up");
|
//player.setAnimation(animations.get("Up"));
|
||||||
Player.addY(MOVEMENT_SPEED);
|
Player.addY(MOVEMENT_SPEED);
|
||||||
|
|
||||||
cam.translate(0, MOVEMENT_SPEED);
|
cam.translate(0, MOVEMENT_SPEED);
|
||||||
}
|
}
|
||||||
cam.update();
|
cam.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void directionAnimation(String direction) {
|
|
||||||
player.setAnimation(animations.get(direction));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,24 +1,22 @@
|
|||||||
package com.mygdx.game.Character;
|
package Collector.Character;
|
||||||
|
|
||||||
|
import Collector.Main;
|
||||||
|
import Collector.Restrictions;
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.math.Vector3;
|
import com.badlogic.gdx.math.Vector3;
|
||||||
import com.mygdx.game.Restrictions;
|
|
||||||
|
|
||||||
import static com.mygdx.game.Main.cam;
|
|
||||||
|
|
||||||
public class Mouse implements Restrictions {
|
public class Mouse implements Restrictions {
|
||||||
Texture crosshair;
|
Texture crosshair;
|
||||||
|
|
||||||
public Mouse() {
|
public Mouse() {
|
||||||
this.crosshair = new Texture("core/assets/crosshair.png");
|
this.crosshair = new Texture("assets/crosshair.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void selectedTile(SpriteBatch batch) {
|
public void selectedTile(SpriteBatch batch) {
|
||||||
Vector3 mousePos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);
|
Vector3 mousePos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);
|
||||||
cam.unproject(mousePos);
|
Main.cam.unproject(mousePos);
|
||||||
int x = getSelectedX(mousePos);
|
int x = getSelectedX(mousePos);
|
||||||
int y = getSelectedY(mousePos);
|
int y = getSelectedY(mousePos);
|
||||||
batch.draw(crosshair, x, y);
|
batch.draw(crosshair, x, y);
|
||||||
@@ -32,20 +30,9 @@ public class Mouse implements Restrictions {
|
|||||||
return ((int)(mousePos.y)>>4)<<4;
|
return ((int)(mousePos.y)>>4)<<4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTileX(OrthographicCamera cam){
|
|
||||||
Vector3 mousePos = new Vector3( Gdx.input.getX(), Gdx.input.getY(),0);
|
|
||||||
cam.unproject(mousePos);
|
|
||||||
return (getSelectedX(mousePos) + Player.getX()>>1)/TILE_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getTileY(OrthographicCamera cam){
|
|
||||||
Vector3 mousePos = new Vector3( Gdx.input.getX(), Gdx.input.getY(),0);
|
|
||||||
cam.unproject(mousePos);
|
|
||||||
return (getSelectedY(mousePos) + Player.getY()>>1)/TILE_SIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void render(SpriteBatch batch) {
|
public void render(SpriteBatch batch) {
|
||||||
selectedTile(batch);
|
selectedTile(batch);
|
||||||
//System.out.println("X = " + getTileX(cam) + " Y = "+ getTileY(cam));
|
//System.out.println("X = " + getTileX(cam) + " Y = "+ getTileY(cam));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,20 @@
|
|||||||
package com.mygdx.game.Character;
|
package Collector.Character;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||||
import com.badlogic.gdx.graphics.g2d.Animation;
|
import com.badlogic.gdx.graphics.g2d.Animation;
|
||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.Sprite;
|
||||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.mygdx.game.Main;
|
import Collector.Restrictions;
|
||||||
import com.mygdx.game.Restrictions;
|
|
||||||
|
|
||||||
public class Player implements Restrictions {
|
public class Player implements Restrictions {
|
||||||
private static int x;
|
public static int x;
|
||||||
private static int y;
|
public static int y;
|
||||||
private OrthographicCamera cam;
|
|
||||||
private final String spriteName;
|
private final String spriteName;
|
||||||
public TextureAtlas textureAtlas;
|
public TextureAtlas textureAtlas;
|
||||||
private Animation<TextureAtlas.AtlasRegion> animation;
|
private Animation<TextureAtlas.AtlasRegion> animation;
|
||||||
|
public static Sprite sprite;
|
||||||
|
|
||||||
public Player(OrthographicCamera cam, int x, int y) {
|
public Player(OrthographicCamera cam, int x, int y) {
|
||||||
Player.x = x<<TILE_SHIFT;
|
Player.x = x<<TILE_SHIFT;
|
||||||
@@ -23,20 +23,11 @@ public class Player implements Restrictions {
|
|||||||
|
|
||||||
spriteName = "man";
|
spriteName = "man";
|
||||||
|
|
||||||
textureAtlas = new TextureAtlas("core/assets/" + spriteName + ".atlas");
|
|
||||||
Array<TextureAtlas.AtlasRegion> keyFrames = textureAtlas.findRegions(spriteName + "_Down");
|
//textureAtlas = new TextureAtlas("man.atlas");
|
||||||
|
//Array<TextureAtlas.AtlasRegion> keyFrames = textureAtlas.findRegions(spriteName + "_Down");
|
||||||
float frameDuration = 1 / 4f;
|
float frameDuration = 1 / 4f;
|
||||||
animation = new Animation<>(frameDuration, keyFrames);
|
//animation = new Animation<>(frameDuration, keyFrames);
|
||||||
}
|
|
||||||
|
|
||||||
public static void teleport(int x, int y){
|
|
||||||
Player.x = x<<TILE_SHIFT;
|
|
||||||
Player.y = y<<TILE_SHIFT;
|
|
||||||
Main.cam.translate(x,y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void render(Batch batch, float timeSinceLastUpdate){
|
|
||||||
batch.draw(getAnimation().getKeyFrame(timeSinceLastUpdate, true), getX(), getY(),TILE_SIZE,TILE_SIZE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getX() {
|
public static int getX() {
|
||||||
@@ -59,6 +50,7 @@ public class Player implements Restrictions {
|
|||||||
return spriteName;
|
return spriteName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public Animation<TextureAtlas.AtlasRegion> getAnimation() {
|
public Animation<TextureAtlas.AtlasRegion> getAnimation() {
|
||||||
return animation;
|
return animation;
|
||||||
}
|
}
|
||||||
@@ -67,4 +59,6 @@ public class Player implements Restrictions {
|
|||||||
animation = animationTemp;
|
animation = animationTemp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
39
core/src/main/java/Collector/Dimension/Block.java
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package Collector.Dimension;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
|
|
||||||
|
public class Block {
|
||||||
|
private final String name;
|
||||||
|
private final Boolean harvestable;
|
||||||
|
private final Boolean breakable;
|
||||||
|
private final Boolean passable;
|
||||||
|
private final Texture texture;
|
||||||
|
|
||||||
|
public Block(String name) {
|
||||||
|
this.name = name;
|
||||||
|
this.texture = new Texture("assets/" + name + ".png");
|
||||||
|
this.harvestable = true;
|
||||||
|
this.breakable = true;
|
||||||
|
this.passable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Texture getTexture() {
|
||||||
|
return texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getPassable() {
|
||||||
|
return passable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getBreakable() {
|
||||||
|
return breakable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getHarvestable() {
|
||||||
|
return harvestable;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mygdx.game.Dimension;
|
package Collector.Dimension;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
//https://www.redblobgames.com/maps/terrain-from-noise/
|
//https://www.redblobgames.com/maps/terrain-from-noise/
|
||||||
package com.mygdx.game.Dimension;
|
package Collector.Dimension;
|
||||||
|
|
||||||
import com.github.czyzby.kiwi.util.tuple.immutable.Pair;
|
import com.github.czyzby.kiwi.util.tuple.immutable.Pair;
|
||||||
import com.github.czyzby.kiwi.util.tuple.immutable.Triple;
|
import com.github.czyzby.kiwi.util.tuple.immutable.Triple;
|
||||||
import com.mygdx.game.OpenSimplexNoise;
|
import Collector.OpenSimplexNoise;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
import static com.mygdx.game.Dimension.BlockMaterials.materials;
|
import static Collector.Dimension.BlockMaterials.materials;
|
||||||
import static com.mygdx.game.Restrictions.*;
|
import static Collector.Restrictions.*;
|
||||||
|
|
||||||
public class Chunks {
|
public class Chunks {
|
||||||
public static HashMap<Triple<Integer, Integer, Integer>, Block> blocks = new HashMap<>();
|
public static HashMap<Triple<Integer, Integer, Integer>, Block> blocks = new HashMap<>();
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.mygdx.game.Dimension;
|
package Collector.Dimension;
|
||||||
|
|
||||||
import com.mygdx.game.Character.Player;
|
import Collector.Character.Player;
|
||||||
|
|
||||||
import static com.mygdx.game.Restrictions.*;
|
import static Collector.Restrictions.*;
|
||||||
|
|
||||||
public class World {
|
public class World {
|
||||||
public static void generateWorld(int x, int y) {
|
public static void generateWorld(int x, int y) {
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
package com.mygdx.game.Dimension;
|
package Collector.Dimension;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.github.czyzby.kiwi.util.tuple.immutable.Triple;
|
import com.github.czyzby.kiwi.util.tuple.immutable.Triple;
|
||||||
import com.mygdx.game.Character.InputController;
|
import Collector.Character.InputController;
|
||||||
import com.mygdx.game.Character.Mouse;
|
import Collector.Character.Mouse;
|
||||||
import com.mygdx.game.Restrictions;
|
import Collector.Restrictions;
|
||||||
|
|
||||||
import static com.mygdx.game.Main.cam;
|
import static Collector.Main.cam;
|
||||||
|
|
||||||
public class WorldRenderer implements Restrictions {
|
public class WorldRenderer implements Restrictions {
|
||||||
private Mouse mouse;
|
private final Mouse mouse;
|
||||||
private InputController inputController;
|
private final InputController inputController;
|
||||||
|
|
||||||
public WorldRenderer(Mouse mouse, InputController inputController) {
|
public WorldRenderer(Mouse mouse, InputController inputController) {
|
||||||
this.mouse = mouse;
|
this.mouse = mouse;
|
||||||
6
core/src/main/java/Collector/Main.gwt.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.2//EN" "http://gwtproject.org/doctype/2.8.2/gwt-module.dtd">
|
||||||
|
<module>
|
||||||
|
<source path="" />
|
||||||
|
|
||||||
|
</module>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mygdx.game;
|
package Collector;
|
||||||
|
|
||||||
import com.badlogic.gdx.ApplicationAdapter;
|
import com.badlogic.gdx.ApplicationAdapter;
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
@@ -6,16 +6,16 @@ import com.badlogic.gdx.graphics.GL30;
|
|||||||
import com.badlogic.gdx.graphics.OrthographicCamera;
|
import com.badlogic.gdx.graphics.OrthographicCamera;
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.utils.viewport.FitViewport;
|
import com.badlogic.gdx.utils.viewport.FitViewport;
|
||||||
import com.mygdx.game.Character.InputController;
|
import Collector.Character.InputController;
|
||||||
import com.mygdx.game.Character.Mouse;
|
import Collector.Character.Mouse;
|
||||||
import com.mygdx.game.Character.Player;
|
import Collector.Character.Player;
|
||||||
import com.mygdx.game.Dimension.BlockMaterials;
|
import Collector.Dimension.BlockMaterials;
|
||||||
import com.mygdx.game.Dimension.Chunks;
|
import Collector.Dimension.Chunks;
|
||||||
import com.mygdx.game.Dimension.World;
|
import Collector.Dimension.World;
|
||||||
import com.mygdx.game.Dimension.WorldRenderer;
|
import Collector.Dimension.WorldRenderer;
|
||||||
import com.mygdx.game.UI.GUI;
|
import Collector.UI.GUI;
|
||||||
|
|
||||||
import static com.mygdx.game.Restrictions.*;
|
import static Collector.Restrictions.*;
|
||||||
|
|
||||||
public class Main extends ApplicationAdapter {
|
public class Main extends ApplicationAdapter {
|
||||||
private SpriteBatch batch;
|
private SpriteBatch batch;
|
||||||
@@ -37,7 +37,7 @@ public class Main extends ApplicationAdapter {
|
|||||||
player = new Player(cam, 0, 0);
|
player = new Player(cam, 0, 0);
|
||||||
fitViewport = new FitViewport(VIEWPORT_WIDTH, VIEWPORT_HEIGHT, cam);
|
fitViewport = new FitViewport(VIEWPORT_WIDTH, VIEWPORT_HEIGHT, cam);
|
||||||
mouse = new Mouse();
|
mouse = new Mouse();
|
||||||
gui = new GUI(mouse,fitViewport);
|
gui = new GUI(fitViewport);
|
||||||
inputController = new InputController(player);
|
inputController = new InputController(player);
|
||||||
worldRenderer = new WorldRenderer(mouse, inputController);
|
worldRenderer = new WorldRenderer(mouse, inputController);
|
||||||
batch = new SpriteBatch();
|
batch = new SpriteBatch();
|
||||||
@@ -55,12 +55,12 @@ public class Main extends ApplicationAdapter {
|
|||||||
public void render () {
|
public void render () {
|
||||||
Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
|
Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
|
|
||||||
timeSinceLastUpdate += Gdx.graphics.getDeltaTime(); //Accumulate delta time
|
timeSinceLastUpdate += Gdx.graphics.getDeltaTime(); //Accumulate delta time
|
||||||
batch.begin();
|
batch.begin();
|
||||||
if(timeSinceLastUpdate > 1/10f){
|
if(timeSinceLastUpdate > 1/10f){
|
||||||
worldRenderer.render(batch);
|
worldRenderer.render(batch);
|
||||||
}
|
}
|
||||||
player.render(batch,timeSinceLastUpdate);
|
|
||||||
|
|
||||||
delta += Gdx.graphics.getDeltaTime();
|
delta += Gdx.graphics.getDeltaTime();
|
||||||
if (delta > RENDER_TIME) {
|
if (delta > RENDER_TIME) {
|
||||||
@@ -69,7 +69,8 @@ public class Main extends ApplicationAdapter {
|
|||||||
World.unloadChunks();
|
World.unloadChunks();
|
||||||
}
|
}
|
||||||
|
|
||||||
gui.render(batch);
|
gui.render();
|
||||||
|
batch.draw(BlockMaterials.materials.get("wood").getTexture(), Player.x, Player.y,TILE_SIZE,TILE_SIZE);
|
||||||
batch.end();
|
batch.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mygdx.game;/*
|
package Collector;/*
|
||||||
* OpenSimplex Noise in Java.
|
* OpenSimplex Noise in Java.
|
||||||
* by Kurt Spencer
|
* by Kurt Spencer
|
||||||
*
|
*
|
||||||
@@ -29,160 +29,56 @@ public class OpenSimplexNoise {
|
|||||||
|
|
||||||
private static final long DEFAULT_SEED = 0;
|
private static final long DEFAULT_SEED = 0;
|
||||||
|
|
||||||
private short[] perm;
|
//Gradients for 2D. They approximate the directions to the
|
||||||
private short[] permGradIndex3D;
|
//vertices of an octagon from the center.
|
||||||
|
private static final byte[] gradients2D = new byte[]{
|
||||||
|
5, 2, 2, 5,
|
||||||
|
-5, 2, -2, 5,
|
||||||
|
5, -2, 2, -5,
|
||||||
|
-5, -2, -2, -5,
|
||||||
|
};
|
||||||
|
//Gradients for 3D. They approximate the directions to the
|
||||||
|
//vertices of a rhombicuboctahedron from the center, skewed so
|
||||||
|
//that the triangular and square facets can be inscribed inside
|
||||||
|
//circles of the same radius.
|
||||||
|
private static final byte[] gradients3D = new byte[]{
|
||||||
|
-11, 4, 4, -4, 11, 4, -4, 4, 11,
|
||||||
|
11, 4, 4, 4, 11, 4, 4, 4, 11,
|
||||||
|
-11, -4, 4, -4, -11, 4, -4, -4, 11,
|
||||||
|
11, -4, 4, 4, -11, 4, 4, -4, 11,
|
||||||
|
-11, 4, -4, -4, 11, -4, -4, 4, -11,
|
||||||
|
11, 4, -4, 4, 11, -4, 4, 4, -11,
|
||||||
|
-11, -4, -4, -4, -11, -4, -4, -4, -11,
|
||||||
|
11, -4, -4, 4, -11, -4, 4, -4, -11,
|
||||||
|
};
|
||||||
|
|
||||||
public OpenSimplexNoise() {
|
public OpenSimplexNoise() {
|
||||||
this(DEFAULT_SEED);
|
this(DEFAULT_SEED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OpenSimplexNoise(short[] perm) {
|
//Gradients for 4D. They approximate the directions to the
|
||||||
this.perm = perm;
|
//vertices of a disprismatotesseractihexadecachoron from the center,
|
||||||
permGradIndex3D = new short[256];
|
//skewed so that the tetrahedral and cubic facets can be inscribed inside
|
||||||
|
//spheres of the same radius.
|
||||||
for (int i = 0; i < 256; i++) {
|
private static final byte[] gradients4D = new byte[]{
|
||||||
//Since 3D has 24 gradients, simple bitmask won't work, so precompute modulo array.
|
3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3,
|
||||||
permGradIndex3D[i] = (short)((perm[i] % (gradients3D.length / 3)) * 3);
|
-3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3,
|
||||||
}
|
3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3,
|
||||||
}
|
-3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3,
|
||||||
|
3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3,
|
||||||
//Initializes the class using a permutation array generated from a 64-bit seed.
|
-3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3,
|
||||||
//Generates a proper permutation (i.e. doesn't merely perform N successive pair swaps on a base array)
|
3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3,
|
||||||
//Uses a simple 64-bit LCG.
|
-3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3,
|
||||||
public OpenSimplexNoise(long seed) {
|
3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3,
|
||||||
perm = new short[256];
|
-3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3,
|
||||||
permGradIndex3D = new short[256];
|
3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3,
|
||||||
short[] source = new short[256];
|
-3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3,
|
||||||
for (short i = 0; i < 256; i++)
|
3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3,
|
||||||
source[i] = i;
|
-3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3,
|
||||||
seed = seed * 6364136223846793005l + 1442695040888963407l;
|
3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3,
|
||||||
seed = seed * 6364136223846793005l + 1442695040888963407l;
|
-3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3,
|
||||||
seed = seed * 6364136223846793005l + 1442695040888963407l;
|
};
|
||||||
for (int i = 255; i >= 0; i--) {
|
private final short[] perm;
|
||||||
seed = seed * 6364136223846793005l + 1442695040888963407l;
|
|
||||||
int r = (int)((seed + 31) % (i + 1));
|
|
||||||
if (r < 0)
|
|
||||||
r += (i + 1);
|
|
||||||
perm[i] = source[r];
|
|
||||||
permGradIndex3D[i] = (short)((perm[i] % (gradients3D.length / 3)) * 3);
|
|
||||||
source[r] = source[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//2D OpenSimplex Noise.
|
|
||||||
public double eval(double x, double y) {
|
|
||||||
|
|
||||||
//Place input coordinates onto grid.
|
|
||||||
double stretchOffset = (x + y) * STRETCH_CONSTANT_2D;
|
|
||||||
double xs = x + stretchOffset;
|
|
||||||
double ys = y + stretchOffset;
|
|
||||||
|
|
||||||
//Floor to get grid coordinates of rhombus (stretched square) super-cell origin.
|
|
||||||
int xsb = fastFloor(xs);
|
|
||||||
int ysb = fastFloor(ys);
|
|
||||||
|
|
||||||
//Skew out to get actual coordinates of rhombus origin. We'll need these later.
|
|
||||||
double squishOffset = (xsb + ysb) * SQUISH_CONSTANT_2D;
|
|
||||||
double xb = xsb + squishOffset;
|
|
||||||
double yb = ysb + squishOffset;
|
|
||||||
|
|
||||||
//Compute grid coordinates relative to rhombus origin.
|
|
||||||
double xins = xs - xsb;
|
|
||||||
double yins = ys - ysb;
|
|
||||||
|
|
||||||
//Sum those together to get a value that determines which region we're in.
|
|
||||||
double inSum = xins + yins;
|
|
||||||
|
|
||||||
//Positions relative to origin point.
|
|
||||||
double dx0 = x - xb;
|
|
||||||
double dy0 = y - yb;
|
|
||||||
|
|
||||||
//We'll be defining these inside the next block and using them afterwards.
|
|
||||||
double dx_ext, dy_ext;
|
|
||||||
int xsv_ext, ysv_ext;
|
|
||||||
|
|
||||||
double value = 0;
|
|
||||||
|
|
||||||
//Contribution (1,0)
|
|
||||||
double dx1 = dx0 - 1 - SQUISH_CONSTANT_2D;
|
|
||||||
double dy1 = dy0 - 0 - SQUISH_CONSTANT_2D;
|
|
||||||
double attn1 = 2 - dx1 * dx1 - dy1 * dy1;
|
|
||||||
if (attn1 > 0) {
|
|
||||||
attn1 *= attn1;
|
|
||||||
value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, dx1, dy1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Contribution (0,1)
|
|
||||||
double dx2 = dx0 - 0 - SQUISH_CONSTANT_2D;
|
|
||||||
double dy2 = dy0 - 1 - SQUISH_CONSTANT_2D;
|
|
||||||
double attn2 = 2 - dx2 * dx2 - dy2 * dy2;
|
|
||||||
if (attn2 > 0) {
|
|
||||||
attn2 *= attn2;
|
|
||||||
value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, dx2, dy2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inSum <= 1) { //We're inside the triangle (2-Simplex) at (0,0)
|
|
||||||
double zins = 1 - inSum;
|
|
||||||
if (zins > xins || zins > yins) { //(0,0) is one of the closest two triangular vertices
|
|
||||||
if (xins > yins) {
|
|
||||||
xsv_ext = xsb + 1;
|
|
||||||
ysv_ext = ysb - 1;
|
|
||||||
dx_ext = dx0 - 1;
|
|
||||||
dy_ext = dy0 + 1;
|
|
||||||
} else {
|
|
||||||
xsv_ext = xsb - 1;
|
|
||||||
ysv_ext = ysb + 1;
|
|
||||||
dx_ext = dx0 + 1;
|
|
||||||
dy_ext = dy0 - 1;
|
|
||||||
}
|
|
||||||
} else { //(1,0) and (0,1) are the closest two vertices.
|
|
||||||
xsv_ext = xsb + 1;
|
|
||||||
ysv_ext = ysb + 1;
|
|
||||||
dx_ext = dx0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
dy_ext = dy0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
}
|
|
||||||
} else { //We're inside the triangle (2-Simplex) at (1,1)
|
|
||||||
double zins = 2 - inSum;
|
|
||||||
if (zins < xins || zins < yins) { //(0,0) is one of the closest two triangular vertices
|
|
||||||
if (xins > yins) {
|
|
||||||
xsv_ext = xsb + 2;
|
|
||||||
ysv_ext = ysb + 0;
|
|
||||||
dx_ext = dx0 - 2 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
dy_ext = dy0 + 0 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
} else {
|
|
||||||
xsv_ext = xsb + 0;
|
|
||||||
ysv_ext = ysb + 2;
|
|
||||||
dx_ext = dx0 + 0 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
dy_ext = dy0 - 2 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
}
|
|
||||||
} else { //(1,0) and (0,1) are the closest two vertices.
|
|
||||||
dx_ext = dx0;
|
|
||||||
dy_ext = dy0;
|
|
||||||
xsv_ext = xsb;
|
|
||||||
ysv_ext = ysb;
|
|
||||||
}
|
|
||||||
xsb += 1;
|
|
||||||
ysb += 1;
|
|
||||||
dx0 = dx0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
dy0 = dy0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Contribution (0,0) or (1,1)
|
|
||||||
double attn0 = 2 - dx0 * dx0 - dy0 * dy0;
|
|
||||||
if (attn0 > 0) {
|
|
||||||
attn0 *= attn0;
|
|
||||||
value += attn0 * attn0 * extrapolate(xsb, ysb, dx0, dy0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Extra Vertex
|
|
||||||
double attn_ext = 2 - dx_ext * dx_ext - dy_ext * dy_ext;
|
|
||||||
if (attn_ext > 0) {
|
|
||||||
attn_ext *= attn_ext;
|
|
||||||
value += attn_ext * attn_ext * extrapolate(xsv_ext, ysv_ext, dx_ext, dy_ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
return value / NORM_CONSTANT_2D;
|
|
||||||
}
|
|
||||||
|
|
||||||
//3D OpenSimplex Noise.
|
//3D OpenSimplex Noise.
|
||||||
public double eval(double x, double y, double z) {
|
public double eval(double x, double y, double z) {
|
||||||
@@ -2073,6 +1969,150 @@ public class OpenSimplexNoise {
|
|||||||
+ gradients3D[index + 1] * dy
|
+ gradients3D[index + 1] * dy
|
||||||
+ gradients3D[index + 2] * dz;
|
+ gradients3D[index + 2] * dz;
|
||||||
}
|
}
|
||||||
|
private final short[] permGradIndex3D;
|
||||||
|
|
||||||
|
//Initializes the class using a permutation array generated from a 64-bit seed.
|
||||||
|
//Generates a proper permutation (i.e. doesn't merely perform N successive pair swaps on a base array)
|
||||||
|
//Uses a simple 64-bit LCG.
|
||||||
|
public OpenSimplexNoise(long seed) {
|
||||||
|
perm = new short[256];
|
||||||
|
permGradIndex3D = new short[256];
|
||||||
|
short[] source = new short[256];
|
||||||
|
for (short i = 0; i < 256; i++)
|
||||||
|
source[i] = i;
|
||||||
|
seed = seed * 6364136223846793005L + 1442695040888963407L;
|
||||||
|
seed = seed * 6364136223846793005L + 1442695040888963407L;
|
||||||
|
seed = seed * 6364136223846793005L + 1442695040888963407L;
|
||||||
|
for (int i = 255; i >= 0; i--) {
|
||||||
|
seed = seed * 6364136223846793005L + 1442695040888963407L;
|
||||||
|
int r = (int) ((seed + 31) % (i + 1));
|
||||||
|
if (r < 0)
|
||||||
|
r += (i + 1);
|
||||||
|
perm[i] = source[r];
|
||||||
|
permGradIndex3D[i] = (short) ((perm[i] % (gradients3D.length / 3)) * 3);
|
||||||
|
source[r] = source[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int fastFloor(double x) {
|
||||||
|
int xi = (int) x;
|
||||||
|
return x < xi ? xi - 1 : xi;
|
||||||
|
}
|
||||||
|
|
||||||
|
//2D OpenSimplex Noise.
|
||||||
|
public double eval(double x, double y) {
|
||||||
|
|
||||||
|
//Place input coordinates onto grid.
|
||||||
|
double stretchOffset = (x + y) * STRETCH_CONSTANT_2D;
|
||||||
|
double xs = x + stretchOffset;
|
||||||
|
double ys = y + stretchOffset;
|
||||||
|
|
||||||
|
//Floor to get grid coordinates of rhombus (stretched square) super-cell origin.
|
||||||
|
int xsb = fastFloor(xs);
|
||||||
|
int ysb = fastFloor(ys);
|
||||||
|
|
||||||
|
//Skew out to get actual coordinates of rhombus origin. We'll need these later.
|
||||||
|
double squishOffset = (xsb + ysb) * SQUISH_CONSTANT_2D;
|
||||||
|
double xb = xsb + squishOffset;
|
||||||
|
double yb = ysb + squishOffset;
|
||||||
|
|
||||||
|
//Compute grid coordinates relative to rhombus origin.
|
||||||
|
double xins = xs - xsb;
|
||||||
|
double yins = ys - ysb;
|
||||||
|
|
||||||
|
//Sum those together to get a value that determines which region we're in.
|
||||||
|
double inSum = xins + yins;
|
||||||
|
|
||||||
|
//Positions relative to origin point.
|
||||||
|
double dx0 = x - xb;
|
||||||
|
double dy0 = y - yb;
|
||||||
|
|
||||||
|
//We'll be defining these inside the next block and using them afterwards.
|
||||||
|
double dx_ext, dy_ext;
|
||||||
|
int xsv_ext, ysv_ext;
|
||||||
|
|
||||||
|
double value = 0;
|
||||||
|
|
||||||
|
//Contribution (1,0)
|
||||||
|
double dx1 = dx0 - 1 - SQUISH_CONSTANT_2D;
|
||||||
|
double dy1 = dy0 - 0 - SQUISH_CONSTANT_2D;
|
||||||
|
double attn1 = 2 - dx1 * dx1 - dy1 * dy1;
|
||||||
|
if (attn1 > 0) {
|
||||||
|
attn1 *= attn1;
|
||||||
|
value += attn1 * attn1 * extrapolate(xsb + 1, ysb + 0, dx1, dy1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Contribution (0,1)
|
||||||
|
double dx2 = dx0 - 0 - SQUISH_CONSTANT_2D;
|
||||||
|
double dy2 = dy0 - 1 - SQUISH_CONSTANT_2D;
|
||||||
|
double attn2 = 2 - dx2 * dx2 - dy2 * dy2;
|
||||||
|
if (attn2 > 0) {
|
||||||
|
attn2 *= attn2;
|
||||||
|
value += attn2 * attn2 * extrapolate(xsb + 0, ysb + 1, dx2, dy2);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inSum <= 1) { //We're inside the triangle (2-Simplex) at (0,0)
|
||||||
|
double zins = 1 - inSum;
|
||||||
|
if (zins > xins || zins > yins) { //(0,0) is one of the closest two triangular vertices
|
||||||
|
if (xins > yins) {
|
||||||
|
xsv_ext = xsb + 1;
|
||||||
|
ysv_ext = ysb - 1;
|
||||||
|
dx_ext = dx0 - 1;
|
||||||
|
dy_ext = dy0 + 1;
|
||||||
|
} else {
|
||||||
|
xsv_ext = xsb - 1;
|
||||||
|
ysv_ext = ysb + 1;
|
||||||
|
dx_ext = dx0 + 1;
|
||||||
|
dy_ext = dy0 - 1;
|
||||||
|
}
|
||||||
|
} else { //(1,0) and (0,1) are the closest two vertices.
|
||||||
|
xsv_ext = xsb + 1;
|
||||||
|
ysv_ext = ysb + 1;
|
||||||
|
dx_ext = dx0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
dy_ext = dy0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
}
|
||||||
|
} else { //We're inside the triangle (2-Simplex) at (1,1)
|
||||||
|
double zins = 2 - inSum;
|
||||||
|
if (zins < xins || zins < yins) { //(0,0) is one of the closest two triangular vertices
|
||||||
|
if (xins > yins) {
|
||||||
|
xsv_ext = xsb + 2;
|
||||||
|
ysv_ext = ysb + 0;
|
||||||
|
dx_ext = dx0 - 2 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
dy_ext = dy0 + 0 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
} else {
|
||||||
|
xsv_ext = xsb + 0;
|
||||||
|
ysv_ext = ysb + 2;
|
||||||
|
dx_ext = dx0 + 0 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
dy_ext = dy0 - 2 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
}
|
||||||
|
} else { //(1,0) and (0,1) are the closest two vertices.
|
||||||
|
dx_ext = dx0;
|
||||||
|
dy_ext = dy0;
|
||||||
|
xsv_ext = xsb;
|
||||||
|
ysv_ext = ysb;
|
||||||
|
}
|
||||||
|
xsb += 1;
|
||||||
|
ysb += 1;
|
||||||
|
dx0 = dx0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
dy0 = dy0 - 1 - 2 * SQUISH_CONSTANT_2D;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Contribution (0,0) or (1,1)
|
||||||
|
double attn0 = 2 - dx0 * dx0 - dy0 * dy0;
|
||||||
|
if (attn0 > 0) {
|
||||||
|
attn0 *= attn0;
|
||||||
|
value += attn0 * attn0 * extrapolate(xsb, ysb, dx0, dy0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Extra Vertex
|
||||||
|
double attn_ext = 2 - dx_ext * dx_ext - dy_ext * dy_ext;
|
||||||
|
if (attn_ext > 0) {
|
||||||
|
attn_ext *= attn_ext;
|
||||||
|
value += attn_ext * attn_ext * extrapolate(xsv_ext, ysv_ext, dx_ext, dy_ext);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value / NORM_CONSTANT_2D;
|
||||||
|
}
|
||||||
|
|
||||||
private double extrapolate(int xsb, int ysb, int zsb, int wsb, double dx, double dy, double dz, double dw)
|
private double extrapolate(int xsb, int ysb, int zsb, int wsb, double dx, double dy, double dz, double dw)
|
||||||
{
|
{
|
||||||
@@ -2082,56 +2122,4 @@ public class OpenSimplexNoise {
|
|||||||
+ gradients4D[index + 2] * dz
|
+ gradients4D[index + 2] * dz
|
||||||
+ gradients4D[index + 3] * dw;
|
+ gradients4D[index + 3] * dw;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int fastFloor(double x) {
|
|
||||||
int xi = (int)x;
|
|
||||||
return x < xi ? xi - 1 : xi;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Gradients for 2D. They approximate the directions to the
|
|
||||||
//vertices of an octagon from the center.
|
|
||||||
private static byte[] gradients2D = new byte[] {
|
|
||||||
5, 2, 2, 5,
|
|
||||||
-5, 2, -2, 5,
|
|
||||||
5, -2, 2, -5,
|
|
||||||
-5, -2, -2, -5,
|
|
||||||
};
|
|
||||||
|
|
||||||
//Gradients for 3D. They approximate the directions to the
|
|
||||||
//vertices of a rhombicuboctahedron from the center, skewed so
|
|
||||||
//that the triangular and square facets can be inscribed inside
|
|
||||||
//circles of the same radius.
|
|
||||||
private static byte[] gradients3D = new byte[] {
|
|
||||||
-11, 4, 4, -4, 11, 4, -4, 4, 11,
|
|
||||||
11, 4, 4, 4, 11, 4, 4, 4, 11,
|
|
||||||
-11, -4, 4, -4, -11, 4, -4, -4, 11,
|
|
||||||
11, -4, 4, 4, -11, 4, 4, -4, 11,
|
|
||||||
-11, 4, -4, -4, 11, -4, -4, 4, -11,
|
|
||||||
11, 4, -4, 4, 11, -4, 4, 4, -11,
|
|
||||||
-11, -4, -4, -4, -11, -4, -4, -4, -11,
|
|
||||||
11, -4, -4, 4, -11, -4, 4, -4, -11,
|
|
||||||
};
|
|
||||||
|
|
||||||
//Gradients for 4D. They approximate the directions to the
|
|
||||||
//vertices of a disprismatotesseractihexadecachoron from the center,
|
|
||||||
//skewed so that the tetrahedral and cubic facets can be inscribed inside
|
|
||||||
//spheres of the same radius.
|
|
||||||
private static byte[] gradients4D = new byte[] {
|
|
||||||
3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 3,
|
|
||||||
-3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3,
|
|
||||||
3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3, 1, 1, -1, 1, 3,
|
|
||||||
-3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3,
|
|
||||||
3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3, 1, 1, 1, -1, 3,
|
|
||||||
-3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3,
|
|
||||||
3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3, 1, 1, -1, -1, 3,
|
|
||||||
-3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3,
|
|
||||||
3, 1, 1, -1, 1, 3, 1, -1, 1, 1, 3, -1, 1, 1, 1, -3,
|
|
||||||
-3, 1, 1, -1, -1, 3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3,
|
|
||||||
3, -1, 1, -1, 1, -3, 1, -1, 1, -1, 3, -1, 1, -1, 1, -3,
|
|
||||||
-3, -1, 1, -1, -1, -3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3,
|
|
||||||
3, 1, -1, -1, 1, 3, -1, -1, 1, 1, -3, -1, 1, 1, -1, -3,
|
|
||||||
-3, 1, -1, -1, -1, 3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3,
|
|
||||||
3, -1, -1, -1, 1, -3, -1, -1, 1, -1, -3, -1, 1, -1, -1, -3,
|
|
||||||
-3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3, -1, -1, -1, -1, -3,
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.mygdx.game;
|
package Collector;
|
||||||
|
|
||||||
public interface Restrictions {
|
public interface Restrictions {
|
||||||
int SEED = 1;
|
int SEED = 1;
|
||||||
@@ -1,38 +1,32 @@
|
|||||||
package com.mygdx.game.UI;
|
package Collector.UI;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.graphics.Color;
|
import com.badlogic.gdx.graphics.Color;
|
||||||
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
import com.badlogic.gdx.graphics.g2d.BitmapFont;
|
||||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
|
||||||
import com.badlogic.gdx.scenes.scene2d.Stage;
|
import com.badlogic.gdx.scenes.scene2d.Stage;
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||||
import com.badlogic.gdx.utils.viewport.FitViewport;
|
import com.badlogic.gdx.utils.viewport.FitViewport;
|
||||||
import com.mygdx.game.Character.Mouse;
|
import Collector.Restrictions;
|
||||||
import com.mygdx.game.Restrictions;
|
|
||||||
|
|
||||||
public class GUI implements Restrictions {
|
public class GUI implements Restrictions {
|
||||||
private final Stage stage;
|
private final Stage stage;
|
||||||
private final Label label;
|
|
||||||
private final Mouse mouse;
|
|
||||||
private final BitmapFont font;
|
private final BitmapFont font;
|
||||||
private final FitViewport fitViewport;
|
|
||||||
|
|
||||||
public GUI(Mouse mouse, FitViewport fitViewport) {
|
public GUI(FitViewport fitViewport) {
|
||||||
|
|
||||||
font = new BitmapFont();
|
font = new BitmapFont();
|
||||||
stage = new Stage(fitViewport);
|
stage = new Stage(fitViewport);
|
||||||
label = new Label("Start", new Label.LabelStyle(font, new Color(Color.WHITE)));
|
|
||||||
|
|
||||||
this.mouse = mouse;
|
Label label = new Label("Start", new Label.LabelStyle(font, new Color(Color.WHITE)));
|
||||||
this.fitViewport = fitViewport;
|
|
||||||
|
|
||||||
Gdx.input.setInputProcessor(stage);
|
Gdx.input.setInputProcessor(stage);
|
||||||
stage.addActor(label);
|
stage.addActor(label);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(SpriteBatch batch){
|
public void render() {
|
||||||
stage.act();
|
stage.act();
|
||||||
stage.draw();
|
stage.draw();
|
||||||
//font.draw(batch, "x: "+ mouse.getTileX(cam) + "y: " + mouse.getTileY(cam),-10, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dispose(){
|
public void dispose(){
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
apply plugin: "java"
|
|
||||||
|
|
||||||
sourceCompatibility = 1.7
|
|
||||||
sourceSets.main.java.srcDirs = [ "src/" ]
|
|
||||||
sourceSets.main.resources.srcDirs = ["../core/assets"]
|
|
||||||
|
|
||||||
project.ext.mainClassName = "com.mygdx.game.desktop.DesktopLauncher"
|
|
||||||
project.ext.assetsDir = new File("../core/assets")
|
|
||||||
|
|
||||||
task run(dependsOn: classes, type: JavaExec) {
|
|
||||||
main = project.mainClassName
|
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
|
||||||
standardInput = System.in
|
|
||||||
workingDir = project.assetsDir
|
|
||||||
ignoreExitValue = true
|
|
||||||
}
|
|
||||||
|
|
||||||
task debug(dependsOn: classes, type: JavaExec) {
|
|
||||||
main = project.mainClassName
|
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
|
||||||
standardInput = System.in
|
|
||||||
workingDir = project.assetsDir
|
|
||||||
ignoreExitValue = true
|
|
||||||
debug = true
|
|
||||||
}
|
|
||||||
|
|
||||||
task dist(type: Jar) {
|
|
||||||
manifest {
|
|
||||||
attributes 'Main-Class': project.mainClassName
|
|
||||||
}
|
|
||||||
dependsOn configurations.runtimeClasspath
|
|
||||||
from {
|
|
||||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
|
||||||
}
|
|
||||||
with jar
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dist.dependsOn classes
|
|
||||||
|
|
||||||
eclipse.project.name = appName + "-desktop"
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
package com.mygdx.game.desktop;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
|
|
||||||
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
|
|
||||||
import com.mygdx.game.Main;
|
|
||||||
|
|
||||||
public class DesktopLauncher {
|
|
||||||
public static void main (String[] arg) {
|
|
||||||
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
|
|
||||||
new Lwjgl3Application(new Main(), config);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,17 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=false
|
||||||
org.gradle.jvmargs=-Xms128m -Xmx1500m
|
org.gradle.jvmargs=-Xms128m -Xmx512m
|
||||||
org.gradle.configureondemand=false
|
org.gradle.configureondemand=false
|
||||||
|
aiVersion=1.8.1
|
||||||
|
ashleyVersion=1.7.3
|
||||||
|
box2dlightsVersion=1.4
|
||||||
|
noise4jVersion=0.1.0
|
||||||
|
jaciGwtVersion=0.4.0
|
||||||
|
joiseVersion=1.0.5
|
||||||
|
kiwiVersion=1.9.1.9.6
|
||||||
|
dialogsVersion=1.2.0
|
||||||
|
inGameConsoleVersion=1.0.0
|
||||||
|
utilsVersion=0.13.4
|
||||||
|
utilsBox2dVersion=0.13.4
|
||||||
|
overlap2dVersion=0.1.1
|
||||||
|
jaciVersion=0.4.0
|
||||||
|
gdxVersion=1.9.10
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
5
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,5 @@
|
|||||||
#Mon Mar 23 19:58:06 MDT 2020
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
35
gradlew
vendored
Normal file → Executable file
@@ -7,7 +7,7 @@
|
|||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
#
|
#
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
# https://www.apache.org/licenses/LICENSE-2.0
|
||||||
#
|
#
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@@ -125,8 +125,8 @@ if $darwin; then
|
|||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if $cygwin ; then
|
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
@@ -154,19 +154,19 @@ if $cygwin ; then
|
|||||||
else
|
else
|
||||||
eval `echo args$i`="\"$arg\""
|
eval `echo args$i`="\"$arg\""
|
||||||
fi
|
fi
|
||||||
i=$((i+1))
|
i=`expr $i + 1`
|
||||||
done
|
done
|
||||||
case $i in
|
case $i in
|
||||||
(0) set -- ;;
|
0) set -- ;;
|
||||||
(1) set -- "$args0" ;;
|
1) set -- "$args0" ;;
|
||||||
(2) set -- "$args0" "$args1" ;;
|
2) set -- "$args0" "$args1" ;;
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -175,14 +175,9 @@ save () {
|
|||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
echo " "
|
echo " "
|
||||||
}
|
}
|
||||||
APP_ARGS=$(save "$@")
|
APP_ARGS=`save "$@"`
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
||||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
||||||
cd "$(dirname "$0")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|||||||
5
gradlew.bat
vendored
Normal file → Executable file
@@ -5,7 +5,7 @@
|
|||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem You may obtain a copy of the License at
|
@rem You may obtain a copy of the License at
|
||||||
@rem
|
@rem
|
||||||
@rem http://www.apache.org/licenses/LICENSE-2.0
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@rem
|
@rem
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
|
|||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
|
|
||||||
|
|||||||
37
lwjgl3/build.gradle
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
apply plugin: 'application'
|
||||||
|
|
||||||
|
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
|
||||||
|
mainClassName = 'Collector.lwjgl3.Lwjgl3Launcher'
|
||||||
|
eclipse.project.name = appName + '-lwjgl3'
|
||||||
|
sourceCompatibility = 8.0
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
api project(':core')
|
||||||
|
api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
|
||||||
|
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
|
||||||
|
api "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
|
||||||
|
api "com.badlogicgames.gdx:gdx-controllers-lwjgl3:$gdxVersion"
|
||||||
|
api "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
|
||||||
|
api "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-desktop"
|
||||||
|
api "com.badlogicgames.gdx:gdx-tools:$gdxVersion"
|
||||||
|
api "de.tomgrill.gdxdialogs:gdx-dialogs-desktop:$dialogsVersion"
|
||||||
|
}
|
||||||
|
|
||||||
|
import org.gradle.internal.os.OperatingSystem
|
||||||
|
|
||||||
|
run {
|
||||||
|
workingDir = rootProject.file('assets').path
|
||||||
|
setIgnoreExitValue(true)
|
||||||
|
|
||||||
|
if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
|
||||||
|
// Required to run LWJGL3 Java apps on MacOS
|
||||||
|
jvmArgs += "-XstartOnFirstThread"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jar {
|
||||||
|
archiveFileName = "${appName}-${version}.jar"
|
||||||
|
from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
|
||||||
|
manifest {
|
||||||
|
attributes 'Main-Class': project.mainClassName
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
lwjgl3/build/resources/main/air.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
lwjgl3/build/resources/main/crosshair.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
lwjgl3/build/resources/main/gdx-texturepacker/gdx-texturepacker.jar
Executable file
BIN
lwjgl3/build/resources/main/gdx-texturepacker/icon.ico
Normal file
|
After Width: | Height: | Size: 71 KiB |
@@ -0,0 +1,2 @@
|
|||||||
|
cd /d %~dp0
|
||||||
|
start javaw -Xms64m -Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=15 -XX:MaxHeapFreeRatio=30 -jar gdx-texturepacker.jar %*
|
||||||
3
lwjgl3/build/resources/main/gdx-texturepacker/launcher.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
SCRIPTDIR=$(dirname "$0")
|
||||||
|
cd $SCRIPTDIR
|
||||||
|
java -Xms64m -Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=15 -XX:MaxHeapFreeRatio=30 -jar ./gdx-texturepacker.jar
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
Set oShell = CreateObject ("Wscript.Shell")
|
||||||
|
Dim strArgs
|
||||||
|
strArgs = "cmd /c launcher.bat "
|
||||||
|
For Each arg In Wscript.Arguments
|
||||||
|
strArgs = strArgs + arg
|
||||||
|
Next
|
||||||
|
oShell.Run strArgs, 0, false
|
||||||
27
lwjgl3/build/resources/main/gdx-texturepacker/readme.txt
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
Gdx Texture Packer GUI
|
||||||
|
|
||||||
|
Simple utility to help you pack and manage texture atlases for LibGDX game framework. It's mostly just visual wrapper over LibGDX TexturePacker classes and offers more convenient way of using it.
|
||||||
|
|
||||||
|
For further details visit GitHub project page:
|
||||||
|
https://github.com/crashinvaders/gdx-texture-packer-gui
|
||||||
|
|
||||||
|
Requirements:
|
||||||
|
- Java 7 JRE (or higher) (can be donwnloaded here http://www.oracle.com/technetwork/java/javase/downloads/index.html)
|
||||||
|
- OpenGL support
|
||||||
|
|
||||||
|
How to launch:
|
||||||
|
Application is packed into JAR executable file. To launch it, issue next command
|
||||||
|
java -jar gdx-texturepacker.jar
|
||||||
|
|
||||||
|
MacOS and UNIX
|
||||||
|
You may execute launch.sh bash script to launch application
|
||||||
|
|
||||||
|
Windows
|
||||||
|
launch.bat - starts application
|
||||||
|
launcher_no_cmd.vbs - does exactly what launch.bat does, but CMD window won't appear in that case
|
||||||
|
|
||||||
|
|
||||||
|
If you got any questions or would like to share some ideas, reach me out at anton@crashinvaders.com
|
||||||
|
|
||||||
|
Hope you will enjoy it!
|
||||||
|
Anton Chekulaev
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
You can define/override you own keyboard shortcuts for some actions.
|
||||||
|
For the details look at the default hotkey configuration file.
|
||||||
|
https://github.com/crashinvaders/gdx-texture-packer-gui/blob/master/assets/hotkeys_default.txt
|
||||||
BIN
lwjgl3/build/resources/main/grass.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
lwjgl3/build/resources/main/jungleGrass.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
lwjgl3/build/resources/main/libgdx128.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
lwjgl3/build/resources/main/libgdx16.png
Normal file
|
After Width: | Height: | Size: 879 B |
BIN
lwjgl3/build/resources/main/libgdx32.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
lwjgl3/build/resources/main/libgdx64.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
229
lwjgl3/build/resources/main/man.atlas
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
man.png
|
||||||
|
size: 256, 128
|
||||||
|
format: RGBA8888
|
||||||
|
filter: Nearest,Nearest
|
||||||
|
repeat: none
|
||||||
|
man_Up
|
||||||
|
rotate: false
|
||||||
|
xy: 0,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_Up
|
||||||
|
rotate: false
|
||||||
|
xy: 32,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_Up
|
||||||
|
rotate: false
|
||||||
|
xy: 64,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_Up
|
||||||
|
rotate: false
|
||||||
|
xy: 96,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
|
man_Down
|
||||||
|
rotate: false
|
||||||
|
xy: 128,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_Down
|
||||||
|
rotate: false
|
||||||
|
xy: 160,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_Down
|
||||||
|
rotate: false
|
||||||
|
xy: 192,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_Down
|
||||||
|
rotate: false
|
||||||
|
xy: 224,0
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
|
man_Left
|
||||||
|
rotate: false
|
||||||
|
xy: 0,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_Left
|
||||||
|
rotate: false
|
||||||
|
xy: 32,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_Left
|
||||||
|
rotate: false
|
||||||
|
xy: 64,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_Left
|
||||||
|
rotate: false
|
||||||
|
xy: 96,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
|
man_Right
|
||||||
|
rotate: false
|
||||||
|
xy: 128,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_Right
|
||||||
|
rotate: false
|
||||||
|
xy: 160,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_Right
|
||||||
|
rotate: false
|
||||||
|
xy: 192,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_Right
|
||||||
|
rotate: false
|
||||||
|
xy: 224,32
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
|
man_UpLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 0,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_UpLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 32,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_UpLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 64,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_UpLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 96,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
|
man_UpRight
|
||||||
|
rotate: false
|
||||||
|
xy: 128,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_UpRight
|
||||||
|
rotate: false
|
||||||
|
xy: 160,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_UpRight
|
||||||
|
rotate: false
|
||||||
|
xy: 192,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_UpRight
|
||||||
|
rotate: false
|
||||||
|
xy: 224,64
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
|
man_DownLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 0,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_DownLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 32,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_DownLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 64,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_DownLeft
|
||||||
|
rotate: false
|
||||||
|
xy: 96,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
|
man_DownRight
|
||||||
|
rotate: false
|
||||||
|
xy: 128,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 0
|
||||||
|
man_DownRight
|
||||||
|
rotate: false
|
||||||
|
xy: 160,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 1
|
||||||
|
man_DownRight
|
||||||
|
rotate: false
|
||||||
|
xy: 192,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 2
|
||||||
|
man_DownRight
|
||||||
|
rotate: false
|
||||||
|
xy: 224,96
|
||||||
|
size: 32,32
|
||||||
|
orig: 32,32
|
||||||
|
offset: 0,0
|
||||||
|
index: 3
|
||||||
BIN
lwjgl3/build/resources/main/man.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
62
lwjgl3/build/resources/main/output/world.atlas
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
world.png
|
||||||
|
size: 128,16
|
||||||
|
format: RGBA8888
|
||||||
|
filter: Nearest,Nearest
|
||||||
|
repeat: none
|
||||||
|
crosshair
|
||||||
|
rotate: false
|
||||||
|
xy: 48, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
grass
|
||||||
|
rotate: false
|
||||||
|
xy: 96, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
jungleGrass
|
||||||
|
rotate: false
|
||||||
|
xy: 112, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
sand
|
||||||
|
rotate: false
|
||||||
|
xy: 16, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
snow
|
||||||
|
rotate: false
|
||||||
|
xy: 0, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
stone
|
||||||
|
rotate: false
|
||||||
|
xy: 64, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
water
|
||||||
|
rotate: false
|
||||||
|
xy: 32, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
wood
|
||||||
|
rotate: false
|
||||||
|
xy: 80, 0
|
||||||
|
size: 16, 16
|
||||||
|
orig: 16, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
BIN
lwjgl3/build/resources/main/output/world.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
lwjgl3/build/resources/main/roof.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
lwjgl3/build/resources/main/sand.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
lwjgl3/build/resources/main/snow.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
lwjgl3/build/resources/main/stone.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
lwjgl3/build/resources/main/wall.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
lwjgl3/build/resources/main/water.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
lwjgl3/build/resources/main/wood.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
24
lwjgl3/src/main/java/Collector/lwjgl3/Lwjgl3Launcher.java
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package Collector.lwjgl3;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
|
||||||
|
import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
|
||||||
|
import Collector.Main;
|
||||||
|
|
||||||
|
/** Launches the desktop (LWJGL3) application. */
|
||||||
|
public class Lwjgl3Launcher {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
createApplication();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Lwjgl3Application createApplication() {
|
||||||
|
return new Lwjgl3Application(new Main(), getDefaultConfiguration());
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Lwjgl3ApplicationConfiguration getDefaultConfiguration() {
|
||||||
|
Lwjgl3ApplicationConfiguration configuration = new Lwjgl3ApplicationConfiguration();
|
||||||
|
configuration.setTitle("Collevtor");
|
||||||
|
configuration.setWindowedMode(640, 480);
|
||||||
|
configuration.setWindowIcon("libgdx128.png", "libgdx64.png", "libgdx32.png", "libgdx16.png");
|
||||||
|
return configuration;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
lwjgl3/src/main/resources/libgdx128.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
lwjgl3/src/main/resources/libgdx16.png
Normal file
|
After Width: | Height: | Size: 879 B |
BIN
lwjgl3/src/main/resources/libgdx32.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
lwjgl3/src/main/resources/libgdx64.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
@@ -1 +1 @@
|
|||||||
include 'desktop', 'core'
|
include 'core', 'lwjgl3'
|
||||||