Robocode A robot is made up of 3 things:

Slides:



Advertisements
Similar presentations
Managing the Learn to Swim Class To Enhance Great Teaching.
Advertisements

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.
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.
Greenfoot Asteroids Mrs. C. Furman August 16, 2010.
This Week Cover as much Robocode strategy as we can Monday: Robocode
Graduate Capstone Project Breaking Walls: Developing a Successful Robot in Robocode Chris Velez Summer 2011 Advisor :Dr. Xiang.
EVENT DRIVEN SCRIPTING Andrew Williams. Robot Scripting Language  In the lab we looked at some very simple examples of Robot Scripting Language (RSL)
Movement. Fixed Movement setLocation (x, y) Makes the crab move to a fixed cell x,y Relative Movement The functions: getX() getY() Fetch the x and y coordinate.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 5 Interactive Programs.
CSC Intro. to Computing Lecture 17: Even More Robotran!
Great teaching/ learning aid … OO Threading Packaging Inheritance Polymorphism Calling API code Event handling Inner classes Java docs How to duck… Consume.
Simple Python Loops Sec 9-7 Web Design.
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.
Java for Robots How to program an NXT robot with a Java Brain Bert G. Wachsmuth Seton Hall University.
How does Robocode work? In short it is a framework
Karel J Robot An introduction to BlueJ and Object- Oriented Programming.
CSE AI Game Programming. Installation 
CMSC 202 Exceptions. Aug 7, Error Handling In the ideal world, all errors would occur when your code is compiled. That won’t happen. Errors which.
CPS120 Introduction to Computer Science Iteration (Looping)
CSE AI Game Programming. Installation 
Overview of Project 3 Slides are available at : Updated 1/28 Due Date for project has been extended to next Friday 2/6.
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.
Wall Encounter By Made easy by Dwayne Abuel.
Threaded Programming in Python Adapted from Fundamentals of Python: From First Programs Through Data Structures CPE 401 / 601 Computer Network Systems.
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.
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
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.
Seminar for Participants An Introduction on Robocode.
The Robot and the Wall Introduction to Pseudocode Your Name Goes Here.
Simple Collision Detection By David Yan Under the direction of Professor Susan Rodger and Chari Distler Duke University, June 2015.
ROBOTIC ARM 2 Wilmer Arellano © Hardware  Next slide shows sensor connection to analog pin 0 and Motor 1 connection. Lecture is licensed under.
Lesson 2: Reading a program. Remember: from yesterday We learned about… Precise language is needed to program Actors and Classes Methods – step by step.
Available at: – Program Functions to Accept Values Program Functions to Accept Values.
(1) Introduction to Robocode Philip Johnson Collaborative Software Development Laboratory Information and Computer Sciences University of Hawaii Honolulu.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Robocode. Robocode: basics Coords. are (x,y), with bottom left as (0,0) Heading: degrees, straight up = 0, pos. clockwise (0
Ultrasonic Radar with USB missile launcher Present by: Virendrasinh Jadeja( ) Parshotam Rozara ( ) Haresh Pithiya ( )
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Introduction to Programming using Java
Jonathon Kuo Under the Direction of Dr. Susan Rodger
Multithreading / Concurrency
Threaded Programming in Python
Winning Strategy in the Programming Game Robocode
Scratch for Interactivity
Applets.
Logger, Assert and Invariants
Winning Strategy in Programming Game Robocode
JavaScript Event Handling.
Introduction to Triggers
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops
Programming Scratch to Control a K’NEX Fairground Ride
MOMENTUM.
How to Stop the Bullying!
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
LRobot Game.
MTAT , 2CP Seminar Ilja Livenson
Introduction to TouchDevelop
The switch statement: an alternative to writing a lot of conditionals
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Multithreading.
> Other ways to navigate space
Constructors, GUI’s(Using Swing) and ActionListner
Game Over Module 4 Lesson 2.
Programming games Demonstrate cannonball
Python 16 Mr. Husch.
Threads and Multithreading
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Learning Objectives Describe what an adaptation is
Lesson One Movement.
CMSC 202 Exceptions.
Presentation transcript:

Robocode A robot is made up of 3 things: The vehicle The gun, which sits on the body The radar, which sits on the gun These 3 parts can move independent of each other. Let’s go over the basics of how to create a robot…

Commands for moving the robot, gun, and radar These methods are part of the robocode.Robot class… turnRight(double degree) & turnLeft(double degree) Ahead(double distance) & back(double distance) These methods stop if you hit a wall or another robot turnGunRight(double degree) & turnGunLeft The gun can turn independent of the vehicle turnRadarRight(double degree) & turnRadarLeft Again, the radar can turn independent of vehicle, gun

When the vehicle turns, the gun & radar also turn by default, unless you call one of these methods: setAdjustGunForRobotTurn(boolean flag) If flag==true, gun will NOT change direction even if vehicle does setAdjustRadarForRobotTurn(boolean flag) Same idea as above setAdjustRadarForGunTurn(boolean flag)

Obtaining Info about the robot getX() and getY() Get the coordinates of the robot getHeading() Gets current heading of vehicle, in degrees getGunHeading() getRadarHeading() getBearing() Finds another robot in location to you (see board) getBattleFieldWidth() & getBattleFieldHeight()

Firing Bullets Each robot starts with a default energy level Ways to lose energy: Get hit by a bullet Hit a wall or another robot Fire a bullet The more power put into a bullet, the more energy used, but the more damage inflicted Method: fire(double power) You gain energy when your bullet hits another robot

Event handling When certain events occur, your Robot will follow default behavior – unless you handle any of these events: ScannedRobotEvent When your radar detects another robot HitByBulletEvent HitRobotEvent HitWallEvent There are many other methods that you should research

Basic structure of a Robot: Package mq; // my initials import robocode.*; public class QuinnRobot extends Robot { // set instance variables here public void run() { // code here will execute only once…used // to set up the robot while(true) { // code for repetitive action goes here } // helper methods & event handlers go here

Assignment Go to robowiki.net. Read the “My First Robot Tutorial.” Create your first robot, using the basic skills taught in the tutorial. Begin reading other robowiki tutorials/articles. 4. Study the code of already existing robots in the RobotsSample folder Continue working on your robot. The melee will most likely be held this Friday. After that, at some point, there will be an NCAA-style one-on-one tournament.