Skip to content

Commit 16fa16e

Browse files
authored
Add files via upload
0 parents  commit 16fa16e

11 files changed

+908
-0
lines changed

README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# The Adventures Of Dr.Octavious #
2+
3+
## Project Description ##
4+
This branch holds all the required classes needed to run our latest rendition of the Dr.Octavious game.
5+
The object of the game is to navigate the map(using W,A,S,D) in order to collect the coins(Gold circles) and avoid enemies(red squares).After collecting all the coins, a key(green circle) will appear, upon picking up the key the game comes to an end.
6+
At the top left of the screen there is a health bar indicating how close a player is to dying, and it also displays the number of coins collected. In order to set the highest score possible players must attempt to finish the game as fast as they can.
7+
8+
9+
##Downloading##
10+
In order to run this game you must have java installed.
11+
Go to the 'Demo2' branch and click on the 'src' folder.
12+
Download all the classes in the src folder and unzip them
13+
Put them in the same package in eclipse or the IDE of your choice.
14+
ensure that you have downloaded the clouds.jpg image and imported that into the package as well, the code will not compile if this image isn't imported.
15+
16+
Alternatively, you can launch the game from the console by downloading the src folder into the directory of your chosing.
17+
Launch the console, and go to said directory,
18+
type:
19+
20+
javac Main.java
21+
After a successful compile:
22+
java Main
23+
24+
## How To Launch ##
25+
After all classes are compiled and in the same package run the 'Main.java' class .
26+
this should display a new window that allows you to move around your character and explore the world.
27+
28+
29+
## References ##
30+
https://www.youtube.com/watch?v=9dzhgsVaiSo
31+
https://www.youtube.com/watch?v=fnsBoamSscQ
32+
https://github.com/AlmasB/
33+
https://examples.javacodegeeks.com/desktop-java/awt/draw-shapes-example/
34+
https://docs.oracle.com/javase/8/docs/api/index.html?java/awt/Shape.html
35+
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/Button.html
36+
https://docs.oracle.com/javase/tutorial/uiswing/components/button.html
37+
https://stackoverflow.com/questions/18680248/html-button-onclick-event
38+
https://stackoverflow.com/questions/23606617/how-to-completely-close-the-class-and-open-new-class
39+
https://stackoverflow.com/questions/37222305/how-do-i-get-a-button-to-open-a-new-activity-in-android-studio
40+
41+
42+
43+
## Credits ##
44+
45+
Group members: Asad Choudhry, Deliar Mohammadi, Osama Hameed, Oscar Campos
46+
47+
CPSC 233 Summer 2019
48+
49+
Second Demo July 30, 2019
50+
51+
Professer: Nathaly Verwaal
52+
53+
TA: Lorans Alabood
54+
55+
56+
57+
Link to this Repository: https://github.com/asadc24/AOODproject
58+
59+
Link to Demo # 2 Branch: https://github.com/asadc24/AOODproject/tree/Demo2
60+
61+
62+
63+
64+
65+
66+
67+

src/Coin.java

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*******************************************************************************
2+
- Full name: Asad Choudhry, Osama Hameed, Deliar Mohammadi, Oscar Campos
3+
- Class: CPSC and Class Number 233
4+
- Assignment: AOOD PROJECT!!!
5+
- Due: Tuesday, July 30, 2019 (Second Demo)
6+
- Professor: Nathaly Verwaal
7+
- Source code name: Coin.Java
8+
********************************************************************************/
9+
10+
import javafx.scene.Node;
11+
import javafx.scene.paint.Color;
12+
import javafx.scene.shape.Circle;
13+
14+
public class Coin {
15+
16+
Node entity;
17+
18+
/**********************************************************************
19+
Function name: public Node createEntity
20+
Parameter list: int x, int y, int w, int h, Color color
21+
Return: entity
22+
Purpose: this function has the outline for the coin class. The values for
23+
the variables are located in the main class.
24+
************************************************************************/
25+
26+
public Node createEntity(int x, int y, int w, Color color) {
27+
Circle aEntity = new Circle(w);
28+
aEntity.setTranslateX(x);
29+
aEntity.setTranslateY(y);
30+
aEntity.setFill(color);
31+
aEntity.getProperties().put("alive", true);
32+
entity = aEntity;
33+
Game.gameRoot.getChildren().add(entity);
34+
return entity;
35+
}
36+
37+
public Node getCoin() {
38+
return entity;
39+
}
40+
41+
42+
43+
}

src/Enemy.java

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*******************************************************************************
2+
- Full name: Asad Choudhry, Osama Hameed, Deliar Mohammadi, Oscar Campos
3+
- Class: CPSC and Class Number 233
4+
- Assignment: AOOD PROJECT!!!
5+
- Due: Tuesday, July 30, 2019 (Second Demo)
6+
- Professor: Nathaly Verwaal
7+
- Source code name: Enemy.Java
8+
********************************************************************************/
9+
10+
import javafx.scene.Node;
11+
import javafx.scene.paint.Color;
12+
import javafx.scene.shape.Rectangle;
13+
14+
/**********************************************************************
15+
Function name: public Node createEntity
16+
Parameter list: int x, int y, int w, int h, Color color
17+
Return: entity
18+
Purpose: this function has the outline for the enemy, values for the
19+
variables are generated in the main.
20+
************************************************************************/
21+
22+
public class Enemy {
23+
24+
Node entity;
25+
26+
27+
public Node createEntity(int x, int y, int w, int h, Color color) {
28+
Rectangle aEntity = new Rectangle(w,h);
29+
aEntity.setTranslateX(x);
30+
aEntity.setTranslateY(y);
31+
aEntity.setFill(color);
32+
aEntity.getProperties().put("alive", true);
33+
entity = aEntity;
34+
Game.gameRoot.getChildren().add(entity);
35+
return entity;
36+
}
37+
38+
public Node getEnemy() {
39+
return entity;
40+
}
41+
42+
43+
44+
45+
}

0 commit comments

Comments
 (0)