game logic fixed by tips of johan
This commit is contained in:
+5
-15
@@ -1,38 +1,28 @@
|
||||
package model;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
||||
import javax.swing.Timer;
|
||||
|
||||
import control.GameStateManager;
|
||||
import control.button.ButtonHandler;
|
||||
|
||||
public class GameModel implements ActionListener{
|
||||
public class GameModel{
|
||||
|
||||
|
||||
private Timer update;
|
||||
public static Color[] colors = {Color.MAGENTA,Color.RED,Color.GREEN,Color.YELLOW,Color.CYAN,Color.WHITE};
|
||||
private GameStateManager gsm;
|
||||
SongHandler sh;
|
||||
private SongHandler sh;
|
||||
|
||||
public GameModel(SongHandler sh, GameStateManager gsm)
|
||||
{
|
||||
this.gsm = gsm;
|
||||
|
||||
this.sh = sh;
|
||||
|
||||
update = new Timer(1000/30, this);
|
||||
update.start();
|
||||
this.sh = sh;
|
||||
|
||||
for(int i = 1; i < ButtonHandler.getButtons().size(); i++){
|
||||
ButtonHandler.getButtons().get(i).setColor(colors[i-1]);;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
gsm.update();
|
||||
public void update(float factor){
|
||||
gsm.update(factor);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user