home
This commit is contained in:
parent
cc4a595dec
commit
ceb9a95dcf
@ -207,6 +207,11 @@ public class AssetManager {
|
||||
mainThread.pc.init();
|
||||
mainThread.ec.init();
|
||||
|
||||
lightTank.tileCheckList_player = solidObject.generateTileCheckList(5f);
|
||||
lightTank.tileCheckList_enemy = solidObject.generateTileCheckList(5f);
|
||||
techCenter.resetResarchStatus();
|
||||
communicationCenter.resetResearchStatus();
|
||||
|
||||
|
||||
addConstructionVehicle(new constructionVehicle(new vector(3.125f,-0.3f, 2.125f), 90, 0));
|
||||
addConstructionVehicle(new constructionVehicle(new vector(29.625f,-0.3f, 28.875f), 90, 1));
|
||||
|
@ -105,7 +105,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
}
|
||||
|
||||
frameIndex = 0;
|
||||
frameInterval = 33;
|
||||
frameInterval = 35;
|
||||
lastDraw = 0;
|
||||
|
||||
|
||||
@ -121,8 +121,8 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
t.addActionListener(this);
|
||||
|
||||
//create a daemon thread which will sleep for the duration of the game
|
||||
Thread dt = new Thread(new DaemonThread() );
|
||||
dt.setDaemon(true);
|
||||
//Thread dt = new Thread(new DaemonThread() );
|
||||
// dt.setDaemon(true);
|
||||
|
||||
|
||||
//create another thread to create post processing effects
|
||||
@ -132,7 +132,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
|
||||
//start threads
|
||||
t.start();
|
||||
dt.start();
|
||||
//dt.start();
|
||||
theTread.start();
|
||||
|
||||
|
||||
@ -179,7 +179,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
if(gameStarted)
|
||||
gameFrame++;
|
||||
|
||||
timeString = secondsToString(gameFrame/30);
|
||||
timeString = secondsToString(gameFrame/35);
|
||||
|
||||
//handle user's interaction with game GUI
|
||||
if(gameFrame == 1 && gameStarted){
|
||||
@ -496,15 +496,15 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
}
|
||||
|
||||
public void regulateFramerate(){
|
||||
if(frameIndex%30==0){
|
||||
if(frameIndex%35==0){
|
||||
double thisTime = System.currentTimeMillis();
|
||||
framePerSecond = (int)(1000/((thisTime - lastTime)/30));
|
||||
framePerSecond = (int)(1000/((thisTime - lastTime)/35));
|
||||
lastTime = thisTime;
|
||||
}
|
||||
|
||||
|
||||
sleepTime = 0;
|
||||
/*while(System.currentTimeMillis()-lastDraw<frameInterval){
|
||||
while(System.currentTimeMillis()-lastDraw<frameInterval){
|
||||
|
||||
try {
|
||||
Thread.sleep(1);
|
||||
@ -513,7 +513,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
lastDraw=System.currentTimeMillis();
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,20 @@ public class communicationCenter extends solidObject{
|
||||
|
||||
public static int intendedDeployLocation = -1;
|
||||
|
||||
public static void resetResearchStatus() {
|
||||
harvesterSpeedResearched_player = false;
|
||||
harvesterSpeedResearched_enemy = false;
|
||||
rapidfireResearched_player = false;
|
||||
rapidfireResearched_enemy = false;
|
||||
harvesterSpeedResearchProgress_player = 255;
|
||||
harvesterSpeedResearchProgress_enemy = 255;
|
||||
rapidfireResearchProgress_player = 255;
|
||||
rapidfireResearchProgress_enemy = 255;
|
||||
creditSpentOnResearching_player = 0;
|
||||
creditSpentOnResearching_enemy = 0;
|
||||
intendedDeployLocation = -1;
|
||||
}
|
||||
|
||||
public communicationCenter(float x, float y, float z, int teamNo){
|
||||
//uncontrollable unit, but act as a big sized static collidable agent
|
||||
type = 106;
|
||||
|
@ -126,11 +126,6 @@ public class lightTank extends solidObject{
|
||||
|
||||
movement_offscreen = new vector(0,0,0);
|
||||
|
||||
if(tileCheckList_player == null){
|
||||
tileCheckList_player = generateTileCheckList(5f);
|
||||
tileCheckList_enemy = generateTileCheckList(5f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void makePolygons(){
|
||||
|
@ -69,6 +69,30 @@ public class techCenter extends solidObject{
|
||||
public static int creditSpentOnResearching_player, creditSpentOnResearching_enemy;
|
||||
|
||||
public static int intendedDeployLocation = -1;
|
||||
|
||||
public static void resetResarchStatus() {
|
||||
lightTankResearched_player = false;
|
||||
lightTankResearched_enemy = false;
|
||||
rocketTankResearched_player = false;
|
||||
rocketTankResearched_enemy = false;
|
||||
stealthTankResearched_player = false;
|
||||
stealthTankResearched_enemy = false;
|
||||
heavyTankResearched_player = false;
|
||||
heavyTankResearched_enemy = false;
|
||||
|
||||
lightTankResearchProgress_player = 255;
|
||||
lightTankResearchProgress_enemy = 255;
|
||||
rocketTankResearchProgress_player = 255;
|
||||
rocketTankResearchProgress_enemy = 255;
|
||||
stealthTankResearchProgress_player = 255;
|
||||
stealthTankResearchProgress_enemy = 255;
|
||||
heavyTankResearchProgress_player = 255;
|
||||
heavyTankResearchProgress_enemy = 255;
|
||||
|
||||
creditSpentOnResearching_player = 0;
|
||||
creditSpentOnResearching_enemy = 0;
|
||||
intendedDeployLocation = -1;
|
||||
}
|
||||
|
||||
public techCenter(float x, float y, float z, int teamNo){
|
||||
//uncontrollable unit, but act as a big sized static collidable agent
|
||||
|
Loading…
x
Reference in New Issue
Block a user