Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
26bf7d7
Update Question3.java
DJ-Chao Sep 3, 2018
7a81aa2
Update Question2.java
DJ-Chao Sep 3, 2018
37b86c5
Update Question1.java
DJ-Chao Sep 3, 2018
5eab6cc
Update Question1.java
DJ-Chao Sep 4, 2018
e897eca
Fixed Eclipse
DJ-Chao Sep 4, 2018
79059db
Fixed Environment
DJ-Chao Sep 4, 2018
d9f2c86
Merge pull request #1 from SAREC-Lab/master
DJ-Chao Sep 9, 2018
7261766
Create UMLdiagram.pdf
DJ-Chao Sep 10, 2018
3e6d8fd
Add files via upload
DJ-Chao Sep 10, 2018
2ec9875
Delete UMLdiagram.pdf
DJ-Chao Sep 10, 2018
d0a6887
Add files via upload
DJ-Chao Sep 10, 2018
002a612
Create reflection.md
DJ-Chao Sep 10, 2018
e009d49
Create Reflection.md
DJ-Chao Sep 17, 2018
ea02ad4
Create OceanExplorer.java
DJ-Chao Sep 17, 2018
094d479
Create OceanMap.java
DJ-Chao Sep 17, 2018
0e8fcbf
Create Ship.java
DJ-Chao Sep 17, 2018
350876c
Create PirateShip.java
DJ-Chao Sep 17, 2018
3547696
Create hold.md
DJ-Chao Sep 17, 2018
fa11385
Added Images
DJ-Chao Sep 17, 2018
f20301c
Delete hold.md
DJ-Chao Sep 17, 2018
c978298
Added UML diagram
DJ-Chao Sep 17, 2018
cecf48f
Merge pull request #2 from SAREC-Lab/master
DJ-Chao Sep 25, 2018
d00b60a
Create Reflection.md
DJ-Chao Sep 26, 2018
09c4b7e
Create Simulation.java
DJ-Chao Sep 26, 2018
2c57042
Create Direction.java
DJ-Chao Sep 26, 2018
8cec33d
Create MapBuilder.java
DJ-Chao Sep 26, 2018
05a6c28
Create RailwayTracks.java
DJ-Chao Sep 26, 2018
6fac035
Create Road.java
DJ-Chao Sep 26, 2018
c51b8a9
Create GateClosed.java
DJ-Chao Sep 26, 2018
f90a700
Create GateClosing.java
DJ-Chao Sep 26, 2018
03b221c
Create GateOpen.java
DJ-Chao Sep 26, 2018
13b944c
Create GateOpening.java
DJ-Chao Sep 26, 2018
441dedf
Create IGateState.java
DJ-Chao Sep 26, 2018
de40140
Create CrossingGate.java
DJ-Chao Sep 26, 2018
bbfd992
Create CarImageSelector.java
DJ-Chao Sep 26, 2018
8caaa3a
Create IDisplay.java
DJ-Chao Sep 26, 2018
5aeb4a7
Create TracksDisplay.java
DJ-Chao Sep 26, 2018
74113b3
Create RoadDisplay.java
DJ-Chao Sep 26, 2018
3f77e26
Create MapDisplay.java
DJ-Chao Sep 26, 2018
01b9b4a
Create Car.java
DJ-Chao Sep 26, 2018
feec8e8
Create Train.java
DJ-Chao Sep 26, 2018
cd13aac
Create IVehicle.java
DJ-Chao Sep 26, 2018
15ee725
Create CarFactory.java
DJ-Chao Sep 26, 2018
c92c321
Create hold.md
DJ-Chao Sep 26, 2018
70ded87
Add files via upload
DJ-Chao Sep 26, 2018
e91a4fd
Delete hold.md
DJ-Chao Sep 26, 2018
7ebdd37
Update Reflection.md
DJ-Chao Sep 26, 2018
73d7757
Create hold.md
DJ-Chao Oct 3, 2018
358b912
Add files via upload
DJ-Chao Oct 3, 2018
86e0914
Delete hold.md
DJ-Chao Oct 3, 2018
be8e8a8
Create Chip.java
DJ-Chao Oct 3, 2018
4e5c05b
Create Game.java
DJ-Chao Oct 3, 2018
83d7786
Create GridMap.java
DJ-Chao Oct 3, 2018
9eaf982
Create Status.md
DJ-Chao Oct 3, 2018
96f1d2d
Create reflection.MD
DJ-Chao Oct 18, 2018
19e1be9
Add files via upload
DJ-Chao Oct 18, 2018
e08a833
Create hold.md
DJ-Chao Oct 18, 2018
d3fbb29
Delete hold.md
DJ-Chao Oct 18, 2018
1240888
Create hold.md
DJ-Chao Oct 18, 2018
dbd4016
Add files via upload
DJ-Chao Oct 18, 2018
f7820d7
Add files via upload
DJ-Chao Oct 18, 2018
f403bc7
Update reflection.MD
DJ-Chao Oct 18, 2018
92d9842
Add files via upload
DJ-Chao Oct 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions chip/interim Deliverable/Chip.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import java.awt.Point;
import java.util.Arraylist;

