public void Randomize() { var r = new Random(); Position = World.RandomPosition(); Angle = (float)r.NextDouble() * MathF.PI * 2; ThrustAmount = World.Hook.FishThrust; }
public override void Init(World world) { base.Init(world); FlagGroup.Init(world); FlagGroup.ZIndex = 10; this.Group = FlagGroup; Position = world.RandomPosition(); }
public void Randomize() { var r = new Random(); Position = World.RandomPosition(); Momentum = new Vector2( (float)(r.NextDouble() * 2 * World.Hook.ObstacleMaxMomentum - World.Hook.ObstacleMaxMomentum), (float)(r.NextDouble() * 2 * World.Hook.ObstacleMaxMomentum - World.Hook.ObstacleMaxMomentum) ); }
public override void Init(World world) { World = world; var r = new Random(); Position = World.RandomPosition(); Momentum = new Vector2( (float)(r.NextDouble() * 2 * World.Hook.ObstacleMaxMomentum - World.Hook.ObstacleMaxMomentum), (float)(r.NextDouble() * 2 * World.Hook.ObstacleMaxMomentum - World.Hook.ObstacleMaxMomentum) ); Size = r.Next(300, World.Hook.ObstacleMaxSize); Sprite = Sprites.obstacle; Color = "rgba(128,128,128,.2)"; base.Init(world); }
public Obstacle(World world) : base(world) { var r = new Random(); Position = World.RandomPosition(); LinearVelocity = new Vector2(0, 0); Sprite = Sprites.sportsball; Color = "rgba(128,128,128,.2)"; this.Mass = size; this.Group = new Group(world) { GroupType = GroupTypes.Obstacle, ZIndex = 95 }; this.Size = r.Next(World.Hook.ObstacleMinSize, World.Hook.ObstacleMaxSize); }