Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 340a118ef4 | |||
| 8c5f0b1f95 | |||
|
|
49a62c4a4d | ||
|
|
f0416db9c2 | ||
|
|
2d4a1add07 | ||
|
|
984beaabf9 | ||
|
|
b697978614 |
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -9,7 +9,7 @@
|
|||||||
<component name="ProjectKey">
|
<component name="ProjectKey">
|
||||||
<option name="state" value="project://63537948-39a4-48a0-9c97-34259a0fa913" />
|
<option name="state" value="project://63537948-39a4-48a0-9c97-34259a0fa913" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8.0_141" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
<component name="SvnBranchConfigurationManager">
|
<component name="SvnBranchConfigurationManager">
|
||||||
|
|||||||
22
README.md
22
README.md
@@ -10,27 +10,39 @@ Then, run MainGUI.java.
|
|||||||
# To play the game
|
# To play the game
|
||||||
If you are using the command line, extract "TaipanClone-master.zip", and open the "TaipanClone-master" folder. Open your terminal and change its directory to the "src" folder within "TaipanClone-master" folder.
|
If you are using the command line, extract "TaipanClone-master.zip", and open the "TaipanClone-master" folder. Open your terminal and change its directory to the "src" folder within "TaipanClone-master" folder.
|
||||||
|
|
||||||
Then, type in
|
Then, if you are using Linux, type in
|
||||||
```
|
```
|
||||||
"javac -cp .:junit-4.12.jar:hamcrest-core-1.3.jar:jfxrt.jar gui/*.java text/*.java logic/*.java tests/*.java"
|
"javac -cp .:junit-4.12.jar:hamcrest-core-1.3.jar:jfxrt.jar gui/*.java text/*.java logic/*.java tests/*.java"
|
||||||
```
|
```
|
||||||
|
Otherwise, if you are using Windows, type in
|
||||||
|
```
|
||||||
|
"javac -cp .;junit-4.12.jar;hamcrest-core-1.3.jar;jfxrt.jar gui/*.java text/*.java logic/*.java tests/*.java"
|
||||||
|
```
|
||||||
This compiles all the necessary files. Now, to play the GUI version run MainGUI.java using
|
This compiles all the necessary files. Now, to play the GUI version run MainGUI.java using
|
||||||
```
|
```
|
||||||
java gui.MainGUI
|
java gui.MainGUI
|
||||||
```
|
```
|
||||||
To play the command-line version run
|
To play the text-based version run MainText.java using
|
||||||
```
|
```
|
||||||
java gui.MainText
|
java text.MainText
|
||||||
```
|
```
|
||||||
|
|
||||||
# To run the test file PlayerTest.java, type in
|
# To run the test file PlayerTest.java for Linux type in:
|
||||||
```
|
```
|
||||||
javac -cp .:junit-4.12.jar:hamcrest-core-1.3.jar:jfxrt.jar gui/*.java text/*.java logic/*.java tests/*.java
|
javac -cp .:junit-4.12.jar:hamcrest-core-1.3.jar:jfxrt.jar gui/*.java text/*.java logic/*.java tests/*.java
|
||||||
```
|
```
|
||||||
This compiles all the necessary files. Now, run PlayerTest.java using
|
This compiles all the necessary files. Now, run PlayerTest.java by typing in
|
||||||
```
|
```
|
||||||
java -cp .:junit-4.12.jar:hamcrest-core-1.3.jar org.junit.runner.JUnitCore tests.PlayerTest
|
java -cp .:junit-4.12.jar:hamcrest-core-1.3.jar org.junit.runner.JUnitCore tests.PlayerTest
|
||||||
```
|
```
|
||||||
|
# To run the test file PlayerTest.java for Windows, type in:
|
||||||
|
```
|
||||||
|
javac -cp .;junit-4.12.jar;hamcrest-core-1.3.jar;jfxrt.jar gui/*.java text/*.java logic/*.java tests/*.java
|
||||||
|
```
|
||||||
|
This compiles all the necessary files. Now, run PlayerTest.java by typing in
|
||||||
|
```
|
||||||
|
java -cp .;junit-4.12.jar;hamcrest-core-1.3.jar org.junit.runner.JUnitCore tests.PlayerTest
|
||||||
|
```
|
||||||
Additional information:
|
Additional information:
|
||||||
|
|
||||||
You lose if your HP reaches 0. You can win if you "retire" in Hong Kong while having a net worth of over $1 million.
|
You lose if your HP reaches 0. You can win if you "retire" in Hong Kong while having a net worth of over $1 million.
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ public class ShipWarfareGUI extends Player {
|
|||||||
if (exitValue == 1) {
|
if (exitValue == 1) {
|
||||||
wipe();
|
wipe();
|
||||||
calculateLoot = logic.calculateLoot();
|
calculateLoot = logic.calculateLoot();
|
||||||
super.setMoney(logic.getMoney());
|
setMoney(calculateLoot+ getPlayer().getMoney());
|
||||||
report.setText(String.format("Our firm has earned $%,d in loot! ", calculateLoot));
|
report.setText(String.format("Our firm has earned $%,d in loot! ", calculateLoot));
|
||||||
continueButton.setVisible(true);
|
continueButton.setVisible(true);
|
||||||
completeWipe();
|
completeWipe();
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
package gui; /**
|
/**
|
||||||
* TaipanShopGUI deals with setting the stage for shop.
|
* TaipanShopGUI deals with setting the stage for shop.
|
||||||
*
|
*
|
||||||
* Author: Vikram Bawa
|
* Author: Vikram Bawa
|
||||||
*/
|
*/
|
||||||
|
package gui;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.event.EventHandler;
|
import javafx.event.EventHandler;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
@@ -115,7 +116,6 @@ public class TaipanShopGUI extends Player {
|
|||||||
loanButton.setVisible(false);
|
loanButton.setVisible(false);
|
||||||
armsButton.setVisible(false);
|
armsButton.setVisible(false);
|
||||||
quitButton.setVisible(true);
|
quitButton.setVisible(true);
|
||||||
//quitButton.setDefaultButton(true);
|
|
||||||
opiumButton.setVisible(false);
|
opiumButton.setVisible(false);
|
||||||
silkButton.setVisible(false);
|
silkButton.setVisible(false);
|
||||||
numberInput.setVisible(false);
|
numberInput.setVisible(false);
|
||||||
@@ -129,7 +129,6 @@ public class TaipanShopGUI extends Player {
|
|||||||
cargoButton.setVisible(true);
|
cargoButton.setVisible(true);
|
||||||
loanButton.setVisible(true);
|
loanButton.setVisible(true);
|
||||||
quitButton.setVisible(true);
|
quitButton.setVisible(true);
|
||||||
//quitButton.setDefaultButton(true);
|
|
||||||
opiumButton.setVisible(false);
|
opiumButton.setVisible(false);
|
||||||
silkButton.setVisible(false);
|
silkButton.setVisible(false);
|
||||||
numberInput.setVisible(false);
|
numberInput.setVisible(false);
|
||||||
@@ -144,7 +143,6 @@ public class TaipanShopGUI extends Player {
|
|||||||
loanButton.setVisible(true);
|
loanButton.setVisible(true);
|
||||||
numberInput.setVisible(false);
|
numberInput.setVisible(false);
|
||||||
quitButton.setVisible(true);
|
quitButton.setVisible(true);
|
||||||
//quitButton.setDefaultButton(true);
|
|
||||||
opiumButton.setVisible(false);
|
opiumButton.setVisible(false);
|
||||||
silkButton.setVisible(false);
|
silkButton.setVisible(false);
|
||||||
generalButton.setVisible(false);
|
generalButton.setVisible(false);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class TaipanShopLogic extends Player {
|
|||||||
public String updatePrices() {
|
public String updatePrices() {
|
||||||
String s = "\t" + getName() + ", the price of ";
|
String s = "\t" + getName() + ", the price of ";
|
||||||
String a = "";
|
String a = "";
|
||||||
double value = 0 * Math.random();
|
double value = 80 * Math.random();
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
setOpiumPrice((rand.nextInt(201) + 60) * 100);
|
setOpiumPrice((rand.nextInt(201) + 60) * 100);
|
||||||
setSilkPrice((rand.nextInt(201) + 60) * 10);
|
setSilkPrice((rand.nextInt(201) + 60) * 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user