public class Chip
{
Point position = new Point();
private int xPos;
private int yPos;

public Chip()
{
currentLocation.setLocation(12, 12);
}

public void goRight()
{
if (position.getX()+1 <= 24)
position.setLocation(position.getX()+1, position.getY());
xPos++;
}

public void goWest()
{
if (position.getX()-1 >= 0)
position.setLocation(position.getX()-1, position.getY());
xPos--;
}

public void goNorth()
{
if (position.getX()-1 >= 0)
position.setLocation(position.getX(), position.getY()-1);
yPos--;
}

public void goSouth()
{
if (position.getY()+1 <= 24)
position.setLocation(position.getX(), position.getY()+1);
yPos++;
}
}
Binary file added chip/interim Deliverable/Chips UML.pdf
Binary file not shown.
31 changes: 31 additions & 0 deletions chip/interim Deliverable/Game.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyEvent;

public class Game extends Application
{
final int scale = 25;
public static void main(String[] args)
{
launch(args);
}

@Override
public void start(Stage chipStage) throws Exception
{
// Generate New Pane
AnchorPane root = new AnchorPane();
Scene scene = new Scene(root, 625, 625);
chipStage.setScene(scene);
chipStage.setTitle("My Chip Game");

GridMap map = new GridMap();
map.drawMap(root.getChildren(), scale);
GridMap.drawMap();
}
}
51 changes: 51 additions & 0 deletions chip/interim Deliverable/GridMap.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import javafx.collections.ObservableList;
import javafx.scene.shape.Rectangle;
import javafx.scene.Node;
import javafx.scene.paint.Color;
import java.util.Random;

public class GridMap
{
int[][] gridMap = new int[25][25];
final int dimensions = 25;

public void drawMap(ObservableList<Node> root, int scale)
{
for (int x = 0; x < dimensions; x++)
{
for (int y = 0; y < dimensions; y++)
{
Rectangle rect = new Rectangle(x * scale, y * scale, scale, scale);
rect.setStroke(Color.BLACK);
oceanGrid[x][y] = 0;
rect.setFill(Color.DARKGREY);
root.add(rect);
}
}
}

public int getStatus(int x, int y)
{
return gridMap[x][y];
}

public void setLevel(int lvl)
{
// a block with value '1' will be an untraversable block
// note that this could be a water block, in which case
// if a sand block is pushed over it, its value will flip

if (lvl == 1)
{

}
else if (lvl == 2)
{

}
else
{

}
}
}
5 changes: 5 additions & 0 deletions chip/interim Deliverable/Status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
As of now, a simple grid is all that is functionally complete. I am currently working on implementing chip so that he
can appropriately move around, as well as working on a sand block: the next logical steps from here would be to test
sandblock and add necessary code to have it interact properly when it would hit a water tile. The plan from here would
be to implement the bug and key classes in either order, and once these are all ultimately in place and working properly,
I will move on to designing the level structure via the interace and then wrap up the project from there
9 changes: 9 additions & 0 deletions chip/src/Block.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import javafx.scene.image.ImageView;

public interface Block
{
public ImageView getImageView();
public void setX(int x);
public void setY(int y);
public void setPosition(int x, int y);
}
60 changes: 60 additions & 0 deletions chip/src/Chip.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import java.awt.Point;
import java.util.ArrayList;

public class Chip
{
Point position = new Point();
private int xPos;
private int yPos;
ArrayList<Integer> keys = new ArrayList<Integer>();

public Chip()
{
position.setLocation(13, 13);
xPos = 13;
yPos = 13;
}

public void goRight()
{
if (position.getX()+1 <= 26)
position.setLocation(position.getX()+1, position.getY());
xPos++;
}

public void goLeft()
{
if (position.getX()-1 > 0)
position.setLocation(position.getX()-1, position.getY());
xPos--;
}

public void goUp()
{
if (position.getX()-1 > 0)
position.setLocation(position.getX(), position.getY()-1);
yPos--;
}

public void goDown()
{
if (position.getY()+1 <= 26)
position.setLocation(position.getX(), position.getY()+1);
yPos++;
}

public Point getPosition()
{
return this.position;
}

public ArrayList<Integer> getKeys()
{
return keys;
}

public void addKey(int key)
{
keys.add(key-1);
}
}
Loading