Changes in / [38ac100:69f6f01] in galcon-client
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/com/example/helloandroid/Fleet.java ¶
r38ac100 r69f6f01 236 236 237 237 double dist = Math.abs(destination.getY() - (Math.tan(direction)*destination.getX()) - xIntercept)/(double)Math.sqrt(Math.pow(direction,2)+1); 238 int allowedError = 2; 239 if(nearPlanet.radius <= 10) 240 allowedError = 10; 241 else if(nearPlanet.radius <= 30) 242 allowedError = 5; 243 if(dist < allowedError){ 238 if(dist < 2){ 244 239 dblY += (Math.sin(direction)*speed); 245 240 dblX += (Math.cos(direction)*speed); … … 251 246 isNextToAPlanet = false; 252 247 nearPlanet = null; 253 254 slope = getSlope(x,y,destination.getX(),destination.getY());255 256 xIntercept = destination.getY() - (slope*destination.getX());257 258 //direction259 direction = Math.atan(slope);260 261 //coordinates for all 4 coordinates262 if((destination.getX() - x) < 0 )263 direction += Math.PI;264 248 } 265 249 } else {
Note:
See TracChangeset
for help on using the changeset viewer.