Skip to content

Commit

Permalink
AddingRankingButton
Browse files Browse the repository at this point in the history
- New Button Ranking
  • Loading branch information
TvConIdeas committed Nov 12, 2024
1 parent 5a31863 commit 5278606
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
Binary file modified out/production/Legion 501/button_atlas.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 removed out/production/Legion 501/menu_background.png
Binary file not shown.
Binary file modified res/button_atlas.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 removed res/menu_background.png
Binary file not shown.
1 change: 1 addition & 0 deletions src/entities/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private void updateAnimationTick(){
case IDLE -> {
active = true;
initHitbox(x, y, (int) (20 * Game.SCALE), (int) (28 * Game.SCALE));
System.out.println("Hitbox inicializada");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/gameState/GameState.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public enum GameState {

PLAYING, MENU, OPTIONS, QUIT;
PLAYING, MENU, OPTIONS, RANKING, QUIT;

public static GameState state = MENU; // Estado por default.

Expand Down
17 changes: 8 additions & 9 deletions src/gameState/Menu.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class Menu extends State {
// ====================> ATRIBUTOS <====================
private MenuButton[] buttons = new MenuButton[3]; // Lo iniciamos porque ya sabemos la cantidad de botones que utilizamos
private MenuButton[] buttons = new MenuButton[4]; // Lo iniciamos porque ya sabemos la cantidad de botones que utilizamos

// ====================> CONSTRUCTOR <====================
public Menu(Game game) {
Expand All @@ -26,9 +26,10 @@ public Menu(Game game) {

// ====================> METODOS <====================
private void loadButtons() {
buttons[0] = new MenuButton(Game.GAME_WIDTH / 2, (int) (150*Game.SCALE),0,GameState.PLAYING);
buttons[1] = new MenuButton(Game.GAME_WIDTH / 2, (int) (230*Game.SCALE),1,GameState.OPTIONS);
buttons[2] = new MenuButton(Game.GAME_WIDTH / 2, (int) (310*Game.SCALE),2,GameState.QUIT);
buttons[0] = new MenuButton(Game.GAME_WIDTH / 2, (int) (150*Game.SCALE),0,GameState.PLAYING); // Primero (y = 150)
buttons[1] = new MenuButton(Game.GAME_WIDTH / 2, (int) (310*Game.SCALE),1,GameState.OPTIONS); // Tercero (y = 310)
buttons[2] = new MenuButton(Game.GAME_WIDTH / 2, (int) (390*Game.SCALE),2,GameState.QUIT); // Cuarto (y = 390)
buttons[3] = new MenuButton(Game.GAME_WIDTH / 2, (int) (230*Game.SCALE),3,GameState.RANKING); // Segundo (y = 230)
// La yPos, se debe editar manualmente y le agregamos al final a que state pertene el boton
}

Expand Down Expand Up @@ -98,14 +99,12 @@ public void mouseClicked(MouseEvent e) {
}

@Override
public void keyPressed(KeyEvent e) { // BORRAR LUEGO
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
GameState.state = GameState.PLAYING;
}
public void keyPressed(KeyEvent e) {
// Sin uso todavia
}

@Override
public void keyReleased(KeyEvent e) { // BORRAR LUEGO
public void keyReleased(KeyEvent e) {
// Sin uso (todavia)
}
}
1 change: 1 addition & 0 deletions src/main/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public void update(){
playing.update();
break;
case OPTIONS: //option.update() [no existe aun] break;
case RANKING: //ranking.update() [no existe aun] break;
case QUIT:
default:
System.exit(0); // Cierra el programa
Expand Down

0 comments on commit 5278606

Please sign in to comment.