Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

did the required changes #14

Open
wants to merge 76 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
b966d45
Changed background to back, changed square color to green, changed
tredfern1 Feb 7, 2021
ac76e6d
Revert "Changed background to back, changed square color to green, ch…
tredfern1 Feb 7, 2021
f00259c
changed square from yellow to green, changed square to a rectangle
tredfern1 Feb 7, 2021
aa15d78
Changed the rectangle from solid to hollow
tfranks31 Feb 8, 2021
3753299
changed square size
ksmith6767 Feb 8, 2021
415c13b
changed size again
ksmith6767 Feb 8, 2021
560f82b
Update GameView.java
ktanzosh Feb 9, 2021
6f12344
made the square thick
ericjohns55 Feb 9, 2021
dab2045
Update GameView.java
huntress284 Feb 9, 2021
9a56694
Changed square size, color and speed.
DonaldHakeII Mar 5, 2017
f15d4a4
Update GameView.java
huntress284 Feb 10, 2021
94f5d71
Changed square color to mangenta and increased size by 50%
ZIRoberts Feb 10, 2021
76fa4a2
Square Modifications
Liam920 Feb 10, 2021
9cea39d
Added & applied new background color
Derek-Herr77 Feb 10, 2021
cd4cc96
changed color and size
sausan22 Feb 11, 2021
00841b6
Changed width and height to 42, changed color to pink
Feb 11, 2021
cc6b13e
Update GameView.java
jack16816 Feb 11, 2021
e4fc969
Update GameView.java
rblack5 Feb 11, 2021
fb27557
Added color Red, changed background to Red, changed cube to blue
KarthikeyanCOTM Feb 11, 2021
040c19d
Changed Background and Square Color
EthanYCP Feb 11, 2021
ae2b6ac
did the required changes
darkloor Feb 11, 2021
935053a
Update GameView.java
michaelfeldman1 Feb 12, 2021
126fa7d
Changed square height and background color
michaelfeldman1 Feb 12, 2021
962d329
MoveTheSquare
CloudyMJ Feb 12, 2021
d31a85a
made wider
iarnold885113 Feb 12, 2021
58f2d30
wider
iarnold885113 Feb 12, 2021
771a354
Changed the color and made wide.
wbatchelor Feb 12, 2021
239fc70
circles are better
robjtede Feb 17, 2021
5dd7405
l33tsp3ak
robjtede Feb 17, 2021
8745dbb
Merge pull request #23 from robjtede/ilikecircle
KaiFish Feb 17, 2021
2eb58cc
Merge branch 'master' into coolkid
KaiFish Feb 17, 2021
76b6706
Merge pull request #24 from robjtede/coolkid
KaiFish Feb 17, 2021
d0b6f79
Update README.md
KaiFish Feb 17, 2021
ea48537
Merge pull request #8 from KaiFish/jquinteros
KaiFish Feb 17, 2021
e449c70
Merge branch 'master' into dherr
KaiFish Feb 17, 2021
78550c9
Merge pull request #19 from KaiFish/dherr
KaiFish Feb 17, 2021
bd5f742
Merge pull request #3 from KaiFish/ksmith126
ksmith6767 Feb 17, 2021
9df9bab
Merge branch 'master' into jsnyder17
ksmith6767 Feb 17, 2021
eac2f1b
Merge branch 'master' into ssanjuan1
jack16816 Feb 17, 2021
9ac801a
Merge pull request #22 from KaiFish/jsnyder17
ksmith6767 Feb 17, 2021
b13a480
Merge branch 'attempt3' into khunt6
jsnyder17 Feb 17, 2021
1f93155
Merge pull request #7 from KaiFish/ssanjuan1
jack16816 Feb 17, 2021
bdf7821
Merge branch 'master' into khunt6
jack16816 Feb 17, 2021
03dd3dd
Merge pull request #6 from KaiFish/khunt6
jack16816 Feb 17, 2021
1329034
Merge branch 'master' into lbradley1
ksmith6767 Feb 17, 2021
5b0c615
Merge pull request #14 from KaiFish/lbradley1
ksmith6767 Feb 17, 2021
4906eb6
Merge branch 'master' into ktanzosh
ktanzosh Feb 17, 2021
34ef5d9
Merge branch 'master' into master
Derek-Herr77 Feb 17, 2021
45d3c18
Merge pull request #2 from tredfern1/master
Derek-Herr77 Feb 17, 2021
3bf0e2d
Merge branch 'master' into ktanzosh
Derek-Herr77 Feb 17, 2021
1d7be8c
Merge pull request #15 from ktanzosh/ktanzosh
Derek-Herr77 Feb 17, 2021
c6fca59
Super Important Contribution
jgross11 Feb 17, 2021
828cb54
Merge pull request #26 from KaiFish/Super-Important-Contribution-Branch
KaiFish Feb 17, 2021
64585fa
Merge pull request #1 from KaiFish/tfranks
KaiFish Feb 17, 2021
286916f
Merge branch 'master' into rblack5
KaiFish Feb 17, 2021
5c536b9
Merge pull request #9 from KaiFish/rblack5
KaiFish Feb 17, 2021
558b958
Merge branch 'master' into rdean3
ericjohns55 Feb 17, 2021
81f6943
Merge pull request #21 from KaiFish/rdean3
ericjohns55 Feb 17, 2021
3142d48
Merge branch 'master' into mfeldman1
ericjohns55 Feb 17, 2021
4314965
Merge pull request #16 from michaelfeldman1/mfeldman1
ericjohns55 Feb 17, 2021
f0fe7e7
Merge branch 'master' into esnyder16
ericjohns55 Feb 17, 2021
e072c99
Merge pull request #12 from KaiFish/esnyder16
ericjohns55 Feb 17, 2021
fc51b28
Merge branch 'master' into mmcleod2
KarthikeyanCOTM Feb 17, 2021
6013919
Merge pull request #17 from CloudyMJ/mmcleod2
KarthikeyanCOTM Feb 17, 2021
6c7098d
Merge branch 'master' into master
tfranks31 Feb 17, 2021
d8e4f1b
Merge branch 'master' into master
darkloor Feb 17, 2021
e3fa07e
Merge branch 'master' into ejohns1
jkop09 Feb 17, 2021
feaf119
Merge pull request #5 from KaiFish/ejohns1
jkop09 Feb 17, 2021
28ba8c2
Merge branch 'master' into master
tfranks31 Feb 17, 2021
6ac292b
Merge pull request #20 from wbatchelor/master
tfranks31 Feb 17, 2021
132080c
Merge branch 'master' into jkopelcheck
tfranks31 Feb 17, 2021
b64a0bb
Merge pull request #13 from KaiFish/jkopelcheck
tfranks31 Feb 17, 2021
8b4fe75
Merge branch 'master' into zroberts1
tfranks31 Feb 17, 2021
c1a3ed1
Merge pull request #10 from KaiFish/zroberts1
tfranks31 Feb 17, 2021
4473723
Merge branch 'master' into rgartrell
darkloor Feb 17, 2021
1a9c134
Merge branch 'master' into rgartrell
darkloor Feb 17, 2021
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
Binary file added .DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions .classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="MoveTheSquare/src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>MoveTheSquare</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Binary file added MoveTheSquare/.DS_Store
Binary file not shown.
11 changes: 11 additions & 0 deletions MoveTheSquare/.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1612931757265</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
Binary file added MoveTheSquare/src/.DS_Store
Binary file not shown.
Binary file added MoveTheSquare/src/edu/.DS_Store
Binary file not shown.
Binary file added MoveTheSquare/src/edu/ycp/.DS_Store
Binary file not shown.
Binary file added MoveTheSquare/src/edu/ycp/cs320/.DS_Store
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions MoveTheSquare/src/edu/ycp/cs320/movethesquare/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions MoveTheSquare/src/edu/ycp/cs320/movethesquare/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>movethesquare</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,24 @@ public void computeSquareMoveDirection(Game game, Square square, double mouseX,
moveY = -Game.MOVE_DIST;
}

