code invaders

Information about code invaders

Published on November 6, 2007

Author: Miguel

Source: authorstream.com

Content

Code Invaders:  Code Invaders All your code now belong to us Make your time What’s An AI:  What’s An AI Alan Turing (1950) Turing Test Can computer’s think? "The question of whether a computer can think is no more interesting than the question of whether a submarine can swim.” - Dijkstra What is an AI? Let’s Play Some Games:  Let’s Play Some Games Snakes and Ladders Battleships TicTacToe Checkers Chess Go Your Mission should you choose to accept it:  Your Mission should you choose to accept it Develop an AI for a ship Points for collecting energy Points for delivering energy to your home world Points Shooting the Enemy Evaluate current situation Perform an action given that situation The computer does not think Let’s Review:  Let’s Review What is AI? What is the Turing Test? Does Snakes and Ladders need AI? Does TicTacToe need AI? What are the steps in AI? Setup:  Setup Eclipse plugin CSB computers have Code Invaders installed Download Eclipse and plugin www.eclipse.org http://slammer.cs.dal.ca/~cjordan CodeInvaders zip file Unzip into plugin directory Does not work on Mac Getting Started:  Getting Started Start Eclipse File -> New -> Project Other -> Game Project Select Code Invaders Name your project Select a directory for your workspace U drive, USB stick Ok Rookies, Let’s take off:  Ok Rookies, Let’s take off This is a fresh install Your ship does nothing Select games.xml Name your ship and organization Add yourself Run Escape quits early Each match runs for a set number of turns 1200 Move Your Zig:  Move Your Zig Every turn your ship’s move method is called src -> default package -> MySpaceShip.java You can put all your code in move(int) this.setThrust(SpaceShip.MAX_THRUST); Run again double target = this.getHeadingTo(this.getHomePlanet()); this.turnToHeading(target); Run again Some Documentation:  Some Documentation Help -> Help Contents -> CodeInvaders -> CodeInvaders Manual Use the Eclipse auto help this. Wait See the info box? Some Ship Functions:  Some Ship Functions fire() - fires a shot at current heading pulse() - pulse wave is fired setShieldUp() - rises shield for 30 turns getDistanceTo(IObject) - distance to object setRotationThrust(double) - turning speed beamEnergy() - beam energy to planet beamEnergy(IShip) - energy to ship getMyDrones() - an array of your drones The World:  The World World.getOtherShips() - array of ships World.getOtherDrones() - array of drones World.getEnergySources() - array of energy source World.getBullets() - array of bullets World.getPulses() - array of pulses Fighting Other Ships:  Fighting Other Ships Add other sample ships Run a server Window -> Preferences -> Games -> Start Other people can now submit ships to your server games.xml -> Game Server Server host name = your computer Submit Code Add other people’s ships Run Designing your AI:  Designing your AI Evaluate game conditions Like TicTacToe! if (Chris is awesome) give him good evaluation else if (class boring) beat Chris else if (confused) rise hand if (sleepy) drink coffee Another layer of complexity:  Another layer of complexity Droids Same capabilities as your ships Stores less energy Smaller You have 3 of them Counters Declare them in your MySpaceShip class Initialize them in initialize() Use them in move() Someone set us up the bomb:  Someone set us up the bomb Term Project Report Explain your strategy Explain different conditions you test for Explain different actions you perform Explain what priorities you have Code Comment each code block if/else while for Any complex chunk of code Demo For Great Justice:  For Great Justice You will fight the Wong-a-tor Victors will get a 5% Bonus Mark You will fight each other Winner has lunch with the Dean

Related presentations


Other presentations created by Miguel

Att5 India
27. 03. 2008
0 views

Att5 India

FAPRI Biofuels addendum 2
04. 10. 2007
0 views

FAPRI Biofuels addendum 2

agroterrorism
24. 10. 2007
0 views

agroterrorism

991112 price grid
24. 10. 2007
0 views

991112 price grid

56157
29. 10. 2007
0 views

56157

PMA URS31 IACSDUBAI VANCOUVER
08. 11. 2007
0 views

PMA URS31 IACSDUBAI VANCOUVER

jaipur
28. 11. 2007
0 views

jaipur

MH1
28. 11. 2007
0 views

MH1

ES 832 Lect 4
06. 12. 2007
0 views

ES 832 Lect 4

01guber
25. 10. 2007
0 views

01guber

Moore 16Mar05 Digits vs RDOs
01. 11. 2007
0 views

Moore 16Mar05 Digits vs RDOs

2007FLawards
02. 11. 2007
0 views

2007FLawards

ESD Wood preservatives BH
12. 11. 2007
0 views

ESD Wood preservatives BH

kotlerkeller chapter 14
15. 11. 2007
0 views

kotlerkeller chapter 14

ICATforWCC 002
16. 11. 2007
0 views

ICATforWCC 002

jaguar
20. 11. 2007
0 views

jaguar

Uganda
24. 10. 2007
0 views

Uganda

Predation07
30. 12. 2007
0 views

Predation07

Selim hydropower
22. 11. 2007
0 views

Selim hydropower

InstantMessaging
30. 12. 2007
0 views

InstantMessaging

2005 skin ppt
03. 01. 2008
0 views

2005 skin ppt

Crypto durant la 2nd guerre
04. 01. 2008
0 views

Crypto durant la 2nd guerre

absorption
04. 01. 2008
0 views

absorption

Tech Preso
07. 01. 2008
0 views

Tech Preso

Andhra Pradesh
07. 01. 2008
0 views

Andhra Pradesh

Pumpkins Squash
05. 11. 2007
0 views

Pumpkins Squash

Target System Design Update
07. 11. 2007
0 views

Target System Design Update

SgrA Reid
15. 11. 2007
0 views

SgrA Reid

The Next Great Generation
02. 10. 2007
0 views

The Next Great Generation

EigenTrust
18. 12. 2007
0 views

EigenTrust

Carlstrom
14. 11. 2007
0 views

Carlstrom

MTTppsb
05. 11. 2007
0 views

MTTppsb

installingvaporrecov ery
06. 11. 2007
0 views

installingvaporrecov ery

ShiftShare
20. 02. 2008
0 views

ShiftShare

ch5FamilyCharacteris tics
24. 02. 2008
0 views

ch5FamilyCharacteris tics

zuccaarl08
27. 02. 2008
0 views

zuccaarl08

Bill Presentation
05. 03. 2008
0 views

Bill Presentation

1 HGIS011006
25. 10. 2007
0 views

1 HGIS011006

matmata
12. 12. 2007
0 views

matmata

SKADS MCCT Controllers 22032007
14. 03. 2008
0 views

SKADS MCCT Controllers 22032007

WSISRO Openinghbn110702
30. 03. 2008
0 views

WSISRO Openinghbn110702

cert microsoft 03
28. 11. 2007
0 views

cert microsoft 03

g rime
06. 11. 2007
0 views

g rime

MalaysiaMar2206
13. 04. 2008
0 views

MalaysiaMar2206

Buildup Activities
22. 11. 2007
0 views

Buildup Activities

Unit 5 1 2004
01. 01. 2008
0 views

Unit 5 1 2004

rm1910
30. 10. 2007
0 views

rm1910

TRIMS InvClimate Eng
26. 10. 2007
0 views

TRIMS InvClimate Eng

02 06 chistov
27. 09. 2007
0 views

02 06 chistov

BioBank SheilaCasserly
28. 09. 2007
0 views

BioBank SheilaCasserly

atividadefisicaeobes idade
28. 12. 2007
0 views

atividadefisicaeobes idade

saghala Cedric Patin
28. 11. 2007
0 views

saghala Cedric Patin