Skip to content

Commit

Permalink
Merge pull request #168 from YizhenWu2004/yizhen_updateasset_debug
Browse files Browse the repository at this point in the history
a huge wave of update is coming
  • Loading branch information
YizhenWu2004 authored May 18, 2024
2 parents 9459796 + 8930c75 commit 1bd8f43
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 50 deletions.
Binary file modified assets/menu_option/controls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/options_pause/control_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ public void handleCollision(Player p, Trash t) {
}

private void addOrder(Customer order) {
System.out.println("Adding order" + order);
//System.out.println("Adding order" + order);
if (takenOrders.size >= 3) {
takenOrders.removeIndex(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public CustomerAIController(Array<TableObstacle> tables, Customer customer,Shado
this.shadow = shadow;
this.directory = directory;
r = new Random();
System.out.println("customer created");
//System.out.println("customer created");
}


Expand Down Expand Up @@ -153,7 +153,7 @@ public void setGoal() {
customer.seatIndex = 1;
break;
} else if (!t.isOccupied(0)) {
System.out.println(idx);
//System.out.println(idx);
goal = t.occupy(0);
customer.table = t;
customer.seatIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public MainMenuController(GameCanvas canvas, InputController input, SaveControll
back1.resetStyleProperties();
},setting_buttons);

UIButton back2 = new UIButton(back,"exit",150,150,canvas);
UIButton back2 = new UIButton(back,"exit",320,123,canvas);
final boolean [] soundPlayed7 = {false};
addButton(back2, ()-> {
sounds.clickPlay();
Expand Down Expand Up @@ -454,7 +454,7 @@ public void update() {
} else if (on_audio){

musicbars = (int)(sounds.getmusic() * 5);
System.out.println("music: " + sounds.getmusic());
//System.out.println("music: " + sounds.getmusic());
sfxbars = (int)(sounds.getsfx() * 5);
// System.out.println("on audio");
checkButtons(audio_buttons);
Expand Down
9 changes: 4 additions & 5 deletions core/src/com/raccoon/mygame/controllers/MenuController.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public MenuController(GameCanvas canvas, Texture background, InputController inp
this.pause_background = background;
this.canvas = canvas;
this.input = input;
System.out.println(s.getmusic());
System.out.println(s.getsfx());
//System.out.println(s.getmusic());
//System.out.println(s.getsfx());
// musicbar = (int)(s.getmusic() * 5);
// sfxbar = (int)(s.getsfx() * 5);

Expand Down Expand Up @@ -233,7 +233,7 @@ public MenuController(GameCanvas canvas, Texture background, InputController inp
back_.setTexture(back_button_hover);
},back_::resetStyleProperties,opt_buttons);

UIButton back2 = new UIButton(back,"restart",520,125,canvas);
UIButton back2 = new UIButton(back,"restart",530,135,canvas);
addButton(back2, ()-> {
sounds.clickPlay();
this.cont_back = true;
Expand All @@ -245,7 +245,7 @@ public MenuController(GameCanvas canvas, Texture background, InputController inp
back2.setTexture(back_button_hover);
},back2::resetStyleProperties,cont_buttons);

UIButton back3 = new UIButton(back,"restart",520,200,canvas);
UIButton back3 = new UIButton(back,"restart",535,150,canvas);
addButton(back3, ()-> {
sounds.clickPlay();
this.aud_back = true;
Expand Down Expand Up @@ -301,7 +301,6 @@ public void draw(){
canvas.draw(cont_background, Color.WHITE, 0, 0,
0, 0, 0.0f, 1f, 1f);
for(UIButton button : cont_buttons) {
System.out.println("on control");
button.draw(canvas);
}
} else if (on_audio){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ public void setCustomers(Array<Array<String>> customerData){
customerOrders.add(new Array<>(new String[]{"448", "1", "red", "yellow", "orange"}));

for(Array<String> arr : customerOrders){
System.out.println(arr);
//System.out.println(arr);
int time = Integer.parseInt(arr.get(0));
arr.removeIndex(0);
Customer customer1 = new Customer(0f, 7.5f, 1f, 0.7f, goatIdle, world, canvas, 1, time,arr,directory);
Expand Down Expand Up @@ -524,12 +524,12 @@ public void update() {
player.current = this.current;

if(isEndless){
System.out.println(infTimer);
System.out.println(customersToAdd.size);
//System.out.println(infTimer);
//System.out.println(customersToAdd.size);
for(Customer c: customersToAdd){
// System.out.println(c.showUpTime);
if(c.showUpTime <= infTimer && paused == false){
System.out.println("c.showUpTime" + c.showUpTime + "infTimer" + infTimer);
//System.out.println("c.showUpTime" + c.showUpTime + "infTimer" + infTimer);
customers.add(c);
sounds.doorPlay();
drawableObjects.add(c);
Expand Down
8 changes: 4 additions & 4 deletions core/src/com/raccoon/mygame/controllers/SoundController.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public void incmusic(){
} else {
musicVol = 1.6f;
}
System.out.println("music volume: " + musicVol);
//System.out.println("music volume: " + musicVol);
}
public void decmusic(){
if(musicVol > 0.0f){
Expand All @@ -182,7 +182,7 @@ public void decmusic(){
} else {
musicVol = 0.0f;
}
System.out.println("music volume: " + musicVol);
//System.out.println("music volume: " + musicVol);
}

public void incsfx(){
Expand All @@ -191,7 +191,7 @@ public void incsfx(){
} else {
sfxvol = 1.6f;
}
System.out.println("sfx volume: " + sfxvol);
//System.out.println("sfx volume: " + sfxvol);
}

public void decsfx(){
Expand All @@ -204,7 +204,7 @@ public void decsfx(){
} else {
sfxvol = 0.0f;
}
System.out.println("sfx volume: " + sfxvol);
//System.out.println("sfx volume: " + sfxvol);
}
public void cafeeactualstop(){
cafeSong.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public SplashScreenController(GameCanvas canvas){
videoPlayer.setOnCompletionListener(new VideoPlayer.CompletionListener() {
@Override
public void onCompletionListener(FileHandle file) {
System.out.println("Video done playing!");
//System.out.println("Video done playing!");
videoDonePlaying = true;
}
});
Expand Down
6 changes: 3 additions & 3 deletions core/src/com/raccoon/mygame/controllers/StoreController.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public void setLevel(LevelModel level, Inventory sharedInv) {
guards = level.getGuards();
// guards = new Array<Guard>(1);
// guards.add(new Guard(20f, 10, 1.67f, 0.83f, guardIdle, world, canvas, PatrolDirection.ROTATE_CCW,collisionLayer,new Array<>(), GuardAIController.GuardOrientation.LEFT));
System.out.println("Size: " + level.getIngredients().size);
//System.out.println("Size: " + level.getIngredients().size);
ingredients = level.getIngredients();
// for(Ingredient i: ingredients){
// ingredientTextures.put(i.type, new Texture("720/" + i.type + ".png"));
Expand Down Expand Up @@ -754,8 +754,8 @@ private Texture getIngredientTexture(String id){
try{
return ingredientTextures.get(id);
} catch(Exception e){
System.out.println("This texture does not exist yet");
System.out.println(e);
//System.out.println("This texture does not exist yet");
//System.out.println(e);
}
return apple;
}
Expand Down
66 changes: 41 additions & 25 deletions core/src/com/raccoon/mygame/game/GDXRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public void restart(){
// sounds.storeStop();
// sounds.cafeStop();
store.isEndless = loader.getLevels().get(levelToGoTo).isEndless();
System.out.println("restarted");
//System.out.println("restarted");
sounds.potStop();
sounds.panStopp();
sounds.potplaying = false;
Expand Down Expand Up @@ -437,7 +437,7 @@ else if(current != 0){
levelselect.resetLevelSelectors();
result.update();
if (result.retry){
System.out.println("clicked retry");
//System.out.println("clicked retry");
sounds.cafeeactualstop();
sounds.storeStop();
restart();
Expand All @@ -461,7 +461,7 @@ else if(current != 0){
return;
}
//System.out.println(isPaused);
else if(input.getPause() && (current == 0||current == 1)){
else if(input.getPause() && !isPaused && (current == 0||current == 1)){
isPaused = true;
w.pauseTimer();
sounds.storeStop();
Expand All @@ -473,40 +473,56 @@ else if(input.getPause() && (current == 0||current == 1)){
}

else if(isPaused){
pause.update();
if(pause.resume){
if(input.getPause() && (current == 0||current == 1)){
isPaused = false;
pause.resumed();
if(sounds.potplaying){
if (sounds.potplaying) {
sounds.potPlay();
}
if(sounds.panplaying){
if (sounds.panplaying) {
sounds.panPlay();
}
pause.on_pause = false;
if(current == 1){
if (current == 1) {
sounds.storePlay();
}
sounds.cafePlay();
}else {
pause.update();
if (pause.resume) {
isPaused = false;
pause.resumed();
if (sounds.potplaying) {
sounds.potPlay();
}
if (sounds.panplaying) {
sounds.panPlay();
}
pause.on_pause = false;
if (current == 1) {
sounds.storePlay();
}
sounds.cafePlay();
}
if (pause.quit) {
pause.quit = false;
levelselect.resetLevelSelectors();
levelselect.setSaveController(saveController);
levelselect.generateLevelSelectors(loader.getLevels().size);
current = -1;
}
if (pause.restart) {
sounds.storeStop();
sounds.cafeeactualstop();
notepadOrders = new Array<>();
pause.on_pause = false;
restart();
pause.restart = false;
}
if (pause.options) {
}
}
if(pause.quit){
pause.quit = false;
levelselect.resetLevelSelectors();
levelselect.setSaveController(saveController);
levelselect.generateLevelSelectors(loader.getLevels().size);
current = -1;
}
if(pause.restart){
sounds.storeStop();
sounds.cafeeactualstop();
notepadOrders = new Array<>();
pause.on_pause = false;
restart();
pause.restart = false;
}
if(pause.options){

}
}
else if (!isPaused) {
if (w.timerPaused) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/raccoon/mygame/game/LoadingMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private void update(float delta) {
* prefer this in lecture.
*/
private void draw() {
System.out.println("hi!");
//System.out.println("hi!");
canvas.begin();
canvas.draw(background, 0, 0);
if (playButton == null) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/com/raccoon/mygame/models/Customer.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ else if(inputOrder.get(i).equals("green")){
}
}

System.out.println(order);
//System.out.println(order);

this.showUpTime = showUpTime;

Expand Down
2 changes: 1 addition & 1 deletion core/src/com/raccoon/mygame/models/Guard.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public void switchToDefaultMode() {
aiController.setAIStateWake();
}
else if(aiController.patrolDirection == PatrolDirection.ROTATE_CCW || aiController.patrolDirection == PatrolDirection.ROTATE_CW){
System.out.println(this.aiController.getCurrentState());
//System.out.println(this.aiController.getCurrentState());
aiController.setAIStateRotate();
aiController.resetRotateTimer();
}
Expand Down

0 comments on commit 1bd8f43

Please sign in to comment.