Skip to content

Commit

Permalink
New Sounds + Refractor MockupG3 #48
Browse files Browse the repository at this point in the history
- New bip sounds
- MockupG3 has been refractored a bit, the text is clear now
- Link to ISTdex and the choosing language option have been removed temporaly
  • Loading branch information
FrancoisDuchene committed Feb 10, 2020
1 parent 0251c0c commit ddce17e
Show file tree
Hide file tree
Showing 23 changed files with 70 additions and 20 deletions.
Binary file added kapotopia/android/assets/sound/bruitage/bip1.ogg
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/bip2.ogg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/bip5.ogg
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/bip6.ogg
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/bip7.ogg
Binary file not shown.
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/boup2.ogg
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/boup3.ogg
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/boup4.ogg
Binary file not shown.
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/boup6.ogg
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/boup7.ogg
Binary file not shown.
Binary file not shown.
Binary file added kapotopia/android/assets/sound/bruitage/boup9.ogg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public static String getSoundPath(UseSound sound) {
case SUCCESS:
result = "sound/bruitage/leszek-szary_success-1.wav";
break;
case BOUP1:
result = "sound/bruitage/boup1.ogg";
break;
case BOUP9:
result = "sound/bruitage/boup9.ogg";
break;
default:
result = null;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ public enum UseSound {
PAUSE,
POWER_UP,
PUNCH,
SUCCESS
SUCCESS,
BOUP1,
BOUP9
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class ChoosingDifficultyScreen implements Screen {

private final ScreenType nextScreen;

private final String TAG = "difficultyScreen";
private final String BTN_PATH = "ImagesGadgets/Bouton.png";

// Animation
Expand Down Expand Up @@ -171,7 +170,7 @@ public void changed(ChangeEvent event, Actor actor) {
stage.addActor(hardBtn);
stage.addActor(infiniteBtn);

AssetsManager.getInstance().addStage(stage, TAG);
AssetsManager.getInstance().addStage(stage, this.getClass().getName());
}

@Override
Expand Down
15 changes: 13 additions & 2 deletions kapotopia/core/src/gdx/kapotopia/Screens/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
import com.badlogic.gdx.graphics.g2d.Animation;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;

import gdx.kapotopia.Animations.NeonDoorAnimation;
import gdx.kapotopia.AssetsManaging.AssetsManager;
Expand All @@ -25,6 +27,7 @@
import gdx.kapotopia.Kapotopia;
import gdx.kapotopia.Localisation;
import gdx.kapotopia.ScreenType;
import sun.security.util.ByteArrayLexOrder;

public class MainMenu implements Screen {

Expand Down Expand Up @@ -63,6 +66,7 @@ public MainMenu(final Kapotopia game) {

// Import sounds
this.pauseSound = SoundHelper.getSound(UseSound.PAUSE);
final Sound blocked = SoundHelper.getSound(UseSound.HINT);

//Import fonts
TextButton.TextButtonStyle style = FontHelper.getStyleFont(UseFont.AESTHETIC_NORMAL_WHITE);
Expand All @@ -77,8 +81,15 @@ public MainMenu(final Kapotopia game) {
.withStyle(style).withPosition(x*0.82f, y * 0.43f)
.withListener(new ChangeScreenListener(game, ScreenType.WORLD2)).build();
final TextButton world4 = new TextButtonBuilder(Localisation.getInstance().getString("text_istdex"))
.withStyle(style).withPosition(x, y * 0.2f)
.withListener(new ChangeScreenListener(game, ScreenType.WORLD4)).build();
.withStyle(style).withPosition(x, y * 0.2f).withListener(new ChangeListener() {
@Override
public void changed(ChangeEvent event, Actor actor) {

blocked.play();
}
})
//.withListener(new ChangeScreenListener(game, ScreenType.WORLD4))
.build();
final TextButton optionsBtn = new TextButtonBuilder("Options").withStyle(style).withPosition(x / 3, y * 0.01f)
.withListener(new ChangeScreenListener(game, ScreenType.OPTIONS)).build();

Expand Down
15 changes: 13 additions & 2 deletions kapotopia/core/src/gdx/kapotopia/Screens/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
Expand All @@ -13,7 +14,9 @@
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;

import gdx.kapotopia.AssetsManaging.AssetsManager;
import gdx.kapotopia.AssetsManaging.SoundHelper;
import gdx.kapotopia.AssetsManaging.UseFont;
import gdx.kapotopia.AssetsManaging.UseSound;
import gdx.kapotopia.Helpers.Alignement;
import gdx.kapotopia.Helpers.Builders.ImageBuilder;
import gdx.kapotopia.Helpers.Builders.ImageButtonBuilder;
Expand All @@ -35,6 +38,9 @@ public class Options implements Screen {
private Skin skin;
private Image fond;

private Sound soundOnSound;
private Sound soundOffSound;

private SelectBox<String> languageSelect;
private ImageButton soundOnBtn;
private ImageButton soundOffBtn;
Expand All @@ -45,9 +51,12 @@ public Options(final Kapotopia game) {
this.stage = new Stage(game.viewport);
settings = game.getSettings();

fond = new ImageBuilder().withTexture("FondNiveauBlanc2.png").isVisible(true).build();
fond = new ImageBuilder().withTexture("game3/Porte.png").isVisible(true).build();
skin = AssetsManager.getInstance().getSkinByPath("skins/comic/skin/comic-ui.json");

soundOnSound = SoundHelper.getSound(UseSound.BOUP9);
soundOffSound = SoundHelper.getSound(UseSound.BOUP1);

languageSelect = new SelectBoxBuilder<String>().withSkin(skin).withItems(settings.getSupportedLangsText())
.withPosition(game.viewport.getWorldWidth() / 4, 300)
.withSize(game.viewport.getWorldWidth() / 2, 60)
Expand Down Expand Up @@ -76,7 +85,7 @@ public void changed(ChangeEvent event, Actor actor) {
.withStyle(UseFont.CLASSIC_BOLD_NORMAL_YELLOW).withAlignment(Alignement.CENTER).build();

stage.addActor(fond);
stage.addActor(languageSelect);
//stage.addActor(languageSelect);
stage.addActor(soundOnBtn);
stage.addActor(soundOffBtn);
stage.addActor(backBtn);
Expand Down Expand Up @@ -128,6 +137,8 @@ public void changed(ChangeEvent event, Actor actor) {
settings.toggleMusic();
soundOnBtn.setVisible(settings.isMusicOn());
soundOffBtn.setVisible(!settings.isMusicOn());
if (soundOnBtn.isVisible()) soundOnSound.play();
else soundOffSound.play();
}
}
}
13 changes: 2 additions & 11 deletions kapotopia/core/src/gdx/kapotopia/Screens/World2.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,9 @@ public World2(final Kapotopia game) {

TextButton.TextButtonStyle style = FontHelper.getStyleFont(UseFont.AESTHETIC_NORMAL_BLACK);

I18NBundle languageStrings = I18NBundle.createBundle(Gdx.files.internal("strings/strings"));
String instr_string = languageStrings.get("game3_instr");

Label instr = new Label(instr_string, new Label.LabelStyle(style.font, Color.BLACK));
float x = game.viewport.getWorldWidth() / 12f;
float y = game.viewport.getWorldHeight()*3 / 4;
instr.setPosition(x,y);

final Button play = new TextButton(Localisation.getInstance().getString("play_button"), style);
x = game.viewport.getWorldWidth() / 2.5f;
y = game.viewport.getWorldHeight() / 4;
float x = game.viewport.getWorldWidth() / 2.5f;
float y = game.viewport.getWorldHeight() / 4;
play.setPosition(x,y);
play.addListener(new ChangeListener() {
@Override
Expand All @@ -69,7 +61,6 @@ public void run() {
}
});

stage.addActor(instr);
stage.addActor(play);

AssetsManager.getInstance().addStage(stage, "world2");
Expand Down
34 changes: 32 additions & 2 deletions kapotopia/core/src/gdx/kapotopia/Screens/mockupG3.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,47 @@
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Image;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.utils.I18NBundle;

import gdx.kapotopia.Helpers.Builders.ImageBuilder;
import gdx.kapotopia.Helpers.Builders.LabelBuilder;
import gdx.kapotopia.Kapotopia;
import gdx.kapotopia.Localisation;
import gdx.kapotopia.ScreenType;

public class mockupG3 extends CinematicScreen {

public mockupG3(final Kapotopia game) {
super(game, new Stage(game.viewport), "mockupG3");

Localisation loc = Localisation.getInstance();

final Label[][] labels = new Label[][] {
{

},
{
new LabelBuilder(loc.getString("game3_instr"))
.withPosition(Kapotopia.ONE_CHARACTER_STD_WIDTH, (game.viewport.getWorldHeight() / 2))
.withWidth(game.viewport.getWorldWidth() - (2 * Kapotopia.ONE_CHARACTER_STD_WIDTH))
.withHeight(Kapotopia.ONE_CHARACTER_STD_HEIGHT * 10).isWrapped(true)
.build()
}
};

final Image[][] images = new Image[][] {
{
new ImageBuilder().withTexture("game3/Monde2Ecran2.png").build()
},
{
new ImageBuilder().withTexture("game3/Monde2Ecran3.png").build()
}
};

this.applyBundle(new ParameterBundleBuilder(ScreenType.GAME3)
.withTextures(new String[]{"game3/Monde2Ecran2.png",
"game3/Monde2Ecran3.png"}).withFinishBtn(false));
.withImages(images).withLabels(labels).withFinishBtn(false));
}

@Override
Expand Down

0 comments on commit ddce17e

Please sign in to comment.