Ball crBall(float y, float spd) { Ball b = new Ball("ball-titan"); //, new Vector2(2.1f, y), new Vector2(collideXposDefault, y), spd); b.Position = new Vector2(2.1f, y); float collideXposDefault = ship.Position.X + ship.WidthAbsolute / 2 + b.RadiusAbsolute; b.TargetPosition = new Vector2(collideXposDefault, y); b.VelocityScalar = spd; PowerRingWhenShipHitBehavior eff = new PowerRingWhenShipHitBehavior(); eff.RingWidth = 5.0f; eff.RingRadius = 0.07f; eff.RingColor = Color.DarkGreen; eff.Alpha = 0.5f; b.Add(eff); b.Add(new NRGcharge(Color.SeaGreen)); return b; }
Ball crBall(float y, float spd) { Ball b = new Ball("ball-supernova"); //, new Vector2(2.1f, y), new Vector2(collideXposDefault, y), spd); b.Position = new Vector2(2.1f, y); float collideXposDefault = ship.Position.X + ship.WidthAbsolute / 2 + b.RadiusAbsolute; b.TargetPosition = new Vector2(collideXposDefault, y); b.VelocityScalar = spd; PowerRingWhenShipHitBehavior eff = new PowerRingWhenShipHitBehavior(); eff.RingWidth = 5.0f; // TODO higher is less wide eff.RingRadius = 0.07f; //eff.RingColor = Color.DarkGreen; eff.RingColor = Color.Tomato; eff.Alpha = 0.5f; b.Add(eff); b.Add(new NRGcharge(Color.White)); b.Add(new BallAvoidanceBehavior()); //b.Add(new BallBallCollisionBehavior()); b.Add(new BallShipCollisionBehavior()); return b; }