GameSprint1Done, little bug. When aiming right down not possible to hit with button 1 and 3 :S
This commit is contained in:
+7
-11
@@ -6,29 +6,25 @@ import java.awt.event.ActionListener;
|
||||
import javax.swing.Timer;
|
||||
|
||||
import view.GameView;
|
||||
import control.GameStateManager;
|
||||
|
||||
public class GameModel implements ActionListener{
|
||||
|
||||
GameView view;
|
||||
Timer update;
|
||||
Player player;
|
||||
|
||||
GameStateManager gsm;
|
||||
|
||||
public GameModel(GameView view)
|
||||
public GameModel(GameView view,GameStateManager gsm)
|
||||
{
|
||||
this.view = view;
|
||||
player = new Player(1920/2, 1080/2);
|
||||
update = new Timer(1000/10, this);
|
||||
this.view = view;
|
||||
this.gsm = gsm;
|
||||
update = new Timer(1000/30, this);
|
||||
update.start();
|
||||
}
|
||||
|
||||
public void update(){
|
||||
player.update();
|
||||
view.setPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
update();
|
||||
gsm.update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user