File tree Expand file tree Collapse file tree 17 files changed +75
-72
lines changed Expand file tree Collapse file tree 17 files changed +75
-72
lines changed Original file line number Diff line number Diff line change 1
1
#BlueJ class context
2
2
comment0.target=Archer
3
- comment0.text=\r\n\ Class\ Archer\ creates\ and\ draws\ the\ archers\ on\ the\ Canvas.\r\n\ This\ class\ is\ able\ to\ move\ the\ archers\ from\ right\ to\ left\ /\ left\ to\ right.\r\n\r\n\ \r\n\ @author\ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ v1.4 \ (03.06.2022\ 15\:35 )\r\n
3
+ comment0.text=\r\n\ Class\ Archer\ creates\ and\ draws\ the\ archers\ on\ the\ Canvas.\r\n\ This\ class\ is\ able\ to\ move\ the\ archers\ from\ right\ to\ left\ /\ left\ to\ right.\r\n\r\n\ \r\n\ @author\ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ v1.5 \ (03.06.2022\ 19\:20 )\r\n
4
4
comment1.params=inputplayer\ archercolor\ usedcanvas
5
5
comment1.target=Archer(int,\ java.awt.Color,\ Canvas)
6
6
comment1.text=\r\n\ Constructor\ for\ instances\ of\ Archer\r\n\r\n\ @param\ inputplayer\ \ \ \ current\ player\r\n\ @param\ archercolor\ \ \ color\ of\ the\ archer\r\n\ @param\ usedcanvas\ \ canvas\ where\ to\ plot\ the\ arrow\r\n
Original file line number Diff line number Diff line change 11
11
* Simon Cirdei
12
12
* Christoph Schramm
13
13
*
14
- * @version v1.4 (03.06.2022 15:35 )
14
+ * @version v1.5 (03.06.2022 19:20 )
15
15
*/
16
16
public class Archer extends Game
17
17
{
Original file line number Diff line number Diff line change 1
1
#BlueJ class context
2
2
comment0.target=Arrow
3
- comment0.text=\r\n\ Class\ Arrow\ calculates\ the\ trajectory\ of\ the\ "arrow".\ \r\n\ This\ class\ is\ able\ to\ draw\ and\ erase\ the\ arrow.\r\n\r\n\ \r\n\ @author\ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ v1.4 \ (03.06.2022\ 15\:35 )\r\n
3
+ comment0.text=\r\n\ Class\ Arrow\ calculates\ the\ trajectory\ of\ the\ "arrow".\ \r\n\ This\ class\ is\ able\ to\ draw\ and\ erase\ the\ arrow.\r\n\r\n\ \r\n\ @author\ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ v1.5 \ (03.06.2022\ 19\:20 )\r\n
4
4
comment1.params=inputcolor\ usedcanvas
5
5
comment1.target=Arrow(java.awt.Color,\ Canvas)
6
6
comment1.text=\r\n\ Constructor\ for\ instances\ of\ Arrow\r\n\r\n\ @param\ inputcolor\ \ color\ of\ the\ arrow\r\n\ @param\ usedcanvas\ \ canvas\ where\ to\ plot\ the\ arrow\r\n
Original file line number Diff line number Diff line change 12
12
* Simon Cirdei
13
13
* Christoph Schramm
14
14
*
15
- * @version v1.4 (03.06.2022 15:35 )
15
+ * @version v1.5 (03.06.2022 19:20 )
16
16
*/
17
-
18
17
public class Arrow extends Game
19
18
{
20
19
private Color localcolor , colpl1 , colpl2 ; // local variant of color of the arrow
Original file line number Diff line number Diff line change 1
1
#BlueJ class context
2
2
comment0.target=CanvasBG
3
- comment0.text=\r\n\ The\ class\ CanvasBG\ is\ one\ of\ the\ most\ important\ classes\ for\ the\ game\ 2Darts.\r\n\ The\ class\ is\ able\ to\ draw\:\ \r\n\ \ \ \ \ \ \ \ \ \ -\ the\ target\ of\ the\ dartboard\ \r\n\ \ \ \ \ \ \ \ \ \ -\ the\ two\ archers\r\n\ \ \ \ \ \ \ \ \ \ -\ the\ score\ of\ both\ players\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ CanvasBG\ also\ moves\ the\ arrow\ trough\ the\ dashboard.\ Loops\ calculates\ the\ positions\ and\ points.\r\n\ The\ change\ of\ the\ players\ is\ also\ implemented\ here.\ \r\n\ \r\n\ @author\ \ \ \ \ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ r\n\ @version\ \ \ \ \ v1.4 \ (03.06.2022\ 15\:35 )\r\n
3
+ comment0.text=\r\n\ The\ class\ CanvasBG\ is\ one\ of\ the\ most\ important\ classes\ for\ the\ game\ 2Darts.\r\n\ The\ class\ is\ able\ to\ draw\:\ \r\n\ \ \ \ \ \ \ \ \ \ -\ the\ target\ of\ the\ dartboard\ \r\n\ \ \ \ \ \ \ \ \ \ -\ the\ two\ archers\r\n\ \ \ \ \ \ \ \ \ \ -\ the\ score\ of\ both\ players\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ CanvasBG\ also\ moves\ the\ arrow\ trough\ the\ dashboard.\ Loops\ calculates\ the\ positions\ and\ points.\r\n\ The\ change\ of\ the\ players\ is\ also\ implemented\ here.\ \r\n\ \r\n\ @author\ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ v1.5 \ (03.06.2022\ 19\:20 )\r\n
4
4
comment1.params=inputa\ starttarget
5
5
comment1.target=CanvasBG(short,\ int)
6
6
comment1.text=\r\n\ Constructor\ for\ instances\ of\ the\ CanvasBG\ (dashboard)\r\n\r\n\ @param\ inputa\ \ \ \ \ \ \ \ input\ from\ user\ for\ target\ size\r\n\ @param\ startarget\ \ \ \ input\ from\ user\ for\ beginning\ of\ target\r\n
Original file line number Diff line number Diff line change 12
12
* CanvasBG also moves the arrow trough the dashboard. Loops calculates the positions and points.
13
13
* The change of the players is also implemented here.
14
14
*
15
- * @author Johannes Richter
16
- * Simon Cirdei
17
- * Christoph Schramm
18
- *
19
- * @version v1.4 (03.06.2022 15:35 )
15
+ * @author Johannes Richter
16
+ * Simon Cirdei
17
+ * Christoph Schramm
18
+ *
19
+ * @version v1.5 (03.06.2022 19:20 )
20
20
*/
21
21
public class CanvasBG extends Game
22
22
{
Original file line number Diff line number Diff line change 1
1
#BlueJ class context
2
2
comment0.target=Game
3
- comment0.text=\r\n\ \r\n\ @author\ JR,\ CS,\ SVC \r\n\ @version\ v1.4 \ (03.06.2022\ 15\:35 )\r\n
3
+ comment0.text=\r\n\ \r\n\ @author\ \ Johannes\ Richter \r\n\ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ v1.5 \ (03.06.2022\ 19\:20 )\r\n
4
4
comment1.params=args
5
5
comment1.target=void\ main(java.lang.String[])
6
6
comment2.params=
Original file line number Diff line number Diff line change 2
2
3
3
/**
4
4
*
5
- * @author JR, CS, SVC
6
- * @version v1.4 (03.06.2022 15:35)
5
+ * @author Johannes Richter
6
+ * Simon Cirdei
7
+ * Christoph Schramm
8
+ *
9
+ * @version v1.5 (03.06.2022 19:20)
7
10
*/
8
11
public class Game
9
12
{
10
13
private Terminal terminal ; //Global terminal
11
- protected final String version = "v1.4 " ; //This version number
14
+ protected final String version = "v1.5 " ; //This version number
12
15
protected static int canvasHeight = 700 ; //Height of the canvas in px. Default: 700
13
16
protected static int canvasWidth = 1000 ; //Width of the canvas in px. Default: 1000
14
17
protected static int wallStart = 100 ; //Start of the wall in px. Default: 100
@@ -23,7 +26,7 @@ public class Game
23
26
protected static final double timestep = 0.05 ; //Seconds of difference for trajectory calc. Default: 0.05
24
27
protected static double angleMin = 10 ; //Minimum angle of the arrow in degrees. Default: 10
25
28
protected static double angleMax = 60 ; //Maximum angle of the arrow in degrees. Default: 60
26
- protected static double speedMin = 7 ; //Minimum speed of the arrow in px/s. Default: 7
29
+ protected static double speedMin = 10 ; //Minimum speed of the arrow in px/s. Default: 10
27
30
protected static double speedMax = 25 ; //Maximum speed of the arrow in px/s. Default: 25
28
31
protected static final int player = 2 ; //Number of players Default: 2
29
32
protected static final short qsA = 30 ; //value A for quickstart
Original file line number Diff line number Diff line change 1
1
#BlueJ class context
2
2
comment0.target=Points
3
- comment0.text=\r\n\ The\ class\ points\ sets\ the\ color\ of\ the\ player-scores\ \r\n\ and\ prints\ the\ scores\ on\ the\ dashboard.\r\n\ \r\n\ @author\ \ \ \ \ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ \ \ \ \ v1.4 \ (03.06.2022\ 15\:35 )\r\n
3
+ comment0.text=\r\n\ The\ class\ points\ sets\ the\ color\ of\ the\ player-scores\ \r\n\ and\ prints\ the\ scores\ on\ the\ dashboard.\r\n\ \r\n\ @author\ \ \ \ \ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ \ \ \ \ v1.5 \ (03.06.2022\ 19\:20 )\r\n
4
4
comment1.params=playerno\ playerscore\ usedcanvas
5
5
comment1.target=Points(int,\ int,\ Canvas)
6
6
comment1.text=\r\n\ Constructor\ for\ instances\ of\ Points\r\n\r\n\ @param\ playerno\ \ \ \ current\ player\r\n\ @param\ playerscore\ score\ of\ player\ \ \ \ \r\n\ @param\ usedcanvas\ \ canvas\ where\ to\ plot\ the\ points/score\ \r\n
Original file line number Diff line number Diff line change 8
8
* Simon Cirdei
9
9
* Christoph Schramm
10
10
*
11
- * @version v1.4 (03.06.2022 15:35 )
11
+ * @version v1.5 (03.06.2022 19:20 )
12
12
*/
13
13
public class Points extends Game
14
14
{
Original file line number Diff line number Diff line change 1
1
#BlueJ class context
2
2
comment0.target=Terminal
3
- comment0.text=\r\n\ \r\n\ The\ Terminal\ creates\ the\ field/dashboard.\r\n\ It\ is\ also\ able\ to\ open\ a\ console\ for\ the\ input\ of\ the\ game\ instructions.\r\n\ Terminal\ gets\ and\ checks\ the\ user\ inputs.\r\n\ \r\n\ One\ important\ thing\ is\ to\ give\ messages\ and\ feedback\ to\ the\ user.\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\ game\ instruction\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\ hints\ for\ inputs\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\ help\r\n\ \r\n\ @author\ \ \ \ \ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n \ \ \ \ \ \ \ \ \ \ \ \ \ \ Christoph\ Schramm \r\n\ @version\ \ \ \ \ v1.4 \ (03.06.2022\ 15\:35 )\r\n
3
+ comment0.text=\r\n\ \r\n\ The\ Terminal\ creates\ the\ field/dashboard.\r\n\ It\ is\ also\ able\ to\ open\ a\ console\ for\ the\ input\ of\ the\ game\ instructions.\r\n\ Terminal\ gets\ and\ checks\ the\ user\ inputs.\r\n\ \r\n\ One\ important\ thing\ is\ to\ give\ messages\ and\ feedback\ to\ the\ user.\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\ game\ instruction\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\ hints\ for\ inputs\r\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ -\ help\r\n\ \r\n\ @author\ \ Johannes\ Richter\r\n\ \ \ \ \ \ \ \ \ \ Simon\ Cirdei\r\n\ \ \ \ \ \ \ \ \ \ Christoph\ Schramm\r\n\ \ \ \ \ \ \ \ \ \ \r\n\ @version\ v1.5 \ (03.06.2022\ 19\:20 )\r\n
4
4
comment1.params=
5
5
comment1.target=void\ newGame()
6
6
comment1.text=\r\n\ The\ method\ game\ checks\ all\ the\ inputs\ of\ the\ players\ and\ runs\ selected\ loops.\r\n\ Instructions\ and\ errors/feedback\ will\ be\ given\r\n
@@ -16,8 +16,8 @@ comment2.text=\r\n\ The\ method\ checks\ explicity\ the\ user\ input\ for\ the\
16
16
comment3.params=
17
17
comment3.target=void\ inputForDeveloperMode()
18
18
comment3.text=\r\n\ The\ method\ checks\ explicity\ the\ user\ input\ for\ the\ target-size\r\n
19
- comment4.params=
20
- comment4.target=void\ startGame()
19
+ comment4.params=restart
20
+ comment4.target=void\ startGame(boolean )
21
21
comment4.text=\r\n\ the\ method\ starts\ the\ game\:\r\n\ \ \ \ \ \ \ \ \ \ -\ inputs\ will\ be\ collected\r\n\ \ \ \ \ \ \ \ \ \ -\ score\ is\ initialised\ to\ zero\r\n\ \ \ \ \ \ \ \ \ \ -\ rounds\ is\ initialised\ to\ 1\r\n\ \ \ \ \ \ \ \ \ \ -\ the\ first\ player\ player\ becomes\ the\ currentplayer\r\n\ \ \ \ \ \ \ \ \ \ -\ a\ new\ surface\ (canvas)\ will\ be\ opened\r\n\ \ \ \ \ \ \ \ \ \ -\ printing\ of\ score\ and\ archers\r\n
22
22
comment5.params=
23
23
comment5.target=void\ swapPlayers()
You can’t perform that action at this time.
0 commit comments