|
I just looked it up on sun. I found two things: Niether work how I want.
obj.wait(); and something random like:
try {
wait();
} check(InterruptedEvent e) {} |
|
MicroUserJoin Date: 2009-03-29 Post Count: 3601 |
[ Content Deleted ] |
|
zoo1997Join Date: 2009-03-09 Post Count: 415 |
larry, try this
http://java.sun.com/docs/books/tutorial/essential/concurrency/sleep.html |
|
fugglesJoin Date: 2008-03-01 Post Count: 13937 |
Don't waste your time learning binary. It is pointless. I was reading an article about it. Even if you do know it, you can't even make a simple Window with it. There are only a few people in the world who completely know it and they say you can't make a window with it. |
|
|
Binary is easy! 00101 = 5 :P |
|
|
|
sleep()? >_< could've know that.... |
|
|
what do i download for robocode |
|
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
Yesh! I made a 1337 bot in robocode. Well... half of one anyways. It's Robot class does nothing at all!
But other classes do the work and send data back to the bot.
It chooses between (currently 2 types of targetting, which are seperated from the rest of everything and interchangable) targetting methods based on damage per shot. |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
"It chooses between (currently 2 types of targetting, which are seperated from the rest of everything and interchangable) targetting methods based on damage per shot."
Forgot to mention that it also makes virtual bullets in order to asses this |
|
|
...I thought I was ok at it, you make me feel dumb xD. I edited the corner bot to move to another corner if it gets hit... yay? |
|
|
ROFL Meelo, that's an UBER misspelling of assess. |
|
|
how'd it get through the word filters xD |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
O_O
..||
..V
The wise bearded one says: "Oopsies" |
|
|
|
wise bearded man is right.
So meelo... ANTIGRAV? |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
Here's all the code in the bot.
package haxbot;
import robocode.*;
//import java.awt.Color;
/**
* Haxxor - a robot by (your name here)
*/
public class Haxxor extends AdvancedRobot
{
/**
* run: Haxxor's default behavior
*/
protected Firer MainWeapons = new Firer(this);
public Point Position = new Point();
public Data Battle = new Data(this);
public double Height = 1000000;
public double Width = 1000000;
public void run() {
Height = getBattleFieldHeight();
Width = getBattleFieldWidth();
out.println("Running!");
turnRadarRight(360);
// After trying out your robot, try uncommenting the import at the top,
// and the next line:
//setColors(Color.red,Color.blue,Color.green);
while(true) {
MainWeapons.run();
Battle.run();
//execute();
scan();
}
}
/**
* onScannedRobot: What to do when you see another robot
*/
public void onScannedRobot(ScannedRobotEvent e) {
Battle.ScannedBot(e);
}
/**
* onHitByBullet: What to do when you're hit by a bullet
*/
public void onHitByBullet(HitByBulletEvent e) {
Battle.HitByBullet(e);
}
public void onStatus(StatusEvent e){
Position.x = e.getStatus().getX();
Position.y = e.getStatus().getY();
}
public void onPaint(java.awt.Graphics2D g) {
long t = getTime();
MainWeapons.Draw(g,t);
Battle.Draw(g,t);
}
public void onRobotDeath(RobotDeathEvent e){
Battle.getBot(e.getName()).alive = false;
}
public void onBulletMissed(BulletMissedEvent e){
WeaponsHelper Shooter = MainWeapons.getFirerOfBullet(e.getBullet());
if(Shooter == null) return;
Shooter.addMiss();
}
public void onBulletHit(BulletHitEvent e){
WeaponsHelper Shooter = MainWeapons.getFirerOfBullet(e.getBullet());
if(Shooter == null) return;
Shooter.addHit(Convert.getDamageFromBullet(e.getBullet().getPower()));
}
}
What's that you ask? What are all those functions I've never seen?
Spread over 8 other .java files |
|
|
larry, whats your robot do?
more on robocode: anyone want to set up a league? :P |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
What's a league and...
"So meelo... ANTIGRAV?"
My new bot has no movement. Yet.
I'm going to add a Guess Factor gun and then do:
Anti-Grav movement
Oscillation
"Meelo's Hybrid" |
|
|
Woah. Post #97 on thread. |
|
|
when I mean league I mean set up a site and battle eachother's robots.
I'm gonna do something like that. It will determing if it is getting to much and switch to the next strategy :P |
|
MeeloJoin Date: 2008-07-04 Post Count: 14763 |
O_o
My bot has a decent chance of killing walls without movement. |
|
|
...then it will switch to the ram strategy :P |
|
|
Ooops. Miscount, That was #95. This is most likely 98.
My bot is like the default "Walls", but it pwns more. 90% against all other bots. |
|