game.setSquareDx(moveX);
game.setSquareDx(moveX);
game.setSquareDy(moveY);
}
}

public void moveSquare(Game model, Square square) {
if (((square.getX() + square.getWidth()) + model.getSquareDx() > model.getWidth()) ||
((square.getX() + model.getSquareDx() < 0))) {
square.setX(model.getWidth()/2);
}

square.setX(square.getX() + model.getSquareDx());

if (((square.getY() + square.getHeight()) + model.getSquareDy() > model.getHeight()) ||
((square.getY() + model.getSquareDy() < 0))) {
square.setY(model.getHeight()/2);
}

square.setY(square.getY() + model.getSquareDy());
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package edu.ycp.cs320.movethesquare.model;

public class Game {
public static final double MOVE_DIST = 2.0; // x/y distance square moves each tick

public static final double MOVE_DIST = 6.0; // x/y distance square moves each tick

private double width, height;
private Square square;
private double squareDx;
Expand Down
36 changes: 29 additions & 7 deletions MoveTheSquare/src/edu/ycp/cs320/movethesquare/ui/GameView.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@
import edu.ycp.cs320.movethesquare.model.Square;

public class GameView extends JPanel {
private static final Color MIDNIGHT_BLUE = new Color(25, 25, 112);


private static final Color MIDNIGHT_BLUE = new Color(212, 112, 112);

private static final Color GRAY = new Color(105, 110, 115);

private static final Color Sunset_Red = new Color(220, 49, 11);
private static final Color RED = new Color(100, 0, 0);


private Game model;
private GameController controller;
Expand All @@ -26,8 +34,13 @@ public class GameView extends JPanel {
public GameView(Game model) {
this.model = model;
setPreferredSize(new Dimension((int) model.getWidth(), (int)model.getHeight()));
setBackground(MIDNIGHT_BLUE);

setBackground(GRAY);





// djh2-KEC119-21: changed from 30 to 45
// djh2-YCPlaptop: change from 45 to 100
this.timer = new Timer(1000 / 100, new ActionListener() {
Expand Down Expand Up @@ -66,11 +79,18 @@ protected void paintComponent(Graphics g) {

// djh2-KEC110-21: changed from GREEN to RED
// djh2-YCPlaptop: change from RED to YELLOW
g.setColor(Color.YELLOW);

g.setColor(Color.GREEN);

//g.setColor(Color.GREEN);


// lbradley1: change from YELLOW to BLUE
//setColor(Color.BLUE);
Square square = model.getSquare();

g.fillRect((int) square.getX(), (int) square.getY(), (int) square.getWidth(), (int) square.getHeight());
g.fillOval((int) square.getX(), (int) square.getY(), (int) square.getWidth(), (int) square.getHeight());

}

public static void main(String[] args) {
Expand All @@ -84,8 +104,10 @@ public void run() {
Square square = new Square();
square.setX(300.0);
square.setY(220.0);
square.setWidth(40.0);
square.setHeight(40.0);

square.setWidth(80.0);
square.setHeight(80.0);

model.setSquare(square);

GameController controller = new GameController();
Expand All @@ -103,4 +125,4 @@ public void run() {
}
});
}
}
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
MoveTheSquare
=============

The game engine for the next great indie game.

Expand Down
Binary file not shown.
Binary file added bin/edu/ycp/cs320/movethesquare/model/Game.class
Binary file not shown.
Binary file not shown.
Binary file added bin/edu/ycp/cs320/movethesquare/ui/GameView$1.class
Binary file not shown.
Binary file not shown.
Binary file added bin/edu/ycp/cs320/movethesquare/ui/GameView.class
Binary file not shown.