public bool Collided(Weapon w, EnemyWeapon ew, Texture2D RadiusImage1) { if (distance(w.Position.X, w.Position.Y, ew.Position.X, ew.Position.Y) < FindRadius(RadiusImage1)) { return(true); } else { return(false); } }
public bool Collided(float x, float y, EnemyWeapon weapon, Texture2D RadiusImage1) { if (distance(x, y, weapon.Position.X, weapon.Position.Y) < FindRadius(RadiusImage1)) { return(true); } else { return(false); } }
public Enemy(Texture2D image, float x, float y, EnemyWeapon weapon, Color theColor) { speedIncrement = 0.004f; speedDecrement = 0.96f; angularVelocityIncrement = .001111111f; AngularVelocityDecrement = 0.97f; velocityDecrement = 0.995f; angleIncrement = 0.1f; random = new Random(); this.theColor = theColor; this.weapon = weapon; this.image = image; this.x = x; this.y = y; //timeSinceLastFrame = weapon.Timer.ElapsedGameTime; position = new Vector2(x, y); velocity = new Vector2(0f, 0f); //angle = (float)((3 * Math.PI) / 2); angle = 0; angularVelocity = 0; time = CHANGEDIRECTIONTIME; }