GamePlay fixes
This commit is contained in:
+16
-17
@@ -2,8 +2,8 @@ package control;
|
|||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.Timer;
|
|
||||||
import java.util.TimerTask;
|
import javax.swing.Timer;
|
||||||
|
|
||||||
import model.GameModel;
|
import model.GameModel;
|
||||||
import view.GameView;
|
import view.GameView;
|
||||||
@@ -26,20 +26,20 @@ public class GameControl implements JoystickListener, ButtonListener, ActionList
|
|||||||
this.view = view;
|
this.view = view;
|
||||||
this.gsm = gsm;
|
this.gsm = gsm;
|
||||||
view.setIgnoreRepaint(true);
|
view.setIgnoreRepaint(true);
|
||||||
// update = new Timer(1000/60,this);
|
update = new Timer(1000/60,this);
|
||||||
// update.start();
|
update.start();
|
||||||
Timer update = new Timer();
|
// Timer update = new Timer();
|
||||||
update.schedule(new TimerTask() {
|
// update.schedule(new TimerTask() {
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
long currentTime = System.currentTimeMillis();
|
// long currentTime = System.currentTimeMillis();
|
||||||
model.update(currentTime - lastTime);
|
// model.update(currentTime - lastTime);
|
||||||
lastTime = currentTime;
|
// lastTime = currentTime;
|
||||||
view.repaint();
|
// view.repaint();
|
||||||
System.out.println("Test");
|
// System.out.println("Test");
|
||||||
}
|
// }
|
||||||
}, 0,1000/120);
|
// }, 0,1000/120);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -66,5 +66,4 @@ public class GameControl implements JoystickListener, ButtonListener, ActionList
|
|||||||
lastTime = currentTime;
|
lastTime = currentTime;
|
||||||
view.repaint();
|
view.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,16 +41,18 @@ public class PlayState extends GameState {
|
|||||||
super(gsm, sh);
|
super(gsm, sh);
|
||||||
infoPanel = new InfoPanel(0, 0);
|
infoPanel = new InfoPanel(0, 0);
|
||||||
area = new PlayArea(256, 1024, 1024, 125);
|
area = new PlayArea(256, 1024, 1024, 125);
|
||||||
// for(int index = 0; index < 8; index++){
|
|
||||||
// addEnemy(index, GameModel.colors[index % 6]);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
player = new Player(1280 - 1024 + 1024 / 2, 1024 / 2);
|
player = new Player(1280 - 1024 + 1024 / 2, 1024 / 2);
|
||||||
stroke = new BasicStroke(sizeOfEnemy, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
|
stroke = new BasicStroke(sizeOfEnemy, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
|
|
||||||
|
lifePoints = 100;
|
||||||
|
currentScore = 0;
|
||||||
|
comboScore = 0;
|
||||||
|
oldProgress = 0 ;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user