Ejemplo n.º 1
0
        public void Randomize()
        {
            var r = new Random();

            Position     = World.RandomPosition();
            Angle        = (float)r.NextDouble() * MathF.PI * 2;
            ThrustAmount = World.Hook.FishThrust;
        }
Ejemplo n.º 2
0
            public override void Init(World world)
            {
                base.Init(world);

                FlagGroup.Init(world);
                FlagGroup.ZIndex = 10;
                this.Group       = FlagGroup;
                Position         = world.RandomPosition();
            }
Ejemplo n.º 3
0
        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)
                );
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }