-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameWindow.ctxt
31 lines (31 loc) · 1.96 KB
/
GameWindow.ctxt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#BlueJ class context
comment0.params=
comment0.target=GameWindow()
comment0.text=\r\n\ Sets\ up\ the\ initial\ game\ state\ and\ creates\ all\ GUI\ components\ required.\r\n
comment1.params=recreate\ resize
comment1.target=void\ init(boolean,\ boolean)
comment1.text=\r\n\ Initialises\ the\ window\ with\ all\ GUI\ and\ game\ components.\r\n\ @param\ recreate\ If\ true,\ initialise\ new\ top-level\ window.\ If\ not,\ only\ initialise\ game\ application\ and\ \r\n\ Component\ objects.\r\n\ @param\ resize\ If\ true,\ the\ game\ grid\ reinitialises\ with\ the\ size\ specified\ by\ user\ input.\r\n
comment2.params=
comment2.target=void\ setColours()
comment2.text=\r\n\ Assigns\ colours\ to\ each\ tile\ type.\r\n
comment3.params=direction
comment3.target=void\ changeDirection(Direction)
comment3.text=\r\n\ Mutator\ method\ for\ the\ direction\ variable,\ ensures\ snake\ cannot\ go\ back\ on\ itself.\r\n\ @param\ direction\ The\ new\ direction\r\n
comment4.params=
comment4.target=void\ runOneStep()
comment4.text=\r\n\ Runs\ the\ game\ one\ step.\r\n\ Moves\ and\ repaints\ any\ occupied\ tiles,\ as\ well\ as\ checking\ whether\ game\ is\ still\ running.\r\n\ If\ player\ lost,\ display\ a\ dialogue\ box.\r\n
comment5.params=
comment5.target=void\ start()
comment5.text=\r\n\ Runs\ the\ game\ with\ a\ delay.\ Sets\ the\ delay\ of\ each\ step\ in\ the\ game\ to\ 200ms.\r\n
comment6.params=e
comment6.target=void\ actionPerformed(java.awt.event.ActionEvent)
comment7.params=
comment7.target=void\ stop()
comment7.text=\r\n\ Stops\ the\ game\ and\ all\ UI\ components\r\n
comment8.params=
comment8.target=void\ reset()
comment8.text=\r\n\ Resets\ the\ game\ to\ its\ initial\ state,\ doesn't\ recreate\ the\ top-level\ window.\r\n
comment9.params=e
comment9.target=void\ actionPerformed(java.awt.event.ActionEvent)
comment9.text=\r\n\ Handles\ ActionEvents\ occuring\ when\ a\ game-controlling\ button\ or\ menu\ item\ is\ interacted\ with\r\n\ @param\ e\ The\ event\ to\ handle\r\n
numComments=10