Bugfix things
This commit is contained in:
+24
-11
@@ -2,24 +2,37 @@ package model;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import main.Window;
|
||||
import control.GameStateManager;
|
||||
import control.LedHandler;
|
||||
import control.button.ButtonHandler;
|
||||
|
||||
public class GameModel{
|
||||
|
||||
public static Color[] colors = {Color.GREEN,Color.YELLOW,Color.RED,Color.MAGENTA,Color.CYAN,Color.WHITE};
|
||||
public class GameModel {
|
||||
|
||||
public static Color[] colors = { Color.GREEN, Color.YELLOW, Color.RED, Color.MAGENTA, Color.CYAN, Color.WHITE };
|
||||
private GameStateManager gsm;
|
||||
|
||||
public GameModel(SongHandler sh, GameStateManager gsm)
|
||||
{
|
||||
private LedHandler led;
|
||||
|
||||
public GameModel(SongHandler sh, GameStateManager gsm, LedHandler led) {
|
||||
this.gsm = gsm;
|
||||
|
||||
for(int i = 1; i < ButtonHandler.getButtons().size(); i++){
|
||||
ButtonHandler.getButtons().get(i).setColor(colors[i-1]);;
|
||||
this.led = led;
|
||||
|
||||
for (int i = 1; i < ButtonHandler.getButtons().size(); i++) {
|
||||
ButtonHandler.getButtons().get(i).setColor(colors[i - 1]);
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public void update(float factor){
|
||||
|
||||
public void update(float factor) {
|
||||
gsm.update(factor);
|
||||
|
||||
Color c = colors[(int) (Math.random() * (colors.length - 1) + 1)];
|
||||
|
||||
if (Window.ON_RASP) {
|
||||
for (int i = 7; i < 54; i++) {
|
||||
led.setLed(i, c.getRed(), c.getGreen(), c.getBlue());
|
||||
}
|
||||
led.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user