Skip to content
Snippets Groups Projects
Commit 64fc1e10 authored by Sixten Müller's avatar Sixten Müller
Browse files

Merge branch '22-waiting-for-players' into 'main'

Resolve "Waiting for players"

Closes #22

See merge request !10
parents a37f6f5c 139b5672
Branches
No related tags found
1 merge request!10Resolve "Waiting for players"
Showing
with 239 additions and 31 deletions
package com.wordbattle.game; package com.wordbattle.game;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.wordbattle.game.model.LobbyModel;
import com.wordbattle.game.network.FirebaseInterface; import com.wordbattle.game.network.FirebaseInterface;
public class AndroidInterfaceClass implements FirebaseInterface { public class AndroidInterfaceClass implements FirebaseInterface {
FirebaseDatabase database; FirebaseDatabase database;
DatabaseReference myRef; DatabaseReference myRef;
String lobbyID;
...@@ -15,10 +20,63 @@ public class AndroidInterfaceClass implements FirebaseInterface { ...@@ -15,10 +20,63 @@ public class AndroidInterfaceClass implements FirebaseInterface {
public AndroidInterfaceClass() { public AndroidInterfaceClass() {
database = FirebaseDatabase.getInstance("https://wordbattle-96156-default-rtdb.europe-west1.firebasedatabase.app"); database = FirebaseDatabase.getInstance("https://wordbattle-96156-default-rtdb.europe-west1.firebasedatabase.app");
myRef = database.getReference("message"); myRef = database.getReference("message");
myRef.setValue("HelloWorld"); myRef.setValue("Something");
} }
@Override @Override
public void SomeFunction() { public void SomeFunction() {
System.out.println("Something works"); System.out.println("Something works");
} }
@Override
public void createNewLobby(String hostNickname, String pin) {
System.out.println("Gooooooood morning Vietnam");
LobbyModel lobby = new LobbyModel(hostNickname, pin);
DatabaseReference lobbyRef = database.getReference("lobbies").child(pin);
lobbyRef.setValue(lobby)
.addOnSuccessListener(aVoid -> {
// This will be called if the lobby is successfully created in the database.
// Here you could navigate to the lobby screen, update the UI, etc.
System.out.println("Lobby created successfully.");
})
.addOnFailureListener(e -> {
// This will be called if there is an error creating the lobby.
// Here you could display an error message or perform some error handling.
System.err.println("Error creating lobby: " + e.getMessage());
});
}
@Override
public void joinLobby(String pin, String playerNickname) {
// Reference to the specific lobby by its pin
DatabaseReference lobbyRef = database.getReference("lobbies").child(pin);
// Get the current state of the lobby to add a new player
lobbyRef.addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
LobbyModel lobby = dataSnapshot.getValue(LobbyModel.class);
if (lobby != null) {
// Add the player's nickname to the lobby
lobby.addPlayerNickname(playerNickname);
// Save the updated lobby back to the database
lobbyRef.setValue(lobby).addOnSuccessListener(aVoid -> {
// Successfully joined the lobby
System.out.println(playerNickname + " joined the lobby with PIN: " + pin);
}).addOnFailureListener(e -> {
// Handle failure to join the lobby
System.err.println("Failed to join lobby: " + e.getMessage());
});
} else {
// Lobby does not exist or the pin was incorrect
System.err.println("Lobby with PIN " + pin + " does not exist.");
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
// Handle error on getting lobby data
System.err.println("Database error: " + databaseError.getMessage());
}
});
}
} }
...@@ -12,7 +12,7 @@ public class AndroidLauncher extends AndroidApplication { ...@@ -12,7 +12,7 @@ public class AndroidLauncher extends AndroidApplication {
@Override @Override
protected void onCreate (Bundle savedInstanceState) { protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Log.d("AndroidLauncher", "onCreate is called"); // Add this line for logging Log.d("AndroidLauncher", "Database is initialized"); // Add this line for logging
FirebaseApp.initializeApp(this); FirebaseApp.initializeApp(this);
......
...@@ -27,7 +27,7 @@ public class WordBattle extends ApplicationAdapter { ...@@ -27,7 +27,7 @@ public class WordBattle extends ApplicationAdapter {
batch = new SpriteBatch(); batch = new SpriteBatch();
stateManager = new StateManager(); stateManager = new StateManager();
ScreenUtils.clear(1, 0, 0, 1); ScreenUtils.clear(1, 0, 0, 1);
stateManager.setState(new MainMenuState(stateManager)); // Set the main menu as the initial state stateManager.setState(new MainMenuState(stateManager, _FBIC)); // Set the main menu as the initial state
} }
@Override @Override
public void render() { public void render() {
......
/*
package com.wordbattle.game.controller; package com.wordbattle.game.controller;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
...@@ -37,3 +38,4 @@ public class ConnectingLobbyController { ...@@ -37,3 +38,4 @@ public class ConnectingLobbyController {
lobbyView.dispose(); lobbyView.dispose();
} }
} }
*/
...@@ -3,19 +3,20 @@ package com.wordbattle.game.controller; ...@@ -3,19 +3,20 @@ package com.wordbattle.game.controller;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.Vector3;
import com.wordbattle.game.states.BaseState; import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.states.ConnectingLobbyState; import com.wordbattle.game.states.LobbyState;
import com.wordbattle.game.states.CreateGameState; import com.wordbattle.game.states.CreateGameState;
import com.wordbattle.game.view.CreateGameView; import com.wordbattle.game.view.CreateGameView;
import com.wordbattle.game.view.MainMenuView;
public class CreateGameController { public class CreateGameController {
private CreateGameState state; private CreateGameState state;
private CreateGameView createGameView; private CreateGameView createGameView;
private String selectedLevel; private String selectedLevel;
private FirebaseInterface _FBIC;
public CreateGameController(CreateGameState state) { public CreateGameController(CreateGameState state, FirebaseInterface _FBIC) {
this.state = state; this.state = state;
this._FBIC = _FBIC;
this.createGameView = new CreateGameView(state.getCam()); // Assuming you provide a getter for the camera in BaseState this.createGameView = new CreateGameView(state.getCam()); // Assuming you provide a getter for the camera in BaseState
} }
...@@ -38,7 +39,7 @@ public class CreateGameController { ...@@ -38,7 +39,7 @@ public class CreateGameController {
} }
if (createGameView.getCreateGameBounds().contains(touchPos.x, touchPos.y)) { if (createGameView.getCreateGameBounds().contains(touchPos.x, touchPos.y)) {
state.getStateManager().setState(new ConnectingLobbyState(state.getStateManager(), createGameView.getPin())); state.getStateManager().setState(new LobbyState(state.getStateManager(), createGameView.getPin(), createGameView.getNickname(), _FBIC));
} }
} }
......
...@@ -42,7 +42,9 @@ public class FinalLeaderBoardController { ...@@ -42,7 +42,9 @@ public class FinalLeaderBoardController {
Vector3 touchPos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0); Vector3 touchPos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);
state.getCam().unproject(touchPos); // convert from screen coordinates to world coordinates state.getCam().unproject(touchPos); // convert from screen coordinates to world coordinates
if (finalLeaderBoardView.getBackToStartBounds().contains(touchPos.x, touchPos.y)){ if (finalLeaderBoardView.getBackToStartBounds().contains(touchPos.x, touchPos.y)){
/*
state.getStateManager().setState(new CreateGameState(state.getStateManager())); //midlertidlig state.getStateManager().setState(new CreateGameState(state.getStateManager())); //midlertidlig
*/
} }
......
...@@ -3,6 +3,7 @@ package com.wordbattle.game.controller; ...@@ -3,6 +3,7 @@ package com.wordbattle.game.controller;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.Vector3;
import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.states.HowToPlayState; import com.wordbattle.game.states.HowToPlayState;
import com.wordbattle.game.states.MainMenuState; import com.wordbattle.game.states.MainMenuState;
import com.wordbattle.game.view.HowToPlayView; import com.wordbattle.game.view.HowToPlayView;
...@@ -10,10 +11,12 @@ import com.wordbattle.game.view.HowToPlayView; ...@@ -10,10 +11,12 @@ import com.wordbattle.game.view.HowToPlayView;
public class HowToPlayController { public class HowToPlayController {
private HowToPlayState state; private HowToPlayState state;
private HowToPlayView howToPlayView; private HowToPlayView howToPlayView;
private FirebaseInterface _FBIC;
public HowToPlayController(HowToPlayState state) { public HowToPlayController(HowToPlayState state, FirebaseInterface _FBIC) {
this.state = state; this.state = state;
this.howToPlayView = new HowToPlayView(state.getCam()); this._FBIC = _FBIC;
this.howToPlayView = new HowToPlayView(state.getCam(), _FBIC);
} }
public void handleInput() { public void handleInput() {
...@@ -26,7 +29,7 @@ public class HowToPlayController { ...@@ -26,7 +29,7 @@ public class HowToPlayController {
} }
if (howToPlayView.getInvisibleButtonGoBackBounds().contains(touchPos.x, touchPos.y)) { if (howToPlayView.getInvisibleButtonGoBackBounds().contains(touchPos.x, touchPos.y)) {
state.getStateManager().setState(new MainMenuState(state.getStateManager())); state.getStateManager().setState(new MainMenuState(state.getStateManager(), _FBIC ));
} }
} }
} }
......
...@@ -43,7 +43,9 @@ public class LeaderBoardController { ...@@ -43,7 +43,9 @@ public class LeaderBoardController {
Vector3 touchPos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0); Vector3 touchPos = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);
state.getCam().unproject(touchPos); // convert from screen coordinates to world coordinates state.getCam().unproject(touchPos); // convert from screen coordinates to world coordinates
if (leaderBoardView.getNextRoundBounds().contains(touchPos.x, touchPos.y)){ if (leaderBoardView.getNextRoundBounds().contains(touchPos.x, touchPos.y)){
/*
state.getStateManager().setState(new CreateGameState(state.getStateManager())); //midlertidlig state.getStateManager().setState(new CreateGameState(state.getStateManager())); //midlertidlig
*/
} }
......
package com.wordbattle.game.controller;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector3;
import com.wordbattle.game.model.LobbyModel;
import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.states.LobbyState;
import com.wordbattle.game.view.LobbyView;
public class LobbyController {
private LobbyState state;
private LobbyView lobbyView;
private String pin;
private FirebaseInterface _FBIC;
public LobbyController(LobbyState state, String hostNickname, String pin, FirebaseInterface _FBIC) {
this.state = state;
this.pin = pin;
this._FBIC = _FBIC;
this.lobbyView = new LobbyView(state.getCam(), pin);
_FBIC.createNewLobby(hostNickname, pin);
}
public void handleInput() {
}
public void update(float dt) {
handleInput();
}
public void dispose() {
// Clean up any resources when exiting the state
}
public void render(SpriteBatch sb) {
lobbyView.render(sb);
}
}
...@@ -6,6 +6,8 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; ...@@ -6,6 +6,8 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector3; import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.Null; import com.badlogic.gdx.utils.Null;
import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.network.FirebaseManager;
import com.wordbattle.game.states.CreateGameState; import com.wordbattle.game.states.CreateGameState;
import com.wordbattle.game.states.JoinGameState; import com.wordbattle.game.states.JoinGameState;
import com.wordbattle.game.states.HowToPlayState; import com.wordbattle.game.states.HowToPlayState;
...@@ -20,12 +22,14 @@ import java.util.logging.Logger; ...@@ -20,12 +22,14 @@ import java.util.logging.Logger;
public class MainMenuController { public class MainMenuController {
private MainMenuState state; private MainMenuState state;
private MainMenuView mainMenuView; private MainMenuView mainMenuView;
FirebaseInterface _FBIC;
public MainMenuController(MainMenuState state) { public MainMenuController(MainMenuState state, FirebaseInterface _FBIC) {
this.state = state; this.state = state;
// Now you have access to stateManager through state.gsm and can instruct the state to change views or states. // Now you have access to stateManager through state.gsm and can instruct the state to change views or states.
this.mainMenuView = new MainMenuView(state.getCam()); // Assuming you provide a getter for the camera in BaseState this.mainMenuView = new MainMenuView(state.getCam()); // Assuming you provide a getter for the camera in BaseState
this._FBIC = _FBIC;
} }
public void handleInput() { public void handleInput() {
...@@ -54,11 +58,11 @@ public class MainMenuController { ...@@ -54,11 +58,11 @@ public class MainMenuController {
} }
if (newGameButtonBounds.contains(touchPos.x, touchPos.y)) { if (newGameButtonBounds.contains(touchPos.x, touchPos.y)) {
System.out.println("New Game Button Pressed"); System.out.println("New Game Button Pressed");
state.getStateManager().setState(new CreateGameState(state.getStateManager())); state.getStateManager().setState(new CreateGameState(state.getStateManager(), _FBIC));
} }
if (howToPlayButtonBounds.contains(touchPos.x, touchPos.y)) { if (howToPlayButtonBounds.contains(touchPos.x, touchPos.y)) {
System.out.println("How to play Pressed"); System.out.println("How to play Pressed");
state.getStateManager().setState(new HowToPlayState(state.getStateManager())); state.getStateManager().setState(new HowToPlayState(state.getStateManager(), _FBIC));
} }
} }
} }
......
...@@ -24,7 +24,9 @@ public class StartController { ...@@ -24,7 +24,9 @@ public class StartController {
public void handleInput(){ public void handleInput(){
//click anywhere to go to next state, temporary solution until firebase is set up //click anywhere to go to next state, temporary solution until firebase is set up
if (Gdx.input.justTouched()) { if (Gdx.input.justTouched()) {
/*
state.getStateManager().setState(new MainMenuState(state.getStateManager())); state.getStateManager().setState(new MainMenuState(state.getStateManager()));
*/
System.out.println("clicked on screen"); System.out.println("clicked on screen");
} }
......
...@@ -2,6 +2,7 @@ package com.wordbattle.game.controller; ...@@ -2,6 +2,7 @@ package com.wordbattle.game.controller;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.states.JoinGameState; import com.wordbattle.game.states.JoinGameState;
import com.wordbattle.game.states.MainMenuState; import com.wordbattle.game.states.MainMenuState;
import com.wordbattle.game.states.WaitingLobbyState; import com.wordbattle.game.states.WaitingLobbyState;
...@@ -20,7 +21,9 @@ public class WaitingLobbyController { ...@@ -20,7 +21,9 @@ public class WaitingLobbyController {
public void handleInput(){ public void handleInput(){
if (Gdx.input.justTouched()) { if (Gdx.input.justTouched()) {
state.getStateManager().setState(new MainMenuState(state.getStateManager())); /*
state.getStateManager().setState(new MainMenuState(state.getStateManager(), FirebaseInterface _FBIC));
*/
} }
......
// In the model package
package com.wordbattle.game.model;
import java.util.ArrayList;
import java.util.List;
public class LobbyModel {
private String hostNickname;
private String pin;
private List<String> playerNicknames;
// Constructor for initializing a new Lobby with the host's nickname and PIN
public LobbyModel(String hostNickname, String pin) {
this.hostNickname = hostNickname;
this.pin = pin;
this.playerNicknames = new ArrayList<>(); // Initialize the list of player nicknames
this.playerNicknames.add(hostNickname);
}
// Getters and setters
public String getHostNickname() {
return hostNickname;
}
public void setHostNickname(String hostNickname) {
this.hostNickname = hostNickname;
}
public String getPin() {
return pin;
}
public void setPin(String pin) {
this.pin = pin;
}
public List<String> getPlayerNicknames() {
return playerNicknames;
}
public void setPlayerNicknames(List<String> playerNicknames) {
this.playerNicknames = playerNicknames;
}
public void addPlayerNickname(String nickname) {
this.playerNicknames.add(nickname);
}
// ... additional logic related to the lobby ...
}
...@@ -5,6 +5,9 @@ public interface FirebaseInterface { ...@@ -5,6 +5,9 @@ public interface FirebaseInterface {
public void SomeFunction(); public void SomeFunction();
public void createNewLobby(String hostNickname, String pin);
public void joinLobby(String pin, String playerNickname);
} }
...@@ -8,5 +8,17 @@ public class FirebaseManager implements FirebaseInterface { ...@@ -8,5 +8,17 @@ public class FirebaseManager implements FirebaseInterface {
System.out.println("Wubbadubdub"); System.out.println("Wubbadubdub");
} }
@Override
public void createNewLobby(String hostNickname, String pin) {
}
@Override
public void joinLobby(String pin, String playerNickname) {
}
} }
...@@ -4,14 +4,18 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch; ...@@ -4,14 +4,18 @@ import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.wordbattle.game.WordBattle; import com.wordbattle.game.WordBattle;
import com.wordbattle.game.controller.CreateGameController; import com.wordbattle.game.controller.CreateGameController;
import com.wordbattle.game.controller.MainMenuController; import com.wordbattle.game.controller.MainMenuController;
import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.network.FirebaseManager;
public class CreateGameState extends BaseState { public class CreateGameState extends BaseState {
private CreateGameController controller; private CreateGameController controller;
private FirebaseInterface _FBIC;
public CreateGameState(StateManager gsm) { public CreateGameState(StateManager gsm, FirebaseInterface _FBIC) {
super(gsm); super(gsm);
this.controller = new CreateGameController(this); this._FBIC = _FBIC;
this.controller = new CreateGameController(this, _FBIC);
cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT); cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT);
} }
......
...@@ -3,13 +3,16 @@ package com.wordbattle.game.states; ...@@ -3,13 +3,16 @@ package com.wordbattle.game.states;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.wordbattle.game.WordBattle; import com.wordbattle.game.WordBattle;
import com.wordbattle.game.controller.HowToPlayController; import com.wordbattle.game.controller.HowToPlayController;
import com.wordbattle.game.network.FirebaseInterface;
public class HowToPlayState extends BaseState { public class HowToPlayState extends BaseState {
private HowToPlayController controller; private HowToPlayController controller;
private FirebaseInterface _FBIC;
public HowToPlayState(StateManager gsm) { public HowToPlayState(StateManager gsm, FirebaseInterface _FBIC) {
super(gsm); super(gsm);
this.controller = new HowToPlayController(this); this._FBIC = _FBIC;
this.controller = new HowToPlayController(this, _FBIC);
cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT); cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT);
} }
......
...@@ -2,17 +2,18 @@ package com.wordbattle.game.states; ...@@ -2,17 +2,18 @@ package com.wordbattle.game.states;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.wordbattle.game.WordBattle; import com.wordbattle.game.WordBattle;
import com.wordbattle.game.controller.ConnectingLobbyController; import com.wordbattle.game.controller.LobbyController;
import com.wordbattle.game.view.LobbyView; import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.network.FirebaseManager;
public class ConnectingLobbyState extends BaseState { public class LobbyState extends BaseState {
private LobbyView lobbyView; private LobbyController controller;
private ConnectingLobbyController controller; private FirebaseInterface _FBIC;
public ConnectingLobbyState(StateManager gsm, String pin) { public LobbyState(StateManager gsm, String pin, String nickname, FirebaseInterface _FBIC) {
super(gsm); super(gsm);
lobbyView = new LobbyView(cam, pin); this._FBIC = _FBIC;
controller = new ConnectingLobbyController(this); controller = new LobbyController(this, nickname, pin, _FBIC);
cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT); cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT);
} }
...@@ -29,7 +30,7 @@ public class ConnectingLobbyState extends BaseState { ...@@ -29,7 +30,7 @@ public class ConnectingLobbyState extends BaseState {
@Override @Override
public void render(SpriteBatch sb) { public void render(SpriteBatch sb) {
lobbyView.render(sb); controller.render(sb);
} }
@Override @Override
...@@ -42,6 +43,7 @@ public class ConnectingLobbyState extends BaseState { ...@@ -42,6 +43,7 @@ public class ConnectingLobbyState extends BaseState {
// Clean up any resources when exiting the state // Clean up any resources when exiting the state
} }
@Override @Override
public void dispose() { public void dispose() {
controller.dispose(); // eller lobbyView controller.dispose(); // eller lobbyView
......
...@@ -4,17 +4,23 @@ package com.wordbattle.game.states; ...@@ -4,17 +4,23 @@ package com.wordbattle.game.states;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.wordbattle.game.WordBattle; import com.wordbattle.game.WordBattle;
import com.wordbattle.game.controller.MainMenuController; import com.wordbattle.game.controller.MainMenuController;
import com.wordbattle.game.network.FirebaseInterface;
import com.wordbattle.game.network.FirebaseManager;
public class MainMenuState extends BaseState { public class MainMenuState extends BaseState {
private MainMenuController controller; private MainMenuController controller;
private FirebaseInterface _FBIC;
public MainMenuState(StateManager gsm) { public MainMenuState(StateManager gsm, FirebaseInterface _FBIC) {
super(gsm); super(gsm);
this.controller = new MainMenuController(this); // 'this' provides context this._FBIC = _FBIC;
this.controller = new MainMenuController(this, _FBIC); // 'this' provides context
cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT); cam.setToOrtho(false, WordBattle.WIDTH, WordBattle.HEIGHT);
} }
public StateManager getStateManager() { public StateManager getStateManager() {
return gsm; return gsm;
} }
......
...@@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.Texture; ...@@ -7,6 +7,7 @@ import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Rectangle;
import com.wordbattle.game.WordBattle; import com.wordbattle.game.WordBattle;
import com.wordbattle.game.network.FirebaseInterface;
public class HowToPlayView { public class HowToPlayView {
private Texture backgroundTexture; private Texture backgroundTexture;
...@@ -17,7 +18,7 @@ public class HowToPlayView { ...@@ -17,7 +18,7 @@ public class HowToPlayView {
private OrthographicCamera cam; private OrthographicCamera cam;
private boolean showHint; private boolean showHint;
public HowToPlayView(OrthographicCamera cam) { public HowToPlayView(OrthographicCamera cam, FirebaseInterface _FBIC) {
this.cam = cam; this.cam = cam;
this.backgroundTexture = new Texture("howToPlayBg.png"); this.backgroundTexture = new Texture("howToPlayBg.png");
this.showHintTexture = new Texture("showHint.png"); this.showHintTexture = new Texture("showHint.png");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment