Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/rc' into Adrian
Browse files Browse the repository at this point in the history
# Conflicts:
#	Player.java
  • Loading branch information
reihoron committed Jun 12, 2024
2 parents de4f2b8 + 12d5400 commit 18427bb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Level.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,6 @@ public void checkToSave() {
FileWriter out = new FileWriter("saveFile1.csv");
PrintWriter output = new PrintWriter(out);
output.println(totalHP + "," + totalCoins + "," + level);
//output.println(totalCoins + ",");
//output.println(level);
output.close();
} catch (IOException e) {

Expand Down
7 changes: 4 additions & 3 deletions Level1.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ public Level1() {
super();
scroll = new ImgScroll(this, new GreenfootImage(background), worldSize[0], worldSize[1]);
spawnFloor(scroll);
addObject(player = new Player(), 100, 622);
addObject(player = new Player(), 130, 140);
addObject(coinLabel, 1100, 10);
addObject(saveButton, getWidth() - 100, 40);

// Individual Block Placement
int[][] blockGeneration = new int[120][20];
blockGeneration[2][5] = 1;
int[][] blockGeneration = loadLevel(1);
spawnTerrain(blockGeneration);
}

public void act() {
followPlayer(scroll, player);
updateCoin(coinLabel);
checkSaveButton();
}
}
4 changes: 2 additions & 2 deletions Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ protected void jumpBoost() {
}

private void fall() {
if (getOneObjectAtOffset(getImage().getWidth() / 2, (getImage().getHeight() / 2) + 1, Brick.class) == null && jumpActs < 15) {
if (getOneObjectAtOffset(-(getImage().getWidth() / 2), (getImage().getHeight() / 2) + 1, Brick.class) == null && jumpActs < 15) {
if (getOneObjectAtOffset(getImage().getWidth() / 2 - 2, (getImage().getHeight() / 2) + 1, Brick.class) == null && jumpActs < 15) {
if (getOneObjectAtOffset(-(getImage().getWidth() / 2 - 2), (getImage().getHeight() / 2) + 1, Brick.class) == null && jumpActs < 15) {
setLocation(getX(), getY() + 8);
}
}
Expand Down
24 changes: 24 additions & 0 deletions levels/1.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
2,8,1
2,7,1
2,6,1
2,5,1
2,4,1
2,3,1
2,9,1
2,10,1
4,8,1
4,7,1
4,6,1
4,5,1
4,4,1
4,3,1
4,9,1
4,10,1
6,8,1
6,7,1
6,6,1
6,5,1
6,4,1
6,3,1
6,9,1
6,10,1

0 comments on commit 18427bb

Please sign in to comment.