diff options
| author | ilotterytea <iltsu@alright.party> | 2024-06-01 00:51:20 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-06-01 00:51:20 +0500 |
| commit | e49f8b310d6032c99406baf04b5ec3eba0fd111f (patch) | |
| tree | 5120a1fbbf923da5ee8bc8561ed1545855aa5547 /core/src/com/ilotterytea/maxoning/player | |
| parent | 10e9df6190ddc3f9c8dd7c86482449bec4651e0c (diff) | |
upd: moved the whole project under kz.ilotterytea.maxon name
Diffstat (limited to 'core/src/com/ilotterytea/maxoning/player')
7 files changed, 0 insertions, 252 deletions
diff --git a/core/src/com/ilotterytea/maxoning/player/DecalPlayer.java b/core/src/com/ilotterytea/maxoning/player/DecalPlayer.java deleted file mode 100644 index 0cf0405..0000000 --- a/core/src/com/ilotterytea/maxoning/player/DecalPlayer.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.ilotterytea.maxoning.player; - -import com.badlogic.gdx.Gdx; -import com.badlogic.gdx.graphics.Camera; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import com.badlogic.gdx.graphics.g3d.decals.Decal; -import com.badlogic.gdx.math.Intersector; -import com.badlogic.gdx.math.Vector3; -import com.badlogic.gdx.math.collision.BoundingBox; -import com.badlogic.gdx.math.collision.Ray; - -public class DecalPlayer { - private final TextureRegion[] regions; - private int regionIndex; - private final Decal decal; - private final BoundingBox box; - private final MaxonSavegame savegame; - - public DecalPlayer(MaxonSavegame savegame, TextureRegion[] regions) { - this.savegame = savegame; - - this.regions = regions; - this.regionIndex = 0; - - this.decal = Decal.newDecal(this.regions[this.regionIndex]); - this.decal.setScale(0.025f); - this.decal.setPosition(2.0f, 1.75f, 2.0f); - - float width = this.decal.getWidth() / (this.decal.getScaleX() * 1000f); - float height = this.decal.getHeight() / (this.decal.getScaleY() * 1000f); - - Vector3 position = this.decal.getPosition(); - Vector3 minBox = new Vector3(position.x - width / 3, position.y - height / 3, position.z - width / 3); - Vector3 maxBox = new Vector3(position.x + width / 3, position.y + height / 3, position.z + width / 3); - - this.box = new BoundingBox(minBox, maxBox); - } - - public void render(Camera camera) { - checkCollisions(camera); - } - - private void checkCollisions(Camera camera) { - Ray ray = null; - - if (Gdx.input.justTouched()) { - ray = camera.getPickRay(Gdx.input.getX(), Gdx.input.getY()); - } - - if (ray == null) { - return; - } - - Vector3 intersection = new Vector3(); - - if (Intersector.intersectRayBounds(ray, box, intersection)) { - updateTextureRegion(); - savegame.points++; - } - } - - private void updateTextureRegion() { - this.regionIndex++; - - if (this.regions[this.regionIndex] == null) { - this.regionIndex = 0; - } - - this.decal.setTextureRegion(this.regions[this.regionIndex]); - } - - public Decal getDecal() { - return this.decal; - } -} diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonItem.java b/core/src/com/ilotterytea/maxoning/player/MaxonItem.java deleted file mode 100644 index 18ee402..0000000 --- a/core/src/com/ilotterytea/maxoning/player/MaxonItem.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.ilotterytea.maxoning.player; - -import com.ilotterytea.maxoning.ui.AnimatedImage; - -public class MaxonItem { - public int id; - public String name; - public String desc; - public AnimatedImage icon; - public MaxonItemEnum type; - public float price; - public float multiplier; - - public MaxonItem(int id, String name, String desc, AnimatedImage icon, MaxonItemEnum type, float price, float multiplier) { - this.id = id; - this.name = name; - this.desc = desc; - this.icon = icon; - this.type = type; - this.price = price; - this.multiplier = multiplier; - } -}
\ No newline at end of file diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonItemEnum.java b/core/src/com/ilotterytea/maxoning/player/MaxonItemEnum.java deleted file mode 100644 index 06b5484..0000000 --- a/core/src/com/ilotterytea/maxoning/player/MaxonItemEnum.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.ilotterytea.maxoning.player; - -public enum MaxonItemEnum { - DUMMY, - BUFF, - SLAVE -} diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonItemRegister.java b/core/src/com/ilotterytea/maxoning/player/MaxonItemRegister.java deleted file mode 100644 index 8b432e1..0000000 --- a/core/src/com/ilotterytea/maxoning/player/MaxonItemRegister.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.ilotterytea.maxoning.player; - -import com.ilotterytea.maxoning.ui.AnimatedImage; - -import java.util.ArrayList; - -public class MaxonItemRegister { - private static ArrayList<MaxonItem> items = new ArrayList<>(); - - public static void register( - int id, - String name, - String desc, - AnimatedImage icon, - MaxonItemEnum type, - float price, - float multiplier - ) { - items.add(new MaxonItem(id, name, desc, icon, type, price, multiplier)); - } - - public static void clear() { items.clear(); } - - public static void unRegister( - int id - ) { - items.remove(id); - } - - public static ArrayList<MaxonItem> getItems() { return items; } - public static MaxonItem get(int id) { - for (MaxonItem item : items) { - if (item.id == id) { - return item; - } - } - return null; - } -} diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonPlayer.java b/core/src/com/ilotterytea/maxoning/player/MaxonPlayer.java deleted file mode 100644 index 9898291..0000000 --- a/core/src/com/ilotterytea/maxoning/player/MaxonPlayer.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.ilotterytea.maxoning.player; - -import java.io.Serializable; -import java.util.ArrayList; - -public class MaxonPlayer implements Serializable { - public float points; - public float multiplier; - public ArrayList<Integer> purchasedItems; - - public MaxonPlayer() { - this.points = 0; - this.multiplier = 1.2f; - this.purchasedItems = new ArrayList<>(); - } - - public void load(MaxonPlayer player) { - if (player != null) { - this.points = player.points; - this.multiplier = player.multiplier; - - this.purchasedItems.clear(); - this.purchasedItems.addAll(player.purchasedItems); - } - } -} diff --git a/core/src/com/ilotterytea/maxoning/player/MaxonSavegame.java b/core/src/com/ilotterytea/maxoning/player/MaxonSavegame.java deleted file mode 100644 index 1b3646b..0000000 --- a/core/src/com/ilotterytea/maxoning/player/MaxonSavegame.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.ilotterytea.maxoning.player; - -import java.io.Serializable; -import java.util.ArrayList; - -/** - * Save-game data class. - * @author NotDankEnough - * @since Alpha 1.2 (Oct 02, 2022) - */ -public class MaxonSavegame implements Serializable { - /** Earned Squish Points. */ - public long points = 0L; - /** Multiplier. */ - public long multiplier = 1; - - /** Home inventory. */ - public ArrayList<Integer> inv = new ArrayList<>(); - /** Outside Inventory. */ - public ArrayList<Integer> outInv = new ArrayList<>(); - - /** Seed. */ - public long seed = System.currentTimeMillis(); - - /** Player name. */ - public String name = System.getProperty("user.name"); - /** Pet name. */ - public String petName = "Maxon"; - /** Pet ID. */ - public byte petId = 0; - - /** Elapsed time from game start. */ - public long elapsedTime = 0; - - /** Last timestamp when save game was used. */ - public long lastTimestamp = System.currentTimeMillis(); - - /** Location. */ - public short roomId = 0; -}
\ No newline at end of file diff --git a/core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt b/core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt deleted file mode 100644 index 1ad9106..0000000 --- a/core/src/com/ilotterytea/maxoning/player/utils/PetUtils.kt +++ /dev/null @@ -1,42 +0,0 @@ -package com.ilotterytea.maxoning.player.utils - -import com.badlogic.gdx.assets.AssetManager -import com.badlogic.gdx.graphics.Texture -import com.ilotterytea.maxoning.anim.SpriteUtils -import com.ilotterytea.maxoning.ui.AnimatedImage - -/** - * Utilities for some operations with pets. - */ -class PetUtils { - companion object { - @JvmStatic - /** - * Get animated image of pet by its ID. - * */ - fun animatedImageById(assetManager: AssetManager, id: Int) : AnimatedImage { - val img: AnimatedImage - - when (id) { - // Maxon: - 0 -> img = AnimatedImage(SpriteUtils.splitToTextureRegions( - assetManager.get( - "sprites/sheet/loadingCircle.png", - Texture::class.java - ), - 112, 112, 10, 5 - )) - // Maxon: - else -> img = AnimatedImage(SpriteUtils.splitToTextureRegions( - assetManager.get( - "sprites/sheet/loadingCircle.png", - Texture::class.java - ), - 112, 112, 10, 5 - )) - } - - return img - } - } -}
\ No newline at end of file |
