Example #1
0
        public override void RunTick()
        {
            base.RunTick();

            // Check if an attack needs to be made:
            if (this.attack.AttackThisFrame())
            {
                ProjectileEarth projectile = ProjectileEarth.Create(room, (byte)ProjectileEarthSubType.Earth, FVector.Create(this.posX + this.bounds.MidX - 10, this.posY + this.bounds.Bottom - 10), FVector.Create(0, this.attSpeed));
                this.room.PlaySound(Systems.sounds.rock, 0.4f, this.posX + 16, this.posY + 16);
            }
        }
Example #2
0
        public static ProjectileEarth Create(RoomScene room, byte subType, FVector pos, FVector velocity)
        {
            // Retrieve an available projectile from the pool.
            ProjectileEarth projectile = ProjectilePool.ProjectileEarth.GetObject();

            projectile.ResetProjectile(room, subType, pos, velocity);
            projectile.AssignBoundsByAtlas(2, 2, -2, -2);
            projectile.spinRate = CalcRandom.FloatBetween(-0.07f, 0.07f);

            // Add the Projectile to Scene
            room.AddToScene(projectile, false);

            return(projectile);
        }