Beispiel #1
0
 public void OnStart(QGetContent get)
 {
     Sprite         = new QSprite(this, get.TextureSource("BryanStuff1").Split(32, 32)[7]);
     Sprite.Offset += new QVec(2, 0);
     Sprite.Scale   = QVec.One * 2;
     Body           = Physics.CreateCircle(this, PotionRadius, 5);
 }
Beispiel #2
0
 public override void OnStart(QGetContent get)
 {
     sprite       = new QSprite(this, get.TextureSource(Name));
     sprite.Color = QRandom.Color();
     body         = Physics.CreateRectangle(this, Width, Height);
     body.ApplyForce(DirectionOfMovement);
     body.IsBullet = true;
 }
Beispiel #3
0
 public override void OnStart(QGetContent get)
 {
     Sprite       = new QSprite(this, get.TextureSource(Name));
     Sprite.Color = QRandom.Color();
     body         = Physics.CreateCircle(this, Radius);
     body.ApplyForce(DirectionOfMovement);
     body.IsBullet = true;
 }
Beispiel #4
0
        public void OnStart(QGetContent get)
        {
            var floorTiles = get.TextureSource("cavern_biome").Split(16, 16);

            sprite        = new QSprite(this, floorTiles[1]);
            sprite.Scale  = QVec.One * 4.01f;
            body          = Physics.CreateRectangle(this, sprite.Width, sprite.Height, 1, QBodyType.Static);
            body.Friction = 0.2f;
            body.IsCCD    = false;
        }
        public override void OnStart(QGetContent get)
        {
            int R() => QRandom.Number(1, 255);

            sprite        = new QSprite(this, Name);
            sprite.Color  = new QColor(R(), R(), R());
            body          = Physics.CreateRectangle(this, sprite.Width, sprite.Height, 1, QBodyType.Static);
            body.Friction = 0.2f;
            body.IsCCD    = false;
        }
        public void OnStart(QGetContent get)
        {
            Sprite       = new QSprite(this, get.TextureSource(Name));
            Sprite.Color = QColor.Black;

            Body                  = Physics.CreateCircle(this, Radius, 1, QBodyType.Static);
            Body.IsSensor         = true;
            Body.OnCollisionStay += OnCollisionStay;

            p = GetBehavior <Player>();
        }
        public void OnStart(QGetContent get)
        {
            var floorTiles = get.TextureSource("cavern_biome").Split(16, 16);

            sprite = new QSprite(this, floorTiles[0]);
            //Randomly decide to put mushroom on floor tile
            if (QRandom.Number(1, 10) > 6)
            {
                mushroomSprite       = new QSprite(this, floorTiles[QRandom.Number(2, 4)]);
                mushroomSprite.Scale = QVec.One * 4f;
            }
            sprite.Scale     = QVec.One * 4f;
            body             = Physics.CreateRectangle(this, sprite.Width, sprite.Height, 1, QBodyType.Static);
            body.Friction    = 0.1f;
            body.IsCCD       = true;
            body.Restitution = 0f;
        }
 void OnCollisionStay(QRigidBody other)
 {
     if (other.Script is BiomeBat bat)
     {
         if (bat.CanTakeDamage && p.CombatState == PlayerCombatStates.Attacking)
         {
             bat.CanTakeDamage = false;
             bat.Health--;
             if (p.Position.X > bat.Position.X)
             {
                 bat.Flick(new QVec(-2000, -150));
             }
             else
             {
                 bat.Flick(new QVec(2000, -150));
             }
         }
     }
 }
        public override void OnStart(QGetContent get)
        {
            spawnerPosition = Transform.Position;

            Health = MaxHealth;

            Frames = Scene.Atlas["BryanStuff1"].Split(32, 32);

            player = GetBehavior <Player>("Player");

            Sprite        = new QSprite(this, Frames[28]);
            Sprite.Scale  = new QVec(4);
            Sprite.Effect = QRenderEffects.FlipVertically;
            Sprite.Source = Frames[30];

            BatFlap = new QAnimation(Frames, 0.1f, 28, 30);

            body = Physics.CreateRectangle(this, Sprite.Width / 3f, Sprite.Height / 3f, 5);
            body.IgnoreGravity = true;
            body.FixedRotation = true;
            body.LinearDamping = 10f;
        }