Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49a62c4a4d | ||
|
|
f0416db9c2 | ||
|
|
2d4a1add07 | ||
|
|
984beaabf9 | ||
|
|
b697978614 |
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.
|
||||||
|
|||||||
@@ -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