![Page 1: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/1.jpg)
Dr.C
Needs time for reflection
![Page 2: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/2.jpg)
Away From The Rut
![Page 3: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/3.jpg)
In a Monastery
![Page 4: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/4.jpg)
Down To Earth
But Up and Beyond!
![Page 5: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/5.jpg)
A place to Contemplate
?
?
![Page 6: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/6.jpg)
And to Seek out that Gate
![Page 7: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/7.jpg)
To Discover Classes of Objects
By observing
Our Physical World.
![Page 8: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/8.jpg)
What are the Classes?
Their Attributes?
Their Methods?
The essence of their being?
![Page 9: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/9.jpg)
What are the Classes?
But His Students need security!
![Page 10: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/10.jpg)
1. “Critically analyze and suitably modify a given object-oriented program design for a specified problem”
2. “Apply an object-oriented program design to code, document and test an appropriate program using advanced object-oriented techniques”.
3. “Critically evaluate an object-oriented program”.
Extend “negotiated” classes
Make and document a “game”
Evaluate your game :
• What You wanted to do
• How well the Java OOP worked to help you realize your intentions
• Problems I encountered with this OOP approach. How I solved them – or not!
Ie., … Assessment Info!
![Page 11: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/11.jpg)
BasicTile
RoadTile
BuildingTile
ActiveTile
MyTile
GameObject
Player Tank BlueBall
MyGObj
Pickup
Crystal Bomb MyPickupGame GameGU
I
![Page 12: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/12.jpg)
Platform Games
CBP March 2006
Tile-Space (i,j) = (14,10)Pixel-Space (x,y) = (280,200)
![Page 13: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/13.jpg)
(3,2)
i
j
0 1 2 3 4
0
1
2
3
4
g2.drawImage(gObjIm,(int)xTL,(int)yTL,null);
public void convertIJtoXY() Centres the image in tile
![Page 14: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/14.jpg)
Some Ideas for States
standingfalling
NO_LEDGE
ON_LEDGENO_LEDGEON_LEDGE
jumping
KEY_PRESS
![Page 15: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/15.jpg)
Flat Games
![Page 16: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/16.jpg)
Your TaskAn Idea – Something cool
• What Objects to I need?
• Tiles, players, bots, pickups?
• What is their behaviour ?
• How do I code this in a FSM ?
• Top Down Thinking
• Reflect on my whole idea
• What interactions to I need between all objects?
• Bottom Up Thinking
• Consider each object - its behaviour
• How do I code this as a FSM?
![Page 17: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/17.jpg)
Or else – Total Thinking
• Consider the game I wish to make
• Objects (Player, Bots); Actions, Inter-Actions
• Components and the Whole
•How can our “negotiated classes” support this?
• extend existing classes
• write new classes
Your Task
![Page 18: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/18.jpg)
Get Out there!
• Do some Research!
• Platform Games what are they?
• Look, Play, Analyze, Evaluate, THINK!
Look Around and Look Inside
• What excites me?
• Do I have an intention?
• Something simple (Safe Option) or something compleX. Or start simple then extend !
• A “Business Game”? An “Educational Game?”?
Your Task
![Page 19: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/19.jpg)
Documenting your code with javadoc
/** * An ActiveTile is the substrate of the game to which other objects are added * * @param i horizontal coordinate in "tile-space" * @param j vertical coordinate in "tile-space" * @param name The name of the active tile graphic image * @param canvas The GameCanvas object where the active tiles are drawn */
public ActiveTile(int i, int j, String name, GameCanvas canvas) {
super(i,j,name,canvas); }
A. The Constructor1. Start of doc
2. End of doc
3. Parameters
![Page 20: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/20.jpg)
Documenting your code with javadocB. Methods
/** Retrieves requested BasicTile from this tile, returns null if it not found * Call this method when you want to see if this tile contains a certain BasicTile * or subclass, eg "RoadTile" or "BuildingTile" or "MyTile" * @param objectClassName Any BasicTile subclass * @return The first BasicTile of the requested class found on this tile, or null if * there's none. */ public BasicTile getIfBasicTile(String objectClassName) {
return found; }
![Page 21: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/21.jpg)
Documenting your code with javadoc
![Page 22: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/22.jpg)
Building a Player step() method -0-
Remove Object from Tile
Look for Collision or Boundary
found
Calc new position
Look for Other Events
Add Object to Tile
Calc new position
Y
N
![Page 23: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/23.jpg)
step() {
ActiveTile acTile = canvas.findActiveTile(i,j);
acTile.removeGameObjectFromContents(this);
int urgentEvent = boundaryDetect(vI,vJ);
if(urgentEvent == BOUNDARY) FSMPlayer(state,BOUNDARY);
if(urgentEvent == NO_EVENT){
FSMPlayer(state,event);
}
acTile = canvas.findActiveTile(i,j);
acTile.addGameObjectToContents(this);
}
Building a Player step() method -1-
Event here from Keyboard
1. Remove Object from Tile
2. Set new position
3. Or Set new position
4. Move to New Tile
![Page 24: Dr.C Needs time for reflection. Away From The Rut](https://reader035.vdocuments.net/reader035/viewer/2022081603/56649efd5503460f94c11a8b/html5/thumbnails/24.jpg)
step() {
... // EG check to see if we have hit a blue ball and take some action
BlueBall ball = (BlueBall)acTile.getIfGameObject("BlueBall");
if(ball != null) {
FSMPlayer(state,TOUCH_WITH_BLUE);
event = TOUCH_WITH_BLUE;
}
if(urgentEvent == NO_EVENT){
FSMPlayer(state,event);
}
}
Building a Player step() method -2-
No Collision or Boundary