Commit eaa39454 authored by Aneta Steimarova's avatar Aneta Steimarova

#953 Added tweezers animation

parent a6b1c7b6
......@@ -32,6 +32,7 @@ public class SafeAssets {
private static final String MEDIUM = "medium/";
private static final String HARD = "hard/";
private static final String BONUS = "bonus/";
private static final String TWEEZERS = "tweezers/";
private static final String LIGHTS = "lights/";
private static final String VISUALIZATION = "visualization/";
private static final String ALPHABET = "alphabet/";
......@@ -116,7 +117,6 @@ public class SafeAssets {
public static final String MEDIUM_HARD_LIGHT4_GREY = GFX_PATH + LIGHTS + "4grey";
//======== SAFE BONUS =============
public static final String TWEEZERS = GFX_PATH + BONUS + "tweezers";
public static final String BOOM = GFX_PATH + BONUS + "boom";
public static final String BONUS_BACKGROUND = GFX_PATH + BONUS + "background";
......@@ -158,6 +158,15 @@ public class SafeAssets {
public static final String BONUS_LIGHT4_BLUE = GFX_PATH + BONUS + LIGHTS + "light4_blue";
public static final String BONUS_LIGHT4_GREY = GFX_PATH + BONUS + LIGHTS + "light4_grey";
public static final String TWEEZERS1 = GFX_PATH + BONUS + TWEEZERS + "tweezers1";
public static final String TWEEZERS2 = GFX_PATH + BONUS + TWEEZERS + "tweezers2";
public static final String TWEEZERS3 = GFX_PATH + BONUS + TWEEZERS + "tweezers3";
public static final String TWEEZERS4 = GFX_PATH + BONUS + TWEEZERS + "tweezers4";
public static final String TWEEZERS5 = GFX_PATH + BONUS + TWEEZERS + "tweezers5";
public static final String TWEEZERS6 = GFX_PATH + BONUS + TWEEZERS + "tweezers6";
public static final String TWEEZERS7 = GFX_PATH + BONUS + TWEEZERS + "tweezers7";
public static final String TWEEZERS8 = GFX_PATH + BONUS + TWEEZERS + "tweezers8";
//======== TEXTS =============
public static final String REPLAY_TEXT = "game_safe_replay";
public static final String SCORE_TEXT = "score";
......
......@@ -118,10 +118,10 @@ public class BonusCableGroup extends Group {
}
public void cut(SequenceAction sa) {
Image tweezers = new Image(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS));
Image tweezers = new Image(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS1));
tweezers.setSize(TWEEZERS_WIDTH, TWEEZERS_HEIGHT);
float tweezersXPos = cable.getX() + cable.getWidth();
float tweezersYPos = cable.getY() - tweezers.getHeight()/2 + 20;
float tweezersYPos = cable.getY() - tweezers.getHeight()/2 + 30;
tweezers.setPosition(tweezersXPos, tweezersYPos);
addActor(tweezers);
sa.addAction(Actions.sequence(Actions.run(new Runnable() {
......@@ -129,7 +129,49 @@ public class BonusCableGroup extends Group {
public void run() {
tweezers.addAction(Actions.moveTo(tweezersXPos - cable.getWidth()/2, tweezersYPos, 1f));
}
}), Actions.delay(1f),Actions.run(new Runnable() {
}), Actions.run(new Runnable() {
@Override
public void run() {
tweezers.setDrawable(new TextureRegionDrawable(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS2)));
}
}), Actions.delay(1f),
Actions.run(new Runnable() {
@Override
public void run() {
tweezers.setDrawable(new TextureRegionDrawable(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS3)));
}
}), Actions.delay(0.1f),
Actions.run(new Runnable() {
@Override
public void run() {
tweezers.setDrawable(new TextureRegionDrawable(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS4)));
}
}), Actions.delay(0.1f),
Actions.run(new Runnable() {
@Override
public void run() {
tweezers.setDrawable(new TextureRegionDrawable(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS5)));
}
}), Actions.delay(0.1f),
Actions.run(new Runnable() {
@Override
public void run() {
tweezers.setDrawable(new TextureRegionDrawable(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS6)));
}
}), Actions.delay(0.1f),
Actions.run(new Runnable() {
@Override
public void run() {
tweezers.setDrawable(new TextureRegionDrawable(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS7)));
}
}), Actions.delay(0.1f),
Actions.run(new Runnable() {
@Override
public void run() {
tweezers.setDrawable(new TextureRegionDrawable(safeGame.getScreenTextureRegion(SafeAssets.TWEEZERS8)));
}
}), Actions.delay(0.1f),
Actions.run(new Runnable() {
@Override
public void run() {
cable.setDrawable(new TextureRegionDrawable(cutCableImage));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment