diff --git a/core/src/cz/nic/tablexia/game/games/shooting_range/ShootingRangeGame.java b/core/src/cz/nic/tablexia/game/games/shooting_range/ShootingRangeGame.java index 2fd7bcbab42a52b4f7e21d872fb4544b2abf16e9..0f31559fb9f80b14e4dfabcd444481ed78deecff 100644 --- a/core/src/cz/nic/tablexia/game/games/shooting_range/ShootingRangeGame.java +++ b/core/src/cz/nic/tablexia/game/games/shooting_range/ShootingRangeGame.java @@ -51,9 +51,9 @@ public class ShootingRangeGame extends AbstractTablexiaGame<GameState> { getStage().addActor(scene = new Scene(gfxLibrary)); scene.setBounds(0, getStage().getCamera().position.y - getStage().getHeight() / 2, getStage().getWidth(), getStage().getHeight()); // scaling viewport camera y-position adjustment getStage().addActor(watch = new Watch(gfxLibrary)); - watch.setScale(0.5f); + watch.setScale(0.4f); getStage().addActor(carousel = new Carousel(gfxLibrary)); - carousel.setScale(0.5f); + carousel.setScale(0.6f); screenResized((int) getStage().getWidth(), (int) getStage().getHeight()); } @@ -61,7 +61,7 @@ public class ShootingRangeGame extends AbstractTablexiaGame<GameState> { protected void screenResized(int width, int height) { super.screenResized(width, height); watch.setPosition(0, getStage().getCamera().position.y - getStage().getHeight() / 2); - carousel.setPosition(getStage().getWidth() - carousel.getWidth() / 2, getStage().getHeight() + (getStage().getCamera().position.y - getStage().getHeight() / 2)); + carousel.setPosition(getStage().getWidth() - (carousel.getWidth() / 2 * carousel.getScaleX()), getStage().getCamera().position.y + (getStage().getHeight() / 2) - (carousel.getHeight() / 2 * carousel.getScaleY())); } public String getVictoryText(int progress) { diff --git a/core/src/cz/nic/tablexia/game/games/shooting_range/actions/HitAction.java b/core/src/cz/nic/tablexia/game/games/shooting_range/actions/HitAction.java new file mode 100644 index 0000000000000000000000000000000000000000..3c02ac6c30b1131622ace3779bd266a8bc727b58 --- /dev/null +++ b/core/src/cz/nic/tablexia/game/games/shooting_range/actions/HitAction.java @@ -0,0 +1,16 @@ +package cz.nic.tablexia.game.games.shooting_range.actions; + +import com.badlogic.gdx.scenes.scene2d.actions.ScaleToAction; + +import cz.nic.tablexia.game.games.shooting_range.actors.Target; + +/** + * Created by lhoracek on 6/26/15. + */ +public class HitAction extends ScaleToAction { + public HitAction(Target target) { + setTarget(target); + setX(1f); + setY(0.1f); + } +} diff --git a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Carousel.java b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Carousel.java index a674c962bbef0c1c7d904f1a38add514ce9b9436..7883a5ab9185956643ac67d6acdc1a8493342b4a 100644 --- a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Carousel.java +++ b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Carousel.java @@ -1,6 +1,9 @@ package cz.nic.tablexia.game.games.shooting_range.actors; +import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.scenes.scene2d.Group; +import com.badlogic.gdx.scenes.scene2d.Touchable; +import com.badlogic.gdx.scenes.scene2d.actions.Actions; import com.badlogic.gdx.scenes.scene2d.ui.Image; import cz.nic.tablexia.game.common.media.GfxLibrary; @@ -11,11 +14,23 @@ import cz.nic.tablexia.game.games.shooting_range.media.Textures; */ public class Carousel extends Group { private Image carouselBase; + private Image flower; public Carousel(GfxLibrary gfxLibrary) { addActor(carouselBase = new Image(gfxLibrary.getTextureRegion(Textures.CAROUSEL))); setSize(carouselBase.getWidth(), carouselBase.getHeight()); + setTouchable(Touchable.disabled); } + public void nextFlower(final Flower flower) { + final Image oldFlower = this.flower; + this.flower = flower; + addActor(flower); + flower.setRotation((360 - getRotation()) + (250 % 360)); + flower.setX((getWidth() / 10) * ((getRotation() == 180) || (getRotation() == 270) ? 3 : 7)); + flower.setY((getHeight() / 10) * ((getRotation() == 0) || (getRotation() == 270) ? 3 : 7)); + flower.setScale(0.6f); + addAction(Actions.sequence(Actions.rotateBy(-90, 0.5f, Interpolation.elasticOut), Actions.removeActor(oldFlower))); + } } diff --git a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Flower.java b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Flower.java new file mode 100644 index 0000000000000000000000000000000000000000..dc4cd52d3a17fb0a86eeffe32d703f860ed8a933 --- /dev/null +++ b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Flower.java @@ -0,0 +1,15 @@ +package cz.nic.tablexia.game.games.shooting_range.actors; + +import com.badlogic.gdx.graphics.Texture; + +import cz.nic.tablexia.game.games.shooting_range.media.Textures; +import cz.nic.tablexia.game.games.shooting_range.model.Wave; + +/** + * Created by lhoracek on 6/26/15. + */ +public class Flower extends Target { + public Flower(float x, float y, Texture texture, Float startTime, Wave wave, Textures textureType) { + super(x, y, texture, startTime, wave, textureType); + } +} diff --git a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Scene.java b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Scene.java index 4bd4717cbef223ad3cc6a547b53fb1abae46e85b..d2bbd7ed67b521ed81e8d02cbe5c10bc662af16b 100644 --- a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Scene.java +++ b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Scene.java @@ -29,8 +29,8 @@ public class Scene extends Group { background.setSize(getWidth(), getHeight()); frame.setSize(getWidth(), getHeight()); - row1.setSize(getWidth(), getHeight()/5*3); - row2.setSize(getWidth(), getHeight()/5*2); - row3.setSize(getWidth(), getHeight()/5*1); + row1.setSize(getWidth(), getHeight()/10*7); + row2.setSize(getWidth(), getHeight()/10*5); + row3.setSize(getWidth(), getHeight()/10*3); } } diff --git a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Target.java b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Target.java index e7df8365002b89c317ede095b1718c247689f642..176679a9533b375758dd957d5ae7c0bd0579796a 100644 --- a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Target.java +++ b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Target.java @@ -29,17 +29,13 @@ public class Target extends Image { }; } - public Target(float pX, float pY, float pWidth, float pHeight, Texture texture, Float startTime, Wave wave, Textures textureType) { + public Target(float x, float y, Texture texture, Float startTime, Wave wave, Textures textureType) { + super(texture); + setX(x); + setY(y); this.startTime = startTime; this.textureType = textureType; this.wave = wave; - - // TODO - //overlay = new Sprite(pWidth / 2, pHeight / 2, pWidth, pHeight, , pVertexBufferObjectManager); - //overlay.setColor(1, 1, 1, 1); - //overlay.setColor(1, 0, 0, 1); - //overlay.setAlpha(0); - //attachChild(overlay); } diff --git a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Watch.java b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Watch.java index 61d894b4143526082e71818b15323fb4c8eade74..516f07bb7189933e772ea4f78e11cf7e3f8ee0ff 100644 --- a/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Watch.java +++ b/core/src/cz/nic/tablexia/game/games/shooting_range/actors/Watch.java @@ -1,6 +1,7 @@ package cz.nic.tablexia.game.games.shooting_range.actors; import com.badlogic.gdx.scenes.scene2d.Group; +import com.badlogic.gdx.scenes.scene2d.Touchable; import com.badlogic.gdx.scenes.scene2d.actions.Actions; import com.badlogic.gdx.scenes.scene2d.ui.Image; @@ -17,7 +18,8 @@ public class Watch extends Group{ addActor(watch = new Image(gfxLibrary.getTextureRegion(Textures.WATCH))); addActor(watchHand = new Image(gfxLibrary.getTextureRegion(Textures.WATCH_HAND))); watchHand.setPosition(254, 166); - watchHand.setOrigin(watchHand.getWidth()/2, 15); - watchHand.addAction(Actions.forever(Actions.rotateBy(-360,2))); + watchHand.setOrigin(watchHand.getWidth() / 2, 15); + watchHand.addAction(Actions.forever(Actions.rotateBy(-360, 2))); + setTouchable(Touchable.disabled); } } diff --git a/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java b/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java index 5bc3b4c177a0b77ed2fa98b857c19f698e3af855..ec009248e8d616935c7affbbd733c60dce2e375a 100644 --- a/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java +++ b/core/src/cz/nic/tablexia/screen/createuser/FormScreen.java @@ -146,7 +146,7 @@ public class FormScreen extends AbstractTablexiaScreen<Void> { sl.switchToStep(1); sl.setDisabledPoint(middle); - // TODO pencil and stamp layers + // pencil and stamp layers group.addActor(pen = ScaleUtil.createImageWidthPosition(getScreenTextureRegion(GFX_PATH + "pencil_dropped"), getStage().getWidth() * 0.2f, getStage().getWidth() * 0.85f, getStage().getWidth() * -0.13f)); group.addActor(stamp = ScaleUtil.createImageWidthPosition(getScreenTextureRegion(GFX_PATH + "stamp_left_dropped"), getStage().getWidth() * 0.2f, getStage().getWidth() * -0.01f, getStage().getWidth() * -0.05f)); pen.addListener(new DragActorListener(pen, true, new DragActorListener.DragDropListener() { @@ -276,9 +276,7 @@ public class FormScreen extends AbstractTablexiaScreen<Void> { return false; } }); - // TODO show sign dialog - - + // show sign dialog getStage().addActor(signature); Dialog dialog = new SignatureDialog(getStage().getWidth() * 0.1f, getStage().getWidth() * 0.1f - (getStage().getCamera().position.y - getStage().getHeight() / 2) / 2, getStage().getWidth() * 0.8f, getStage().getHeight() * 0.8f).show(getStage()); }