Robocode. What is Robocode? Robocode is an easy-to-use robotics battle simulator. You create a robot, put it onto a battlefield, and let it battle to.

Slides:



Advertisements
Similar presentations
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Advertisements

CS0004: Introduction to Programming Visual Studio 2010 and Controls.
Robocode Some Methods and Ideas. Robot anatomy 101 Just like the real thing … it has a gun that rotates a radar on top that also rotates tank, gun and.
Lesson One: The Beginning Chapter 2: Processing Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from built-in help reference.
Greenfoot Asteroids Mrs. C. Furman August 16, 2010.
This Week Cover as much Robocode strategy as we can Monday: Robocode
Welcome to E-Prime E-Prime refers to the Experimenter’s Prime (best) development studio for the creation of computerized behavioral research. E-Prime is.
Graduate Capstone Project Breaking Walls: Developing a Successful Robot in Robocode Chris Velez Summer 2011 Advisor :Dr. Xiang.
Design, Implementation, & Impact Jeffrey Santos Hofstra University May, 2010.
Java Applets A First Program. Applet Example /* The world’s simplest program, repeated once more in another format in an attempt to turn all of you into.
Graphics Programming. In this class, we will cover: The difference between AWT and Swing Creating a frame Frame positioning Displaying information in.
Java Programming Working with TextPad. Using TextPad to Work with Java This text editor is designed for working with Java You can download a trial version.
1 Applets Chapter 1 To understand:  why applets are used to extend the capabilities of Web pages  how an applet is executed and know about the restrictions.
ObjectDraw and Objects Early Chris Nevison Barbara Wells.
Evolving Killer Robot Tanks Jacob Eisenstein. Why Must We Fight? Giving the people what they want Essence of embodiment: Moving around and surviving in.
Lesson One: The Beginning
Great teaching/ learning aid … OO Threading Packaging Inheritance Polymorphism Calling API code Event handling Inner classes Java docs How to duck… Consume.
Unity 3D game IDE 1.  Unity is a multi-platform, integrated IDE for scripting games, and working with 3D virtual worlds  Including:  Game engine ▪
Guide to Programming with Python
SuperCorners. Problem The Corners sample robot has a simple strategy: first, move into a corner of the arena, and second sweep the gun back and forth.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 12 Using the KToolbar Rob Pooley
How does Robocode work? In short it is a framework
Autonomous Tracking Robot Andy Duong Chris Gurley Nate Klein Wink Barnes Georgia Institute of Technology School of Electrical and Computer Engineering.
Java Programming, 3e Concepts and Techniques Chapter 3 Section 65 – Manipulating Data Using Methods – Java Applet.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
CSE AI Game Programming. Installation 
POS 406 Java Technology And Beginning Java Code
CSE AI Game Programming. Installation 
Graphic User Interface. Graphic User Interface (GUI) Most of us interact with computers using GUIs. GUIs are visual representations of the actions you.
Assignments. AnatomyBot.java Create a robot that turns all of it parts independently (vehicle, gun, and radar). Turn the vehicle left 360 o Turn the gun.
Learning Unity. Getting Unity
Microsoft® Small Basic Collision Detection Estimated time to complete this lesson: 1 hour.
Session 16 Pinball Game Construction Kit:. Pinball Version 1 Replaced the fire button with a mouse event. Multiple balls can be in the air at once. –Uses.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
VI EDITOR University of Mississippi. Vi Editor What is Vi ? ▫Vi is a screen based editor. ▫The screen of your terminal will act as a window into the file.
University of Limerick1 Computer Applications CS 4815 Robocode.
My Second Robot. Anatomy of a Robot A robot consists of 3 independently moving parts: Vehicle - determines the direction in which the robot will move.
Java Programming, Second Edition Appendix A Working with Java SDK 1.4.
CS324e - Elements of Graphics and Visualization Timing Framework.
Graphics Concepts CS 2302, Fall /17/20142 Drawing in Android.
1 Applets are small applications that are accessed on an Internet server, transported over the internet, automatically installed and run as a part of web.
Seminar for Participants An Introduction on Robocode.
Adding Text and Navigation to the Home Page – Lesson 51 Adding Text and Navigation to the Home Page Lesson 5.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
CIS Intro to JAVA Lecture Notes Set 8 9-June-05.
Lesson 2: Reading a program. Remember: from yesterday We learned about… Precise language is needed to program Actors and Classes Methods – step by step.
Vex Robotics Program four: reversing and turning.
Warship C++: An entity of Battleship
List Boxes and Combo Boxes Provides a list of items to select from Various styles — choose based on Space available Need to select from an existing list.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
(1) Introduction to Robocode Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Intoduction to Andriod studio Environment With a hello world program.
Java With NetBeans First Project. Java Are language for this semester is Java The Development Environment is Netbeans.
Robocode. Robocode: basics Coords. are (x,y), with bottom left as (0,0) Heading: degrees, straight up = 0, pos. clockwise (0
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Introduction to Programming using Java
MOM! Phineas and Ferb are … Aims:
Winning Strategy in the Programming Game Robocode
Applets.
Winning Strategy in Programming Game Robocode
TexPREP Summer Camp Computer Science
Ellen Walker Hiram College
Computer Application AutoCAD Program
MTAT , 2CP Seminar Ilja Livenson
Welcome to E-Prime E-Prime refers to the Experimenter’s Prime (best) development studio for the creation of computerized behavioral research. E-Prime is.
How to Add a New page to the St. Andrew’s Website
Constructors, GUI’s(Using Swing) and ActionListner
Marine Biology Simulation Part II: Assignment, Milestone 1
Robocode A robot is made up of 3 things:
Presentation transcript:

Robocode

What is Robocode? Robocode is an easy-to-use robotics battle simulator. You create a robot, put it onto a battlefield, and let it battle to the bitter end against opponent robots created by other developers. Robocode comes with a set of pre-fab opponents to get you started, but once you outgrow them, you can enter your creation against the world's best in one of the leagues being formed worldwide.

Components of Robocode When you activate Robocode, you will see two interrelated GUI windows, which form Robocode's IDE they are: – The battlefield Where the battle between robots plays out. You can create save and open new or existing battles. Provides statistics of any robot in the arena – The Robot Editor A text editor for editing Java source code that make up your robot. Create a robot compile it, and you are ready for battle

Anatomy of a Robot A robot is a graphical tank: The robot has a rotating gun On top of the gun is rotating radar Both can rotate independently And in any direction. By default they are aligned.

Anatomy of Robot Code All Robots have a class – Class name is name of robot All extend either Robot or AdvancedRobot All have a run method Here is where you put your robot commands import robocode.*; import java.awt.Color; Public class Cyborg extends Robot { public void run() { }

Popular Commands Moving the robot – turnRight(double degree) and turnLeft(double degree) Turn the robot by a specified degree. – ahead(double distance) and back(double distance) Move the robot by the specified pixel distance; these two methods are completed if the robot hits a wall or another robot. – turnGunRight(double degree) and turnGunLeft(double degree) Turn the gun, independent of the vehicle's direction. – turnRadarRight(double degree) and turnRadarLeft(double degree) turn the radar on top of the gun, independent of the gun's direction (and the vehicle's direction).

More Movement Commands setAdjustGunForRobotTurn(boolean flag): – If the flag is set to true, the gun will remain in the same direction while the vehicle turns. setAdjustRadarForRobotTurn(boolean flag): – If the flag is set to true, the radar will remain in the same direction while the vehicle (and the gun) turns. setAdjustRadarForGunTurn(boolean flag): – If the flag is set to true, the radar will remain in the same direction while the gun turns. It will also act as if setAdjustRadarForRobotTurn(true) has been called.

Obtaining Robot Information getX() and getY() – get the current coordinate of the robot. getHeading(), getGunHeading(), and getRadarHeading() – get the current heading of the vehicle, gun, or radar in degrees. getBattleFieldWidth() and getBattleFieldHeight() – get the dimension of the battlefield for the current round.

Firing and Energy Each robot starts out with a default "energy level," – Considered destroyed when its energy level falls to zero. When firing, the robot can use up to three units of energy – The more energy supplied to the bullet, the more damage it will inflict on the target fire(double power) and fireBullet(double power)

Events Events are things that you react to. – Like your doorbell ringing. In Robocode there are several you can react to: ScannedRobotEvent. – Handle the ScannedRobotEvent by overriding the onScannedRobot() method; this method is called when the radar detects a robot. HitByBulletEvent. – Handle the HitByBulletEvent by overriding the onHitByBullet() method; this method is called when the robot is hit by a bullet. HitRobotEvent. – Handle the HitRobotEvent by overriding the onHitRobot() method; this method is called when your robot hits another robot. HitWallEvent. – Handle the HitWallEvent by overriding the onHitWall() method; this method is called when your robot hits a wall.

First Robot package dw; import robocode.*; /** * DWStraight - a robot by (developerWorks borrowed by Glenn Stevenson) */ public class DWStraight extends Robot {... // > /** * run: DWStraight's default behavior */ public void run() {... // > while(true) {... // > }... // > public void onScannedRobot(ScannedRobotEvent e) { fire(1); }

Code Additions

Getting Information Robocode Home – Robocode API – Robocode Getting Started Wiki –