-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.ctxt
85 lines (85 loc) · 8.76 KB
/
Player.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#BlueJ class context
comment0.target=Player
comment0.text=\n\ This\ is\ the\ character\ that\ is\ controlled\ by\ the\ person\ playing\ the\ game.\n\ This\ class\ contains\ methods\ to\ fill\ in\ for\ the\ ones\ the\ superclass\ is\ missing.\n\ It\ also\ has\ some\ add-ons,\ like\ trading,\ inspecting\ art,\ and\ using\ a\ flashlight.\n\ \n\ @author\ Isabel\ Rosa\n
comment1.params=currentRoom\ w\ cd\ name
comment1.target=Player(greenfoot.Actor,\ greenfoot.World,\ ChangeableData,\ java.lang.String)
comment1.text=\n\ Constructor\ for\ Player\ class.\n\ Provides\ access\ to\ current\ room,\ world,\ and\ database.\n\ Gives\ character\ a\ name,\ scales\ the\ image,\ and\ adds\ the\ player\ to\ the\ world.\n
comment10.params=slope\ mX\ mY\ fX\ fY\ lw
comment10.target=void\ moveLight(double,\ double,\ double,\ double,\ double,\ Lighters)
comment10.text=\n\ The\ object\ that\ lights\ up\ the\ room\ moves\ according\ to\ this\ method.\n
comment11.params=slope\ mX\ mY\ fX\ fY\ lw
comment11.target=void\ xIncreasesLight(double,\ double,\ double,\ double,\ double,\ Lighters)
comment11.text=\n\ When\ the\ x\ coordinate\ of\ the\ object\ of\ the\ Lighter\ class\ (either\ LightsWay\ or\ an\ AntiLight)\ is\ increasing\ (the\ flashlight\ is\ being\ pointed\ to\ the\ right\ side\ of\ the\ screen\ relative\ to\ the\ player),\ this\ happens.\n\ The\ difference\ between\ when\ the\ flashlight\ is\ pointing\ left\ vs.\ right\ is\ in\ whether\ the\ variable\ mX\ increases\ or\ decreases\ when\ going\ through\ the\ for\ loop.\n
comment12.params=slope\ mX\ mY\ fX\ fY\ lw
comment12.target=void\ xDecreasesLight(double,\ double,\ double,\ double,\ double,\ Lighters)
comment12.text=\n\ When\ the\ x\ coordinate\ of\ the\ object\ of\ the\ Lighter\ class\ (either\ LightsWay\ or\ an\ AntiLight)\ is\ decreasing\ (the\ flashlight\ is\ being\ pointed\ to\ the\ left\ side\ of\ the\ screen\ relative\ to\ the\ player),\ this\ happens.\n\ The\ difference\ between\ when\ the\ flashlight\ is\ pointing\ left\ vs.\ right\ is\ in\ whether\ the\ variable\ mX\ increases\ or\ decreases\ when\ going\ through\ the\ for\ loop.\n
comment13.params=mX\ mY\ fX\ fY\ lw
comment13.target=void\ lightsOnOff(double,\ double,\ double,\ double,\ Lighters)
comment13.text=\n\ This\ is\ the\ method\ that\ is\ called\ to\ turn\ the\ lights\ on\ or\ off\ in\ the\ direction\ the\ flashlight\ is\ pointing.\n\ When\ a\ LightsWay\ object\ is\ put\ for\ the\ Lighters\ parameter,\ it\ makes\ a\ ray\ of\ light.\n\ When\ an\ AntiLight\ object\ is\ put\ for\ the\ Lighters\ parameter,\ it\ blacks\ out\ a\ previous\ ray\ of\ light.\n
comment14.params=tempmX\ tempmY\ tempthisX\ tempthisY
comment14.target=void\ blackOut(double,\ double,\ double,\ double)
comment14.text=\n\ Since\ Greenfoot\ is\ dumb\ and\ rounds\ to\ ints\ when\ getting\ coordinates,\ it's\ impossible\ to\ have\ an\ AntiLight\ object\ follow\ the\ exact\ same\ path\ as\ a\ LightsWay\ object.\n\ For\ this\ reason,\ I\ have\ to\ make\ three\ AntiLight\ objects\ and\ cluster\ them\ in\ the\ same\ area\ with\ slightly\ different\ trajectories\ to\ cover\ enough\ ground\ to\ black\ out\ almost\ everywhere\ that\ needs\ to\ be\ blacked\ out.\n\ This\ method\ blacks\ out\ a\ ray\ of\ light\ that\ needs\ to\ be\ blacked\ out.\n
comment15.params=mX\ mY\ fX\ fY
comment15.target=void\ storeVars(double,\ double,\ double,\ double)
comment15.text=\n\ Once\ the\ player\ moves\ the\ mouse,\ the\ previous\ coordinates\ of\ the\ mouse\ are\ stored\ so\ I\ know\ where\ to\ aim\ the\ AntiLight\ objects\ when\ they\ get\ rid\ of\ the\ ray\ of\ light.\n\ This\ method\ stores\ those\ variables.\ Makes\ the\ vode\ a\ little\ more\ readable.\n
comment16.params=
comment16.target=void\ allLightsOut()
comment16.text=\n\ Once\ the\ player\ stops\ using\ the\ flashlight\ (pressing\ f),\ this\ method\ goes\ through\ and\ blacks\ out\ every\ single\ square\ just\ in\ case\ the\ three\ AntiLight\ objects\ missed\ some\ spots.\n
comment17.params=
comment17.target=void\ lights()
comment17.text=\n\ This\ whole\ method\ deals\ with\ the\ flashlight.\n\ If\ someone\ is\ pressing\ the\ "f"\ key,\ has\ a\ flashlight,\ and\ is\ in\ a\ dark\ room,\ they\ can\ use\ the\ flashlight.\n\ If\ the\ flashlight\ was\ on\ and\ the\ person\ moved\ their\ mouse,\ the\ AntiLight\ objects\ go\ out\ and\ turn\ off\ the\ previous\ ray\ of\ light,\ since\ the\ ray\ shouldn't\ still\ be\ bright\ if\ the\ player\ stopped\ pointing\ their\ light\ that\ way.\n\ Then,\ a\ new\ ray\ is\ created.\ Otherwise,\ if\ the\ "f"\ key\ isn't\ down\ but\ some\ lights\ were\ on,\ then\ everything\ gets\ blacked\ out.\n
comment18.params=
comment18.target=void\ sam()
comment18.text=\n\ This\ method\ is\ not\ used\ in\ anything.\ My\ friend\ Sam\ just\ wanted\ to\ see\ if\ this\ format\ works\ in\ Java\ since\ he\ knows\ it\ works\ in\ JavaScript\ but\ we\ didn't\ learn\ it\ in\ our\ Java\ class.\n\ Turns\ out\ it\ does\ work,\ as\ does\ my\ isClassInBag\ method.\ A\ win\ for\ all\!\n\ I\ thought\ that\ kind\ of\ formatting\ was\ super\ cool\ so\ I\ kept\ the\ method\ so\ I\ could\ look\ at\ it.\n
comment19.params=input\ pplInput
comment19.target=int\ doTrade(java.lang.String,\ java.lang.String)
comment19.text=\n\ This\ gets\ the\ value\ of\ the\ "input",\ which\ is\ the\ item\ the\ player\ chose\ to\ trade.\n\ Then,\ based\ on\ the\ value\ and\ the\ person\ they\ chose\ to\ trade\ with,\ it\ either\ performs\ the\ trade\ and\ prints\ a\ success\ message,\ or\ doesn't\ perform\ the\ trade\ and\ prints\ why.\n
comment2.params=
comment2.target=int\ getMoney()
comment2.text=\n\ Returns\ money\ currently\ with\ the\ player\ (achieved\ from\ trading\ items).\n
comment20.params=people
comment20.target=java.lang.String\ getTradePerson(java.util.List)
comment20.text=\n\ This\ gets\ and\ returns\ the\ player's\ choice\ of\ people\ to\ trade\ with.\n
comment21.params=
comment21.target=java.lang.String\ getTradeObject()
comment21.text=\n\ This\ gets\ and\ returns\ the\ player's\ choice\ of\ items\ to\ trade.\n
comment22.params=people
comment22.target=void\ removeSelfFromTraders(java.util.List)
comment22.text=\n\ This\ method\ removes\ the\ player\ from\ the\ list\ of\ people\ available\ to\ trade\ with.\n
comment23.params=
comment23.target=void\ tradeIfPossible()
comment23.text=\n\ If\ there\ are\ items\ in\ bag\ and\ people\ to\ trade\ with\ and\ the\ player\ picks\ one\ of\ each,\ the\ trade\ is\ processed\ and\ either\ occurs\ or\ doesn't\ depending\ on\ the\ trader\ and\ the\ item.\n\ Otherwise,\ an\ error\ message\ is\ printed.\n
comment24.params=
comment24.target=void\ inspectArt()
comment24.text=\n\ This\ method\ prints\ the\ results\ of\ the\ inspection.\ For\ each\ piece\ of\ art\ in\ the\ player's\ bag,\ a\ verdict\ is\ reached\ and\ printed.\n
comment25.params=
comment25.target=void\ moveLeftRight()
comment25.text=\n\ This\ is\ how\ the\ player\ controls\ horizontal\ movement.\n
comment26.params=
comment26.target=void\ moveUpDown()
comment26.text=\n\ This\ is\ how\ the\ player\ controls\ vertical\ movement.\n
comment27.params=
comment27.target=void\ movePerson()
comment27.text=\n\ This\ is\ how\ the\ person\ moves.\ It\ also\ contains\ the\ inspecting,\ trading,\ and\ flashlight\ using\ methods\ bc\ here\ was\ a\ convenient\ place\ to\ put\ them.\n
comment3.params=i
comment3.target=void\ setMoney(int)
comment3.text=\n\ Sets\ the\ money\ currently\ with\ the\ player\ to\ a\ certain\ number.\n\ Usually\ used\ to\ set\ money\ back\ to\ zero\ after\ depositing\ it\ in\ the\ bank.\n
comment4.params=
comment4.target=void\ lockedDoor()
comment4.text=\n\ When\ the\ player\ comes\ across\ a\ locked\ door,\ they\ get\ a\ message\ about\ it\ and\ bounce\ back\ a\ little\ bit.\n
comment5.params=
comment5.target=void\ removeAll()
comment5.text=\n\ This\ method\ removes\ everyone\ except\ the\ player,\ the\ placeholder\ (for\ dropping\ objects),\ and\ the\ class\ that\ gets\ the\ key\ being\ pressed.\n\ This\ is\ for\ use\ when\ the\ player\ moves\ rooms.\n
comment6.params=door
comment6.target=void\ setProperPlayerLocation(greenfoot.Actor)
comment6.text=\n\ This\ sets\ the\ player's\ location\ to\ right\ in\ front\ of\ the\ door\ they\ come\ out\ of\ when\ they\ move\ rooms.\n
comment7.params=
comment7.target=void\ moveRoom()
comment7.text=\n\ This\ is\ what\ happens\ when\ the\ player\ moves\ rooms.\n\ It\ gets\ the\ name\ of\ the\ room\ the\ player\ is\ moving\ to\ and\ finds\ the\ number\ of\ that\ room.\n\ Then,\ nearly\ everything\ gets\ removed\ from\ the\ world\ and\ a\ new\ room\ is\ created.\n
comment8.params=str
comment8.target=boolean\ isPersonThere(java.lang.String)
comment8.text=\n\ Determines\ if\ a\ certain\ person\ with\ a\ given\ String\ name\ is\ in\ the\ room\ the\ player\ is\ currently\ in.\n
comment9.params=c
comment9.target=boolean\ isClassInBag(java.lang.Class)
comment9.text=\n\ Returns\ true\ if\ an\ item\ of\ a\ given\ class\ is\ found\ in\ the\ player's\ bag.\n
numComments=28