Skip to content

Commit

Permalink
Level Name Working
Browse files Browse the repository at this point in the history
  • Loading branch information
lavendthomas committed Jul 17, 2018
1 parent 3663d73 commit 71e36cf
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
.DS_Store
/build
/captures
/app/release
.externalNativeBuild
Binary file added app/release/app-release.apk
Binary file not shown.
1 change: 1 addition & 0 deletions app/release/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ protected void onCreate(Bundle savedInstanceState) {
images.put(type.getId(), bitmap);
}


gestureDetector = new GestureDetectorCompat(this, this);
gestureDetector.setOnDoubleTapListener(this);

Expand All @@ -105,7 +104,7 @@ private int getBlockSize() {


private void update() {

setTitle(level.getName());
//Remove all images
grid.removeAllViews();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ public LevelPack() {
*/
public Level getCurrentLevel() throws WrongFileFormatException {
try {
return Level.load(getAssets().open("levels/"+currentLevel));
Level level = Level.load(getAssets().open("levels/"+currentLevel));
level.setLevelName(currentLevel);
return level;
} catch (WrongFileFormatException | IOException e) {
throw new WrongFileFormatException(e);
}
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/be/ac/umons/babaisyou/game/Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,17 @@ void oppositeBlockDirection(BlockType type, Position position) {
void setWon(boolean hasWon) {
this.hasWon = hasWon;
}

/**
* Fixe le nom du niveau
*/
public void setLevelName(String name) {
levelName = name;
}
public String getName() {
return levelName;
}


/**
* Renvoie tous les élements à une position sous forme de chaîne de charactères.
Expand Down

0 comments on commit 71e36cf

Please sign in to comment.