Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Java game

uetian_cute
uetian_cute 


An Airfight Game in java is needed urgently Attachments Tags Clarifications

Answers

100% complete gane

uetian_cute
uetian_cute 



Inbox me for any help. Attachments
dogfight (1).zip (71 K) Download





















Preview
this.y = y; } /** * Get the x location * @return the x location */ public double getX() { return x; } /** * Set a new x location. * @param x the new x */ public void setX(double x) { this.x

Preview
= getY() - b.getY(); //the sum of the radii double sr = r + b.r; //sqrt is expensive, so instead of sqrt-ing the dx*dx+dy*dy, i square //the sum of the radii. It doesn't work if you need to know the //distance, but it works fine for collision detection. return

Preview
Pos origin; /** * Creates a new projectile. * @param speed the projectile's speed * @param bounds the projectile's bounds * @param space the space holding the projectile */ public Projectile(double speed, Bounds bounds, BattleSpace space) { super(speed, bounds, space); origin = new Pos(bounds.getX(), bounds.getY()); } /** * Draws

Preview
y position * @param time the duration * @param space the space holding it */ public Explosion(double x, double y, int time, BattleSpace space) { this.x = x; this.y = y; this.time = time; this.space = space; //it is a big explosion unless specified big = true; space.addExplosion(this); } /**

Preview
so if x goes above 50, //then set it to 0. (the grass images tile to make it look like a //smooth transition if (xDif >= 50) xDif = 0; //pause StdDraw from showing StdDraw.show(0); //clear the screen StdDraw.clear(); //reset the pen color StdDraw.setPenColor(); //this draws 12 tiles. only 9

Preview
of .02, and a bounding * circle at 0,0 with a radius of 1 */ public DogfightObject() { this(.02, new Bounds(0, 0, 1)); } /** * Creates a new DogfightObject with the given speed and bounds. * @param speed the speed * @param bounds the circle bounds */ public

Preview
moveX(getSpeed() * delta); //move in the y direction moveY(getSpeed() * delta); //if it collides with something, move back to where it was to prevent //overlapping if (testCollision()) { moveY(-getSpeed() * delta); moveX(-getSpeed() * delta); } //if its fire rate is not -1, then decrease the amound of time is left

Preview
is no collision boolean ret = false; //loop through every object in the battle space for (AerialObject ao : space.getAerialObjects()) { //if the object we are looking at is this one, skip it if (ao == this) { continue; } //otherwise, if the object collides with this one if (ao.collidesWith(this))

Preview
not. * @return true if the player won, false if not */ public boolean didPlayerWin() { return this.playerWon; } /** * Adds 'dif' to the current score. * @param dif the amount to add. */ public void addScore(int dif) { this.score += dif; } /** * Get the current

Preview
setAngle(-30); } if (getAngle() > 30) { setAngle(30); } //check to make sure it doesn't go off the map if (getX() < getBounds().getRadius()) { setX(getBounds().getRadius()); } else if (getY() < getBounds().getRadius()) { setY(getBounds().getRadius()); } else if (getX() + getBounds().getRadius() > 100) { setX(100 - getBounds().getRadius()); } else if (getY() +

Preview
pen radius private static double penRadius; // show we draw immediately or wait until next show? private static boolean defer = false; // boundary of drawing canvas, 5% border private static final double BORDER = 0.05; private static final double DEFAULT_XMIN = 0.0; private static final double DEFAULT_XMAX = 1.0;

Preview
xmlns="http://www.netbeans.org/ns/j2se-project/3"> <name>DogFight</name> <source-roots> <root id="src.dir"/>

Preview
<target name="-post-clean"> <!-- Empty placeholder for easier customization. --> <!-- You can override this target in the ../build.xml file. --> </target> <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/> <target name="-check-call-dep"> <property file="${call.built.properties}" prefix="already.built."/> <condition property="should.call.dep"> <not> <isset property="already.built.${call.subproject}"/> </not> </condition> </target

Preview

Preview
There exist several targets which are by default empty and which can be used for execution of your tasks. These targets are usually executed before and after some main targets. They are: -pre-init: called before initialization of project properties -post-init: called after initialization of project properties -pre-compile:

Screenshots
Screenshot
Purchase Answer