1 / 14

GTECH 731 Lab Session 10 11/2/10

GTECH 731 Lab Session 10 11/2/10. Lab 9 – ArcObjects Pseudo-code Example. Lab 9 – ArcObjects. Questions?. Designing Your Project. Have programming project in mind with geographic aspect Agent model More extensive drawing package Raster image manipulation

orrick
Download Presentation

GTECH 731 Lab Session 10 11/2/10

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GTECH 731Lab Session 10 11/2/10 Lab 9 – ArcObjects Pseudo-code Example

  2. Lab 9 – ArcObjects • Questions?

  3. Designing Your Project • Have programming project in mind with geographic aspect • Agent model • More extensive drawing package • Raster image manipulation • First step might be to visualize or imagine what you want to see happen on the screen • What happens when button “X” is clicked? • What happens when the mouse moves over object in scene? • What happens if mouse is clicked in image? • Describe, using plain language, what happens when you use your program • Then outline of steps needed to make your vision happen • Keep it abstract – don’t focus on minute programming steps • Map out high level, abstract steps to accomplish your goal

  4. Example – Nautical Navigation Game • A player guides a ship from a “Home Port” to a “Destination Port” while avoiding being pulled into a “Whirlpool”

  5. What is the Functionality of the Game • Click mouse to create “puff of wind” to “blow” the ship • Wind comes from click point and moves out in all directions • Ship moves in opposite direction or away from mouse click position • “Power” of wind is inversely proportional to distance of click point to ship • Whirlpool has “attractive power” pulling ship into the center • Power is inversely proportional to whirlpool distance to ship • Ship is “docked” at a port until clicks of “wind” move it away so that it no longer touches the port • When the ship is not “docked”, theWhirlpool pulls it to the center • Can move ship back and forth from port to port • Game ends when ship is pulled into whirlpool • Click “Restart Button”

  6. What are the basic steps for this or any game? • Setup the Game • Play the Game • End the Game

  7. Basic Steps Broken Down • Setup the Game • Build the Scene • Add Home Port • Add Destination Port • Add Whirlpool • Add Ship • Play the Game (based on events) • When mouse is clicked • If ship not stuck in whirlpool • Move ship away from mouse click position • Else • Restart game • At each time step • If ship is not docked and ship not stuck in whirlpool • Move ship toward whirlpool center • End the Game • Close program with click of “X” in upper right corner of window

  8. Outline Gives Clues to Coding Requirements • Setup the Game • Build the Scene • Add Home Port • Add Destination Port • Add Whirlpool • Add Ship • Play the Game • When mouse is clicked • If ship not stuck in whirlpool • Move ship away from mouse position • Else • Restart game • At each time step • If ship is not docked and ship not stuck • Move ship toward whirlpool • End the Game • Program closes with click of “X” in upper right corner of window Port Object Port Object Whirlpool Object Ship Object MouseUp Event Handler Boolean Variable “stuck”: interaction with Whirlpool Ship Object “Move” Method Rebuild the Scene Clock Tick Event Handler Boolean variables Stuck, Docked: interact Whirlpool Ports Ship Object “Move” Method Ship object interacts with Whirlpool object

  9. Outline Suggests Other Requirements • Setup the Game • Build the Scene • Add Home Port • Add Destination Port • Add Whirlpool • Add Ship • Draw the Scene • Play the Game • When mouse is clicked • If ship not stuck • Move ship away from mouse position • Check to see if ship docked • Redraw the Scene • Else • Restart game • At each time step • If ship is not docked and ship not stuck • Move ship toward whirlpool • Redraw the Scene • End the Game • Program closes with click of “X” in upper right corner of window

  10. More Detailed Requirements • Setup the Game • Build the Scene • Add Home Port • Create Port Class (may need initial information such as location relative to scene) • Information about size and position • Geometric object (Polygon) • Draw method • Add Destination Port • Ditto above(with different initial information such as location relative to scene) • Add Whirlpool • Create Whirlpool Class(may need initial information such as location and size relative to scene) • Information about attractive force and size • Geometric object (Point) • Draw method ?

  11. More Detailed Requirements • Add Ship • Create Ship Class(may need initial information such as direction and location relative to scene) • Information about travel direction and current position • Geometric object (Polygon) • Draw method • Move method (one for Wind and one for Whirlpool?) • Draw the Scene • Draw Home Port • Use Draw method • Draw Destination Port • Use Draw method • Draw Whirlpool • Use Draw method • Draw Ship • Use Draw method

  12. More Detailed Requirements • Play the Game • When mouse is clicked • If ship not stuck • Move ship away from mouse position • Calculate distance and direction from “wind” position to ship position • Move Ship according to direction and distance of mouse click to ship • Change Ship direction according to direction and distance of mouse click to ship • Check to see if ship docked • If Ship object overlaps Port object • Ship becomes docked • Redraw the Scene (as above) • Else • Restart game

  13. More Detailed Requirements • At each time step • If ship is not docked (ship stuck condition moved below ) • If Ship object overlaps buffer around Whirlpool center • Ship becomes stuck • If ship not stuck • Move ship toward whirlpool • Calculate distance and direction from Whirlpool to ship • Move Ship according to direction and distance to Whirlpool • Redraw the Scene (as above)

  14. Play the Whirlpool Game!

More Related