diff --git a/core/assets/air.png b/assets/air.png similarity index 100% rename from core/assets/air.png rename to assets/air.png diff --git a/core/assets/crosshair.png b/assets/crosshair.png similarity index 100% rename from core/assets/crosshair.png rename to assets/crosshair.png diff --git a/core/assets/gdx-texturepacker/gdx-texturepacker.jar b/assets/gdx-texturepacker/gdx-texturepacker.jar similarity index 100% rename from core/assets/gdx-texturepacker/gdx-texturepacker.jar rename to assets/gdx-texturepacker/gdx-texturepacker.jar diff --git a/core/assets/gdx-texturepacker/icon.ico b/assets/gdx-texturepacker/icon.ico similarity index 100% rename from core/assets/gdx-texturepacker/icon.ico rename to assets/gdx-texturepacker/icon.ico diff --git a/core/assets/gdx-texturepacker/launcher.bat b/assets/gdx-texturepacker/launcher.bat similarity index 100% rename from core/assets/gdx-texturepacker/launcher.bat rename to assets/gdx-texturepacker/launcher.bat diff --git a/core/assets/gdx-texturepacker/launcher.sh b/assets/gdx-texturepacker/launcher.sh similarity index 100% rename from core/assets/gdx-texturepacker/launcher.sh rename to assets/gdx-texturepacker/launcher.sh diff --git a/core/assets/gdx-texturepacker/launcher_no_cmd.vbs b/assets/gdx-texturepacker/launcher_no_cmd.vbs similarity index 100% rename from core/assets/gdx-texturepacker/launcher_no_cmd.vbs rename to assets/gdx-texturepacker/launcher_no_cmd.vbs diff --git a/core/assets/gdx-texturepacker/readme.txt b/assets/gdx-texturepacker/readme.txt similarity index 100% rename from core/assets/gdx-texturepacker/readme.txt rename to assets/gdx-texturepacker/readme.txt diff --git a/core/assets/gdx-texturepacker/readme_hotkeys.txt b/assets/gdx-texturepacker/readme_hotkeys.txt similarity index 100% rename from core/assets/gdx-texturepacker/readme_hotkeys.txt rename to assets/gdx-texturepacker/readme_hotkeys.txt diff --git a/core/assets/grass.png b/assets/grass.png similarity index 100% rename from core/assets/grass.png rename to assets/grass.png diff --git a/core/assets/jungleGrass.png b/assets/jungleGrass.png similarity index 100% rename from core/assets/jungleGrass.png rename to assets/jungleGrass.png diff --git a/core/assets/man.atlas b/assets/man.atlas similarity index 100% rename from core/assets/man.atlas rename to assets/man.atlas diff --git a/core/assets/man.png b/assets/man.png similarity index 100% rename from core/assets/man.png rename to assets/man.png diff --git a/core/assets/output/world.atlas b/assets/output/world.atlas similarity index 100% rename from core/assets/output/world.atlas rename to assets/output/world.atlas diff --git a/core/assets/output/world.png b/assets/output/world.png similarity index 100% rename from core/assets/output/world.png rename to assets/output/world.png diff --git a/core/assets/roof.png b/assets/roof.png similarity index 100% rename from core/assets/roof.png rename to assets/roof.png diff --git a/core/assets/sand.png b/assets/sand.png similarity index 100% rename from core/assets/sand.png rename to assets/sand.png diff --git a/core/assets/snow.png b/assets/snow.png similarity index 100% rename from core/assets/snow.png rename to assets/snow.png diff --git a/core/assets/stone.png b/assets/stone.png similarity index 100% rename from core/assets/stone.png rename to assets/stone.png diff --git a/core/assets/wall.png b/assets/wall.png similarity index 100% rename from core/assets/wall.png rename to assets/wall.png diff --git a/core/assets/water.png b/assets/water.png similarity index 100% rename from core/assets/water.png rename to assets/water.png diff --git a/core/assets/wood.png b/assets/wood.png similarity index 100% rename from core/assets/wood.png rename to assets/wood.png diff --git a/build.gradle b/build.gradle index 2979861..7e448f2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,84 +1,44 @@ buildscript { - + repositories { + mavenLocal() + mavenCentral() + google() + maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } + jcenter() + } + dependencies { - repositories { - mavenLocal() - mavenCentral() - maven { url "https://plugins.gradle.org/m2/" } - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - jcenter() - google() - } - dependencies { - - - } + } } allprojects { - apply plugin: "eclipse" - - 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' - } - - repositories { - mavenLocal() - mavenCentral() - jcenter() - google() - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - maven { url "https://oss.sonatype.org/content/repositories/releases/" } - } + apply plugin: 'eclipse' + apply plugin: 'idea' } -project(":desktop") { - apply plugin: "java-library" - - - dependencies { - 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" - - } +configure(subprojects) { + apply plugin: 'java-library' + sourceCompatibility = 8.0 + compileJava { + options.incremental = true + } } -project(":core") { - apply plugin: "java-library" +subprojects { + version = '0.0.1-SNAPSHOT' + ext.appName = 'Collevtor' + repositories { + mavenLocal() + mavenCentral() + maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } + maven { url 'https://jitpack.io' } + jcenter() + } +} - - 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" - - } - -} \ No newline at end of file +// Clearing Eclipse project data in root folder: +tasks.eclipse.doLast { + delete '.project' + delete '.classpath' + delete '.settings/' +} diff --git a/core/build.gradle b/core/build.gradle index 2abc640..99e2d27 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -1,8 +1,23 @@ -apply plugin: "java" - -sourceCompatibility = 1.7 [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' +eclipse.project.name = appName + '-core' -sourceSets.main.java.srcDirs = [ "src/" ] - -eclipse.project.name = appName + "-core" +dependencies { + api "com.badlogicgames.gdx:gdx:$gdxVersion" + 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" +} diff --git a/core/src/com/mygdx/game/Dimension/Block.java b/core/src/com/mygdx/game/Dimension/Block.java deleted file mode 100644 index b88c6f8..0000000 --- a/core/src/com/mygdx/game/Dimension/Block.java +++ /dev/null @@ -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; - } -} diff --git a/core/src/com/mygdx/game/Storage.java b/core/src/com/mygdx/game/Storage.java deleted file mode 100644 index 59b41b2..0000000 --- a/core/src/com/mygdx/game/Storage.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.mygdx.game; - -public class Storage { -} diff --git a/core/src/com/mygdx/game/Character/InputController.java b/core/src/main/java/Collector/Character/InputController.java similarity index 86% rename from core/src/com/mygdx/game/Character/InputController.java rename to core/src/main/java/Collector/Character/InputController.java index 16a681f..5e4853a 100644 --- a/core/src/com/mygdx/game/Character/InputController.java +++ b/core/src/main/java/Collector/Character/InputController.java @@ -1,24 +1,26 @@ -package com.mygdx.game.Character; +package Collector.Character; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input; import com.badlogic.gdx.graphics.g2d.Animation; import com.badlogic.gdx.math.Vector3; -import com.mygdx.game.Dimension.Chunks; -import com.mygdx.game.Restrictions; +import Collector.Dimension.Chunks; +import Collector.Restrictions; import java.util.HashMap; -import static com.mygdx.game.Main.cam; +import static Collector.Main.cam; public class InputController implements Restrictions { - private Player player; + private final Player player; int i = 0; private final HashMap> animations; public InputController(Player player) { + this.player = player; animations = new HashMap<>(); + /* 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("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("Right", new Animation<>(1 / 4f, player.textureAtlas.findRegions(player.getSpriteName() + "_" + "Right"))); - this.player = player; + */ } 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) { i = 0; - directionAnimation("UpLeft"); + //player.setAnimation(animations.get("UpLeft")); Player.addX(-MOVEMENT_SPEED); Player.addY(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) { i = 0; - directionAnimation("UpRight"); + //player.setAnimation(animations.get("UpRight")); Player.addX(MOVEMENT_SPEED); Player.addY(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) { i = 0; - directionAnimation("DownLeft"); + //player.setAnimation(animations.get("DownLeft")); Player.addX(-MOVEMENT_SPEED); Player.addY(-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) { i = 0; - directionAnimation("DownRight"); + //player.setAnimation(animations.get("DownRight")); Player.addX(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) { i = 0; - directionAnimation("Left"); + //player.setAnimation(animations.get("Left")); Player.addX(-MOVEMENT_SPEED); cam.translate(-MOVEMENT_SPEED, 0); } else if (Gdx.input.isKeyPressed(Input.Keys.D) && i > KEY_DELAY) { i = 0; - directionAnimation("Right"); + //player.setAnimation(animations.get("Right")); Player.addX(MOVEMENT_SPEED); cam.translate(MOVEMENT_SPEED, 0); } else if (Gdx.input.isKeyPressed(Input.Keys.S) && i > KEY_DELAY) { i = 0; - directionAnimation("Down"); + //player.setAnimation(animations.get("Down")); Player.addY(-MOVEMENT_SPEED); cam.translate(0, -MOVEMENT_SPEED); } if (Gdx.input.isKeyPressed(Input.Keys.W) && i > KEY_DELAY) { i = 0; - directionAnimation("Up"); + //player.setAnimation(animations.get("Up")); Player.addY(MOVEMENT_SPEED); - cam.translate(0, MOVEMENT_SPEED); } cam.update(); } - public void directionAnimation(String direction) { - player.setAnimation(animations.get(direction)); - } } diff --git a/core/src/com/mygdx/game/Character/Mouse.java b/core/src/main/java/Collector/Character/Mouse.java similarity index 54% rename from core/src/com/mygdx/game/Character/Mouse.java rename to core/src/main/java/Collector/Character/Mouse.java index 2b8bb3a..eb2263a 100644 --- a/core/src/com/mygdx/game/Character/Mouse.java +++ b/core/src/main/java/Collector/Character/Mouse.java @@ -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.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector3; -import com.mygdx.game.Restrictions; - -import static com.mygdx.game.Main.cam; public class Mouse implements Restrictions { Texture crosshair; public Mouse() { - this.crosshair = new Texture("core/assets/crosshair.png"); + this.crosshair = new Texture("assets/crosshair.png"); } public void selectedTile(SpriteBatch batch) { Vector3 mousePos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0); - cam.unproject(mousePos); + Main.cam.unproject(mousePos); int x = getSelectedX(mousePos); int y = getSelectedY(mousePos); batch.draw(crosshair, x, y); @@ -32,20 +30,9 @@ public class Mouse implements Restrictions { 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) { selectedTile(batch); //System.out.println("X = " + getTileX(cam) + " Y = "+ getTileY(cam)); } + } diff --git a/core/src/com/mygdx/game/Character/Player.java b/core/src/main/java/Collector/Character/Player.java similarity index 60% rename from core/src/com/mygdx/game/Character/Player.java rename to core/src/main/java/Collector/Character/Player.java index 7e1afe4..a512045 100644 --- a/core/src/com/mygdx/game/Character/Player.java +++ b/core/src/main/java/Collector/Character/Player.java @@ -1,20 +1,20 @@ -package com.mygdx.game.Character; +package Collector.Character; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.Animation; 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.utils.Array; -import com.mygdx.game.Main; -import com.mygdx.game.Restrictions; +import Collector.Restrictions; public class Player implements Restrictions { - private static int x; - private static int y; - private OrthographicCamera cam; + public static int x; + public static int y; private final String spriteName; public TextureAtlas textureAtlas; private Animation animation; + public static Sprite sprite; public Player(OrthographicCamera cam, int x, int y) { Player.x = x< keyFrames = textureAtlas.findRegions(spriteName + "_Down"); + + //textureAtlas = new TextureAtlas("man.atlas"); + //Array keyFrames = textureAtlas.findRegions(spriteName + "_Down"); float frameDuration = 1 / 4f; - animation = new Animation<>(frameDuration, keyFrames); - } - - public static void teleport(int x, int y){ - Player.x = x<(frameDuration, keyFrames); } public static int getX() { @@ -59,6 +50,7 @@ public class Player implements Restrictions { return spriteName; } + /* public Animation getAnimation() { return animation; } @@ -67,4 +59,6 @@ public class Player implements Restrictions { animation = animationTemp; } + */ + } diff --git a/core/src/main/java/Collector/Dimension/Block.java b/core/src/main/java/Collector/Dimension/Block.java new file mode 100644 index 0000000..e924e83 --- /dev/null +++ b/core/src/main/java/Collector/Dimension/Block.java @@ -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; + } +} diff --git a/core/src/com/mygdx/game/Dimension/BlockMaterials.java b/core/src/main/java/Collector/Dimension/BlockMaterials.java similarity index 95% rename from core/src/com/mygdx/game/Dimension/BlockMaterials.java rename to core/src/main/java/Collector/Dimension/BlockMaterials.java index 7e42cad..440653b 100644 --- a/core/src/com/mygdx/game/Dimension/BlockMaterials.java +++ b/core/src/main/java/Collector/Dimension/BlockMaterials.java @@ -1,4 +1,4 @@ -package com.mygdx.game.Dimension; +package Collector.Dimension; import java.util.HashMap; diff --git a/core/src/com/mygdx/game/Dimension/Chunks.java b/core/src/main/java/Collector/Dimension/Chunks.java similarity index 97% rename from core/src/com/mygdx/game/Dimension/Chunks.java rename to core/src/main/java/Collector/Dimension/Chunks.java index 41a4b0d..3a2def7 100644 --- a/core/src/com/mygdx/game/Dimension/Chunks.java +++ b/core/src/main/java/Collector/Dimension/Chunks.java @@ -1,14 +1,14 @@ //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.Triple; -import com.mygdx.game.OpenSimplexNoise; +import Collector.OpenSimplexNoise; import java.util.HashMap; -import static com.mygdx.game.Dimension.BlockMaterials.materials; -import static com.mygdx.game.Restrictions.*; +import static Collector.Dimension.BlockMaterials.materials; +import static Collector.Restrictions.*; public class Chunks { public static HashMap, Block> blocks = new HashMap<>(); diff --git a/core/src/com/mygdx/game/Dimension/World.java b/core/src/main/java/Collector/Dimension/World.java similarity index 93% rename from core/src/com/mygdx/game/Dimension/World.java rename to core/src/main/java/Collector/Dimension/World.java index 8716725..6a59f53 100644 --- a/core/src/com/mygdx/game/Dimension/World.java +++ b/core/src/main/java/Collector/Dimension/World.java @@ -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 static void generateWorld(int x, int y) { diff --git a/core/src/com/mygdx/game/Dimension/WorldRenderer.java b/core/src/main/java/Collector/Dimension/WorldRenderer.java similarity index 76% rename from core/src/com/mygdx/game/Dimension/WorldRenderer.java rename to core/src/main/java/Collector/Dimension/WorldRenderer.java index 33b62d3..8168349 100644 --- a/core/src/com/mygdx/game/Dimension/WorldRenderer.java +++ b/core/src/main/java/Collector/Dimension/WorldRenderer.java @@ -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.SpriteBatch; import com.github.czyzby.kiwi.util.tuple.immutable.Triple; -import com.mygdx.game.Character.InputController; -import com.mygdx.game.Character.Mouse; -import com.mygdx.game.Restrictions; +import Collector.Character.InputController; +import Collector.Character.Mouse; +import Collector.Restrictions; -import static com.mygdx.game.Main.cam; +import static Collector.Main.cam; public class WorldRenderer implements Restrictions { - private Mouse mouse; - private InputController inputController; + private final Mouse mouse; + private final InputController inputController; public WorldRenderer(Mouse mouse, InputController inputController) { this.mouse = mouse; @@ -20,7 +20,7 @@ public class WorldRenderer implements Restrictions { public void drawWorld(Batch batch, int layer) { for (Triple chunkpair : Chunks.blocks.keySet()) { - if(chunkpair.getThird() == layer) { + if (chunkpair.getThird() == layer) { batch.draw( Chunks.blocks.get(chunkpair).getTexture(), chunkpair.getFirst() << TILE_SHIFT, diff --git a/core/src/main/java/Collector/Main.gwt.xml b/core/src/main/java/Collector/Main.gwt.xml new file mode 100644 index 0000000..4bcf500 --- /dev/null +++ b/core/src/main/java/Collector/Main.gwt.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/core/src/com/mygdx/game/Main.java b/core/src/main/java/Collector/Main.java similarity index 62% rename from core/src/com/mygdx/game/Main.java rename to core/src/main/java/Collector/Main.java index 7df775d..b490198 100644 --- a/core/src/com/mygdx/game/Main.java +++ b/core/src/main/java/Collector/Main.java @@ -1,4 +1,4 @@ -package com.mygdx.game; +package Collector; import com.badlogic.gdx.ApplicationAdapter; 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.g2d.SpriteBatch; import com.badlogic.gdx.utils.viewport.FitViewport; -import com.mygdx.game.Character.InputController; -import com.mygdx.game.Character.Mouse; -import com.mygdx.game.Character.Player; -import com.mygdx.game.Dimension.BlockMaterials; -import com.mygdx.game.Dimension.Chunks; -import com.mygdx.game.Dimension.World; -import com.mygdx.game.Dimension.WorldRenderer; -import com.mygdx.game.UI.GUI; +import Collector.Character.InputController; +import Collector.Character.Mouse; +import Collector.Character.Player; +import Collector.Dimension.BlockMaterials; +import Collector.Dimension.Chunks; +import Collector.Dimension.World; +import Collector.Dimension.WorldRenderer; +import Collector.UI.GUI; -import static com.mygdx.game.Restrictions.*; +import static Collector.Restrictions.*; public class Main extends ApplicationAdapter { private SpriteBatch batch; @@ -32,14 +32,14 @@ public class Main extends ApplicationAdapter { @Override public void create () { - Gdx.graphics.setWindowedMode(1024,576); + Gdx.graphics.setWindowedMode(1024, 576); cam = new OrthographicCamera(VIEWPORT_WIDTH, VIEWPORT_HEIGHT); - player = new Player(cam,0,0); - fitViewport = new FitViewport(VIEWPORT_WIDTH,VIEWPORT_HEIGHT, cam); + player = new Player(cam, 0, 0); + fitViewport = new FitViewport(VIEWPORT_WIDTH, VIEWPORT_HEIGHT, cam); mouse = new Mouse(); - gui = new GUI(mouse,fitViewport); + gui = new GUI(fitViewport); inputController = new InputController(player); - worldRenderer = new WorldRenderer(mouse,inputController); + worldRenderer = new WorldRenderer(mouse, inputController); batch = new SpriteBatch(); BlockMaterials.create(); @@ -47,7 +47,7 @@ public class Main extends ApplicationAdapter { //Starting location of the player - cam.translate(TILE_SIZE >> 1, TILE_SIZE >> 1); + cam.translate(TILE_SIZE >> 1, TILE_SIZE >> 1); cam.zoom = 25f; } @@ -55,21 +55,22 @@ public class Main extends ApplicationAdapter { public void render () { Gdx.gl.glClear(GL30.GL_COLOR_BUFFER_BIT); + timeSinceLastUpdate += Gdx.graphics.getDeltaTime(); //Accumulate delta time batch.begin(); if(timeSinceLastUpdate > 1/10f){ worldRenderer.render(batch); } - player.render(batch,timeSinceLastUpdate); - delta +=Gdx.graphics.getDeltaTime(); - if(delta > RENDER_TIME) { + delta += Gdx.graphics.getDeltaTime(); + if (delta > RENDER_TIME) { delta -= RENDER_TIME; World.loadChunks(); World.unloadChunks(); } - gui.render(batch); + gui.render(); + batch.draw(BlockMaterials.materials.get("wood").getTexture(), Player.x, Player.y,TILE_SIZE,TILE_SIZE); batch.end(); } diff --git a/core/src/com/mygdx/game/OpenSimplexNoise.java b/core/src/main/java/Collector/OpenSimplexNoise.java similarity index 95% rename from core/src/com/mygdx/game/OpenSimplexNoise.java rename to core/src/main/java/Collector/OpenSimplexNoise.java index f00d794..1b1ed4e 100644 --- a/core/src/com/mygdx/game/OpenSimplexNoise.java +++ b/core/src/main/java/Collector/OpenSimplexNoise.java @@ -1,4 +1,4 @@ -package com.mygdx.game;/* +package Collector;/* * OpenSimplex Noise in Java. * by Kurt Spencer * @@ -22,171 +22,67 @@ public class OpenSimplexNoise { private static final double SQUISH_CONSTANT_3D = 1.0 / 3; //(Math.sqrt(3+1)-1)/3; private static final double STRETCH_CONSTANT_4D = -0.138196601125011; //(1/Math.sqrt(4+1)-1)/4; private static final double SQUISH_CONSTANT_4D = 0.309016994374947; //(Math.sqrt(4+1)-1)/4; - + private static final double NORM_CONSTANT_2D = 47; private static final double NORM_CONSTANT_3D = 103; private static final double NORM_CONSTANT_4D = 30; - + private static final long DEFAULT_SEED = 0; - - private short[] perm; - private short[] permGradIndex3D; - + + //Gradients for 2D. They approximate the directions to the + //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() { this(DEFAULT_SEED); } - - public OpenSimplexNoise(short[] perm) { - this.perm = perm; - permGradIndex3D = new short[256]; - - for (int i = 0; i < 256; i++) { - //Since 3D has 24 gradients, simple bitmask won't work, so precompute modulo array. - permGradIndex3D[i] = (short)((perm[i] % (gradients3D.length / 3)) * 3); - } - } - - //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]; - } - } - - //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; + //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 final 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, + }; + private final short[] perm; - //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. public double eval(double x, double y, double z) { - + //Place input coordinates on simplectic honeycomb. double stretchOffset = (x + y + z) * STRETCH_CONSTANT_3D; double xs = x + stretchOffset; @@ -2065,7 +1961,7 @@ public class OpenSimplexNoise { return gradients2D[index] * dx + gradients2D[index + 1] * dy; } - + private double extrapolate(int xsb, int ysb, int zsb, double dx, double dy, double dz) { int index = permGradIndex3D[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF]; @@ -2073,65 +1969,157 @@ public class OpenSimplexNoise { + gradients3D[index + 1] * dy + 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) { int index = perm[(perm[(perm[(perm[xsb & 0xFF] + ysb) & 0xFF] + zsb) & 0xFF] + wsb) & 0xFF] & 0xFC; return gradients4D[index] * dx - + gradients4D[index + 1] * dy - + gradients4D[index + 2] * dz - + gradients4D[index + 3] * dw; + + gradients4D[index + 1] * dy + + gradients4D[index + 2] * dz + + 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, - }; } \ No newline at end of file diff --git a/core/src/com/mygdx/game/Restrictions.java b/core/src/main/java/Collector/Restrictions.java similarity index 94% rename from core/src/com/mygdx/game/Restrictions.java rename to core/src/main/java/Collector/Restrictions.java index 789ea15..e2d3748 100644 --- a/core/src/com/mygdx/game/Restrictions.java +++ b/core/src/main/java/Collector/Restrictions.java @@ -1,4 +1,4 @@ -package com.mygdx.game; +package Collector; public interface Restrictions { int SEED = 1; diff --git a/core/src/com/mygdx/game/UI/GUI.java b/core/src/main/java/Collector/UI/GUI.java similarity index 51% rename from core/src/com/mygdx/game/UI/GUI.java rename to core/src/main/java/Collector/UI/GUI.java index f2ec50b..d354ecf 100644 --- a/core/src/com/mygdx/game/UI/GUI.java +++ b/core/src/main/java/Collector/UI/GUI.java @@ -1,38 +1,32 @@ -package com.mygdx.game.UI; +package Collector.UI; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; 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.ui.Label; import com.badlogic.gdx.utils.viewport.FitViewport; -import com.mygdx.game.Character.Mouse; -import com.mygdx.game.Restrictions; +import Collector.Restrictions; public class GUI implements Restrictions { private final Stage stage; - private final Label label; - private final Mouse mouse; private final BitmapFont font; - private final FitViewport fitViewport; - public GUI(Mouse mouse, FitViewport fitViewport) { + public GUI(FitViewport fitViewport) { + font = new BitmapFont(); stage = new Stage(fitViewport); - label = new Label("Start", new Label.LabelStyle(font, new Color(Color.WHITE))); - this.mouse = mouse; - this.fitViewport = fitViewport; + Label label = new Label("Start", new Label.LabelStyle(font, new Color(Color.WHITE))); Gdx.input.setInputProcessor(stage); stage.addActor(label); + } - public void render(SpriteBatch batch){ + public void render() { stage.act(); stage.draw(); - //font.draw(batch, "x: "+ mouse.getTileX(cam) + "y: " + mouse.getTileY(cam),-10, 0); } public void dispose(){ diff --git a/desktop/build.gradle b/desktop/build.gradle deleted file mode 100644 index 217e30c..0000000 --- a/desktop/build.gradle +++ /dev/null @@ -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" diff --git a/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java b/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java deleted file mode 100644 index c475fb8..0000000 --- a/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java +++ /dev/null @@ -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); - } -} diff --git a/gradle.properties b/gradle.properties index ff329ac..5e03785 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,17 @@ -org.gradle.daemon=true -org.gradle.jvmargs=-Xms128m -Xmx1500m +org.gradle.daemon=false +org.gradle.jvmargs=-Xms128m -Xmx512m 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 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf..f3d88b1 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d463ad7..a4b4429 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 index b0d6d0a..2fe81a7 --- a/gradlew +++ b/gradlew @@ -7,7 +7,7 @@ # you may not use this file except in compliance with the License. # 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 # 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\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -154,19 +154,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # 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" -# 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" "$@" diff --git a/gradlew.bat b/gradlew.bat old mode 100644 new mode 100755 index 9991c50..62bd9b9 --- a/gradlew.bat +++ b/gradlew.bat @@ -5,7 +5,7 @@ @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem -@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @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_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. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/libs/tween-engine-api.jar b/libs/tween-engine-api.jar deleted file mode 100644 index 5004ce8..0000000 Binary files a/libs/tween-engine-api.jar and /dev/null differ diff --git a/lwjgl3/build.gradle b/lwjgl3/build.gradle new file mode 100644 index 0000000..8efea5d --- /dev/null +++ b/lwjgl3/build.gradle @@ -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 + } +} diff --git a/lwjgl3/build/resources/main/air.png b/lwjgl3/build/resources/main/air.png new file mode 100644 index 0000000..22d5f8a Binary files /dev/null and b/lwjgl3/build/resources/main/air.png differ diff --git a/lwjgl3/build/resources/main/crosshair.png b/lwjgl3/build/resources/main/crosshair.png new file mode 100644 index 0000000..5635c25 Binary files /dev/null and b/lwjgl3/build/resources/main/crosshair.png differ diff --git a/lwjgl3/build/resources/main/gdx-texturepacker/gdx-texturepacker.jar b/lwjgl3/build/resources/main/gdx-texturepacker/gdx-texturepacker.jar new file mode 100755 index 0000000..8bf5922 Binary files /dev/null and b/lwjgl3/build/resources/main/gdx-texturepacker/gdx-texturepacker.jar differ diff --git a/lwjgl3/build/resources/main/gdx-texturepacker/icon.ico b/lwjgl3/build/resources/main/gdx-texturepacker/icon.ico new file mode 100644 index 0000000..836bbfa Binary files /dev/null and b/lwjgl3/build/resources/main/gdx-texturepacker/icon.ico differ diff --git a/lwjgl3/build/resources/main/gdx-texturepacker/launcher.bat b/lwjgl3/build/resources/main/gdx-texturepacker/launcher.bat new file mode 100644 index 0000000..97ffdb0 --- /dev/null +++ b/lwjgl3/build/resources/main/gdx-texturepacker/launcher.bat @@ -0,0 +1,2 @@ +cd /d %~dp0 +start javaw -Xms64m -Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=15 -XX:MaxHeapFreeRatio=30 -jar gdx-texturepacker.jar %* \ No newline at end of file diff --git a/lwjgl3/build/resources/main/gdx-texturepacker/launcher.sh b/lwjgl3/build/resources/main/gdx-texturepacker/launcher.sh new file mode 100755 index 0000000..8d94f08 --- /dev/null +++ b/lwjgl3/build/resources/main/gdx-texturepacker/launcher.sh @@ -0,0 +1,3 @@ +SCRIPTDIR=$(dirname "$0") +cd $SCRIPTDIR +java -Xms64m -Xmx1024m -XX:+UseG1GC -XX:MinHeapFreeRatio=15 -XX:MaxHeapFreeRatio=30 -jar ./gdx-texturepacker.jar \ No newline at end of file diff --git a/lwjgl3/build/resources/main/gdx-texturepacker/launcher_no_cmd.vbs b/lwjgl3/build/resources/main/gdx-texturepacker/launcher_no_cmd.vbs new file mode 100644 index 0000000..7e20c5b --- /dev/null +++ b/lwjgl3/build/resources/main/gdx-texturepacker/launcher_no_cmd.vbs @@ -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 \ No newline at end of file diff --git a/lwjgl3/build/resources/main/gdx-texturepacker/readme.txt b/lwjgl3/build/resources/main/gdx-texturepacker/readme.txt new file mode 100644 index 0000000..8d0a8d2 --- /dev/null +++ b/lwjgl3/build/resources/main/gdx-texturepacker/readme.txt @@ -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 \ No newline at end of file diff --git a/lwjgl3/build/resources/main/gdx-texturepacker/readme_hotkeys.txt b/lwjgl3/build/resources/main/gdx-texturepacker/readme_hotkeys.txt new file mode 100644 index 0000000..761d9cf --- /dev/null +++ b/lwjgl3/build/resources/main/gdx-texturepacker/readme_hotkeys.txt @@ -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 \ No newline at end of file diff --git a/lwjgl3/build/resources/main/grass.png b/lwjgl3/build/resources/main/grass.png new file mode 100644 index 0000000..a554e52 Binary files /dev/null and b/lwjgl3/build/resources/main/grass.png differ diff --git a/lwjgl3/build/resources/main/jungleGrass.png b/lwjgl3/build/resources/main/jungleGrass.png new file mode 100644 index 0000000..ecff7a2 Binary files /dev/null and b/lwjgl3/build/resources/main/jungleGrass.png differ diff --git a/lwjgl3/build/resources/main/libgdx128.png b/lwjgl3/build/resources/main/libgdx128.png new file mode 100644 index 0000000..1616c19 Binary files /dev/null and b/lwjgl3/build/resources/main/libgdx128.png differ diff --git a/lwjgl3/build/resources/main/libgdx16.png b/lwjgl3/build/resources/main/libgdx16.png new file mode 100644 index 0000000..47af189 Binary files /dev/null and b/lwjgl3/build/resources/main/libgdx16.png differ diff --git a/lwjgl3/build/resources/main/libgdx32.png b/lwjgl3/build/resources/main/libgdx32.png new file mode 100644 index 0000000..4cf903a Binary files /dev/null and b/lwjgl3/build/resources/main/libgdx32.png differ diff --git a/lwjgl3/build/resources/main/libgdx64.png b/lwjgl3/build/resources/main/libgdx64.png new file mode 100644 index 0000000..770b68e Binary files /dev/null and b/lwjgl3/build/resources/main/libgdx64.png differ diff --git a/lwjgl3/build/resources/main/man.atlas b/lwjgl3/build/resources/main/man.atlas new file mode 100644 index 0000000..ae74293 --- /dev/null +++ b/lwjgl3/build/resources/main/man.atlas @@ -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 diff --git a/lwjgl3/build/resources/main/man.png b/lwjgl3/build/resources/main/man.png new file mode 100644 index 0000000..aa2beb9 Binary files /dev/null and b/lwjgl3/build/resources/main/man.png differ diff --git a/lwjgl3/build/resources/main/output/world.atlas b/lwjgl3/build/resources/main/output/world.atlas new file mode 100644 index 0000000..95981ff --- /dev/null +++ b/lwjgl3/build/resources/main/output/world.atlas @@ -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 diff --git a/lwjgl3/build/resources/main/output/world.png b/lwjgl3/build/resources/main/output/world.png new file mode 100644 index 0000000..7782b94 Binary files /dev/null and b/lwjgl3/build/resources/main/output/world.png differ diff --git a/lwjgl3/build/resources/main/roof.png b/lwjgl3/build/resources/main/roof.png new file mode 100644 index 0000000..21534ab Binary files /dev/null and b/lwjgl3/build/resources/main/roof.png differ diff --git a/lwjgl3/build/resources/main/sand.png b/lwjgl3/build/resources/main/sand.png new file mode 100644 index 0000000..3d354ca Binary files /dev/null and b/lwjgl3/build/resources/main/sand.png differ diff --git a/lwjgl3/build/resources/main/snow.png b/lwjgl3/build/resources/main/snow.png new file mode 100644 index 0000000..0100539 Binary files /dev/null and b/lwjgl3/build/resources/main/snow.png differ diff --git a/lwjgl3/build/resources/main/stone.png b/lwjgl3/build/resources/main/stone.png new file mode 100644 index 0000000..7e65b12 Binary files /dev/null and b/lwjgl3/build/resources/main/stone.png differ diff --git a/lwjgl3/build/resources/main/wall.png b/lwjgl3/build/resources/main/wall.png new file mode 100644 index 0000000..df0596d Binary files /dev/null and b/lwjgl3/build/resources/main/wall.png differ diff --git a/lwjgl3/build/resources/main/water.png b/lwjgl3/build/resources/main/water.png new file mode 100644 index 0000000..8a04451 Binary files /dev/null and b/lwjgl3/build/resources/main/water.png differ diff --git a/lwjgl3/build/resources/main/wood.png b/lwjgl3/build/resources/main/wood.png new file mode 100644 index 0000000..78c96e1 Binary files /dev/null and b/lwjgl3/build/resources/main/wood.png differ diff --git a/lwjgl3/src/main/java/Collector/lwjgl3/Lwjgl3Launcher.java b/lwjgl3/src/main/java/Collector/lwjgl3/Lwjgl3Launcher.java new file mode 100644 index 0000000..a7c45a8 --- /dev/null +++ b/lwjgl3/src/main/java/Collector/lwjgl3/Lwjgl3Launcher.java @@ -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; + } +} \ No newline at end of file diff --git a/lwjgl3/src/main/resources/libgdx128.png b/lwjgl3/src/main/resources/libgdx128.png new file mode 100644 index 0000000..1616c19 Binary files /dev/null and b/lwjgl3/src/main/resources/libgdx128.png differ diff --git a/lwjgl3/src/main/resources/libgdx16.png b/lwjgl3/src/main/resources/libgdx16.png new file mode 100644 index 0000000..47af189 Binary files /dev/null and b/lwjgl3/src/main/resources/libgdx16.png differ diff --git a/lwjgl3/src/main/resources/libgdx32.png b/lwjgl3/src/main/resources/libgdx32.png new file mode 100644 index 0000000..4cf903a Binary files /dev/null and b/lwjgl3/src/main/resources/libgdx32.png differ diff --git a/lwjgl3/src/main/resources/libgdx64.png b/lwjgl3/src/main/resources/libgdx64.png new file mode 100644 index 0000000..770b68e Binary files /dev/null and b/lwjgl3/src/main/resources/libgdx64.png differ diff --git a/settings.gradle b/settings.gradle index 74fc652..e2a1f0b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include 'desktop', 'core' \ No newline at end of file +include 'core', 'lwjgl3' \ No newline at end of file