mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 07:05:54 +00:00
Bullet data overhaul
This commit is contained in:
parent
3682de18d5
commit
76221ca7a6
9 changed files with 57 additions and 26 deletions
|
|
@ -13,7 +13,7 @@ public partial class BulletSpawner : Node2D
|
|||
|
||||
public override void _Ready()
|
||||
{
|
||||
_gameManager = GetNode<GameManager>("/root/GameScene");
|
||||
_gameManager = this.GetGameManager();
|
||||
}
|
||||
|
||||
public void SpawnBullet(BulletInfo bulletInfo)
|
||||
|
|
@ -52,7 +52,6 @@ public partial class BulletSpawner : Node2D
|
|||
|
||||
//var bullet = BulletScene.Instantiate<Bullet>();
|
||||
bullet.Position = position;
|
||||
bullet.Owner = owner;
|
||||
//bullet.Speed = speed;
|
||||
|
||||
float modifiedSpeed = modifier?.ModifySpeed(speed, i, count) ?? speed;
|
||||
|
|
@ -75,13 +74,6 @@ public partial class BulletSpawner : Node2D
|
|||
Vector2 direction = (target - position).Normalized();
|
||||
SpawnBullet(position, direction, speed, owner, burstCount, spread: spread, bulletScene: bulletScene, modifier: modifier);
|
||||
}
|
||||
|
||||
[Obsolete]
|
||||
public void SpawnSpiralPattern(Vector2 position, float speed, BulletOwner owner, int bulletCount, float rotationSpeed, double time, float spread, PackedScene bulletScene = null)
|
||||
{
|
||||
float angleOffset = (float)(rotationSpeed * time);
|
||||
SpawnBullet(position, Vector2.Right, speed, owner, bulletCount, angleOffset, spread, bulletScene: bulletScene);
|
||||
}
|
||||
}
|
||||
|
||||
public class BulletInfo
|
||||
|
|
@ -91,6 +83,8 @@ public class BulletInfo
|
|||
public float Speed { get; set; }
|
||||
public float LifeTime { get; set; }
|
||||
public BulletOwner Owner { get; set; }
|
||||
public DamageType DamageType { get; set; }
|
||||
public float Damage { get; set; }
|
||||
public int BulletCount { get; set; }
|
||||
public float RotationSpeed { get; set; }
|
||||
public float RotationOffset { get; set; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue