Skip to content

Commit

Permalink
Finishing Touches
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Grimberg committed Feb 7, 2017
1 parent 62acc75 commit 1406adb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 46 deletions.
48 changes: 2 additions & 46 deletions JetScape/JetScape.pde
Original file line number Diff line number Diff line change
Expand Up @@ -158,50 +158,6 @@ public void setup()
movingObjects();
}

public void mousePressed()
{
quitClicked();
startClicked();
hClicked();
highClicked();
}

public void mouseReleased()
{
//If mouse released set it back to false.
mscbtnStr = false;
mscbtnEnd = false;
mscbtnH = false;
mscbtnHigh = false;
}

public void keyPressed()
{
keys[keyCode] = true;

//Up arrow to go to main menu when dead.
if(keyCode == UP && gameState == 2 || gameState == 3 || gameState == 4)
{
reset();
cursor();
}

}

public void keyReleased()
{
keys[keyCode] = false;
}

public boolean keyCheck(int x)
{
if (keys.length >= x)
{
return keys[x] || keys[Character.toUpperCase(x)];
}
return false;
}

public void textDisplay(String text, TextForm size, int x, int y)
{
Word[size.Pos].text(text, x, y);
Expand Down Expand Up @@ -339,7 +295,7 @@ public void highClicked()
public void movingObjects()
{
float coinYPos; //Coin location.
float dangerYPos; //Coin location.
float dangerYPos; //Danger location.

float theta = 0.0f;
float thetaDanger = 0.0f;
Expand Down Expand Up @@ -367,7 +323,7 @@ public void movingObjects()
{
float location = dangerYPos + sin(thetaDanger) * radiusDanger;

danger[i] = new Danger(width + 300 * i, location, 80, 80); //Coins instances.
danger[i] = new Danger(width + 300 * i, location, 80, 80); //Danger instances.
thetaDanger = thetaDanger + random(0f,600f); //Choosing a random location.
radiusDanger = 200; //Spreading out the dangers
}
Expand Down
43 changes: 43 additions & 0 deletions JetScape/KeyControl.pde
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
public void mousePressed()
{
quitClicked();
startClicked();
hClicked();
highClicked();
}

public void mouseReleased()
{
//If mouse released set it back to false.
mscbtnStr = false;
mscbtnEnd = false;
mscbtnH = false;
mscbtnHigh = false;
}

public void keyPressed()
{
keys[keyCode] = true;

//Up arrow to go to main menu when dead.
if(keyCode == UP && gameState == 2 || gameState == 3 || gameState == 4)
{
reset();
cursor();
}

}

public void keyReleased()
{
keys[keyCode] = false;
}

public boolean keyCheck(int x)
{
if (keys.length >= x)
{
return keys[x] || keys[Character.toUpperCase(x)];
}
return false;
}

0 comments on commit 1406adb

Please sign in to comment.