Ejemplo n.º 1
0
        private void ShootBolt(FInt rotation, int midX, int midY)
        {
            FInt r    = FPRadians.Normalize(rotation);
            FInt velX = FInt.Create(Radians.GetXFromRotation((float)r.ToDouble(), (float)this.attSpeed.ToDouble()));
            FInt velY = FInt.Create(Radians.GetYFromRotation((float)r.ToDouble(), (float)this.attSpeed.ToDouble()));

            ProjectileEnemy projectile = ProjectileEnemy.Create(room, (byte)ProjectileEnemySubType.BoltBlue, FVector.Create(midX - 10, midY + 4), FVector.Create(velX, velY));

            projectile.physics.SetGravity(FInt.Create(0));
            projectile.rotation = (float)r.ToDouble();
        }
Ejemplo n.º 2
0
        public override void RunTick()
        {
            base.RunTick();

            // Check if an attack needs to be made:
            if (this.attack.AttackThisFrame())
            {
                ProjectileEnemy projectile = ProjectileEnemy.Create(room, (byte)ProjectileEnemySubType.Electric, FVector.Create(this.posX + this.bounds.MidX - 10, this.posY + this.bounds.MidY + 4), FVector.Create(this.FaceRight ? this.attSpeed : -this.attSpeed, -5));
                projectile.physics.SetGravity(this.gravity);
                this.room.PlaySound(Systems.sounds.flame, 0.6f, this.posX + 16, this.posY + 16);
            }
        }
Ejemplo n.º 3
0
        public void FireAttack(RoomScene room, short gridX, short gridY, short attX, short attY, float gravity)
        {
            ProjectileEnemy projectile = ProjectileEnemy.Create(room, (byte)ProjectileEnemySubType.Fire, FVector.Create(gridX * (byte)TilemapEnum.TileWidth + (byte)TilemapEnum.HalfWidth - 10, gridY * (byte)TilemapEnum.TileHeight + (byte)TilemapEnum.HalfHeight - 10), FVector.Create(attX, attY));

            projectile.physics.SetGravity(FInt.Create(gravity * 0.35));
        }