summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/i18n/en_us.json5
-rw-r--r--assets/i18n/ru_ru.json5
-rw-r--r--assets/sprites/gui/widgets.atlas47
-rw-r--r--assets/sprites/gui/widgets.pngbin2047 -> 4897 bytes
-rw-r--r--assets/sprites/gui/widgets.skin3
-rw-r--r--core/src/com/ilotterytea/maxoning/screens/GameScreen.java83
6 files changed, 123 insertions, 20 deletions
diff --git a/assets/i18n/en_us.json b/assets/i18n/en_us.json
index 390a9a5..215562a 100644
--- a/assets/i18n/en_us.json
+++ b/assets/i18n/en_us.json
@@ -28,6 +28,11 @@
"dialogs.not_enough_points": "Not enough points!",
+ "gifts.empty": "[RED]Empty!{CLEARCOLOR}",
+ "gifts.multiplier": "[YELLOW]{WAVE=1.0;1.0;0.5}+%s Multiplier{ENDWAVE}{CLEARCOLOR}",
+ "gifts.points": "[ORANGE]{WAVE=1.0;1.0;0.5}+%s Points{ENDWAVE}{CLEARCOLOR}",
+ "gifts.new_pet": "{RAINBOW}{WAVE=1.0;1.0;0.5}New pet! (%s){ENDWAVE}{ENDRAINBOW}",
+
"game.inventory.title": "Inventory",
"pet.bror.name": "The Suspicious and Sleepy Bro",
diff --git a/assets/i18n/ru_ru.json b/assets/i18n/ru_ru.json
index 5ebd598..205be62 100644
--- a/assets/i18n/ru_ru.json
+++ b/assets/i18n/ru_ru.json
@@ -30,6 +30,11 @@
"dialogs.not_enough_points": "Недостаточно поинтов!",
+ "gifts.empty": "[RED]Пусто!{CLEARCOLOR}",
+ "gifts.multiplier": "[YELLOW]{WAVE=1.0;1.0;0.5}+%s к множителю жмяканий{ENDWAVE}{CLEARCOLOR}",
+ "gifts.points": "[YELLOW]{WAVE=1.0;1.0;0.5}+%s поинтов{ENDWAVE}{CLEARCOLOR}",
+ "gifts.new_pet": "{RAINBOW}{WAVE=1.0;1.0;0.5}Новый питомец! (%s){ENDWAVE}{ENDRAINBOW}",
+
"pet.bror.name": "Cонный Брор ",
"pet.bror.desc": "Засыпающий Брор поможет тебе гладить Максона практически до потери сознания.",
diff --git a/assets/sprites/gui/widgets.atlas b/assets/sprites/gui/widgets.atlas
index e18dfc6..304b75e 100644
--- a/assets/sprites/gui/widgets.atlas
+++ b/assets/sprites/gui/widgets.atlas
@@ -1,91 +1,98 @@
widgets.png
-size: 128, 32
+size: 256, 128
format: RGBA8888
filter: Nearest, Nearest
repeat: none
coin
rotate: false
- xy: 1, 0
+ xy: 124, 96
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
down
rotate: false
- xy: 18, 16
+ xy: 140, 112
size: 16, 16
- split: 4, 4, 4, 4
- pad: 4, 4, 4, 4
+ split: 2, 2, 2, 2
+ pad: 2, 2, 2, 2
orig: 16, 16
offset: 0, 0
index: -1
frame
rotate: false
- xy: 18, 0
+ xy: 124, 80
size: 16, 16
- split: 3, 3, 3, 3
- pad: 3, 3, 3, 3
+ split: 1, 1, 1, 1
+ pad: 1, 1, 1, 1
orig: 16, 16
offset: 0, 0
index: -1
gradient
rotate: false
- xy: 1, 16
+ xy: 124, 112
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
lvlup
rotate: false
- xy: 69, 0
+ xy: 172, 112
size: 14, 16
orig: 14, 16
offset: 0, 0
index: -1
multiplier
rotate: false
- xy: 35, 0
+ xy: 156, 112
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
over
rotate: false
- xy: 52, 16
+ xy: 124, 64
size: 16, 16
- split: 4, 4, 4, 4
- pad: 4, 4, 4, 4
+ split: 2, 2, 2, 2
+ pad: 2, 2, 2, 2
orig: 16, 16
offset: 0, 0
index: -1
+package
+ rotate: false
+ xy: 0, 0
+ size: 124, 128
+ orig: 124, 128
+ offset: 0, 0
+ index: -1
settings
rotate: false
- xy: 86, 18
+ xy: 124, 50
size: 14, 14
orig: 14, 14
offset: 0, 0
index: -1
shop
rotate: false
- xy: 35, 16
+ xy: 140, 96
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
tile
rotate: false
- xy: 69, 16
+ xy: 156, 96
size: 16, 16
orig: 16, 16
offset: 0, 0
index: -1
up
rotate: false
- xy: 52, 0
+ xy: 140, 80
size: 16, 16
- split: 4, 4, 4, 4
- pad: 4, 4, 4, 4
+ split: 2, 2, 2, 2
+ pad: 2, 2, 2, 2
orig: 16, 16
offset: 0, 0
index: -1
diff --git a/assets/sprites/gui/widgets.png b/assets/sprites/gui/widgets.png
index 2e0816a..f823239 100644
--- a/assets/sprites/gui/widgets.png
+++ b/assets/sprites/gui/widgets.png
Binary files differ
diff --git a/assets/sprites/gui/widgets.skin b/assets/sprites/gui/widgets.skin
index 86755cd..0d13f41 100644
--- a/assets/sprites/gui/widgets.skin
+++ b/assets/sprites/gui/widgets.skin
@@ -66,6 +66,9 @@
},
shop: {
up: shop
+ },
+ gift: {
+ up: package
}
},
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
diff --git a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
index 792b20f..ff72457 100644
--- a/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
+++ b/core/src/com/ilotterytea/maxoning/screens/GameScreen.java
@@ -246,6 +246,89 @@ public class GameScreen implements Screen, InputProcessor {
}
}, 5, 5);
+ // Random gifts:
+ Timer.schedule(new Timer.Task() {
+ @Override
+ public void run() {
+ final ImageButton gift = new ImageButton(widgetSkin, "gift");
+ gift.setPosition(stage.getWidth() + gift.getWidth(), Math.getRandomNumber((int) gift.getHeight(), (int) stage.getHeight() - (int) gift.getHeight()));
+ gift.addAction(
+ Actions.repeat(
+ 3,
+ Actions.sequence(
+ Actions.moveTo(-gift.getWidth(), gift.getY(), 15f, Interpolation.linear),
+ Actions.moveTo(stage.getWidth() + gift.getWidth(), Math.getRandomNumber((int) gift.getHeight(), (int) stage.getHeight() - (int) gift.getHeight()), 15f, Interpolation.linear)
+ )
+ )
+ );
+
+
+ gift.addListener(new ClickListener() {
+ @Override
+ public void clicked(InputEvent event, float x, float y) {
+ int giftId = Math.getRandomNumber(0, 25);
+ final TypingLabel label = new TypingLabel(game.locale.TranslatableText("gifts.empty"), skin);
+
+ switch (giftId) {
+ // Points
+ case 0:
+ int randPoints = Math.getRandomNumber(150, 3000);
+ label.setText(game.locale.FormattedText("gifts.points", String.valueOf(randPoints)));
+ player.points += randPoints;
+ break;
+
+ // Multiplier
+ case 1:
+ int randMp = Math.getRandomNumber(1, 10);
+ label.setText(game.locale.FormattedText("gifts.multiplier", String.valueOf(randMp)));
+ player.multiplier += randMp;
+ break;
+
+
+ // Random pet
+ case 2:
+ int randPet = Math.getRandomNumber(0, 1);
+ assert MaxonItemRegister.get(randPet) != null;
+ String name = MaxonItemRegister.get(randPet).name;
+ label.setText(game.locale.FormattedText("gifts.new_pet", name));
+ player.inv.add(randPet);
+ if (invItems.containsKey(randPet)) {
+ invItems.put(randPet, invItems.get(randPet) + 1);
+ } else {
+ invItems.put(randPet, 1);
+ }
+ break;
+ // Default
+ default:
+ break;
+ }
+
+ label.setPosition(
+ gift.getX(),
+ gift.getY()
+ );
+
+ label.addAction(Actions.sequence(
+ Actions.delay(3f),
+ Actions.fadeOut(2f)
+ ));
+
+ stage.addActor(label);
+ gift.remove();
+
+ Timer.schedule(new Timer.Task() {
+ @Override
+ public void run() {
+ label.remove();
+ }
+ }, 5f);
+ }
+ });
+
+ stage.addActor(gift);
+ }
+ }, 600, 600);
+
render(Gdx.graphics.getDeltaTime());
}