package com.example.helloandroid; import java.util.ArrayList; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.FontMetrics; public class Planet { int radius; int regenRate; // ships per second private int x; private int y; int faction; int numShips; boolean selected; private Bitmap selection; public Planet(int radius, int x, int y) { this.radius = radius; this.x = x; this.y = y; faction = 0; numShips = 0; selected = false; regenRate = 0; //change this to some expression / funcion call int size = getRadius()+15; selection = Bitmap.createBitmap(size*2, size*2, Bitmap.Config.ARGB_8888); Canvas c = new Canvas(selection); c.drawColor(Color.argb(0, 0, 0, 0)); Paint p = new Paint(); p.setAntiAlias(true); p.setColor(Color.argb(255, 255, 255, 255)); c.drawCircle(size, size, getRadius()+9, p); p.setColor(Color.argb(255, 100, 100, 100)); c.drawCircle(size, size, getRadius()+5, p); for(int i=0; i curPlanets) { for(Planet p2 : curPlanets) { if(p.collides(p2)) return true; } return false; } }