mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 08:25:54 +00:00
Bullet resource
This commit is contained in:
parent
76221ca7a6
commit
07f6e58ebd
19 changed files with 236 additions and 50 deletions
|
|
@ -99,7 +99,7 @@ public partial class Weapon : Node2D
|
|||
// Rotate the ShootDirection by the spread angle
|
||||
Vector2 spreadDirection = ShootDirection.Rotated(Mathf.DegToRad(spreadOffset));
|
||||
|
||||
var bullet = this.CreateChildOf<Bullet>(_gameManager.BulletsContainer, WeaponData.BulletScene, _muzzle.GlobalPosition);
|
||||
var bullet = this.CreateChildOf<Bullet>(_gameManager.BulletsContainer, WeaponData.BulletData.BulletScene, _muzzle.GlobalPosition);
|
||||
|
||||
if (bullet == null)
|
||||
{
|
||||
|
|
@ -111,7 +111,7 @@ public partial class Weapon : Node2D
|
|||
|
||||
//bullet.SetDirection(ShootDirection);
|
||||
bullet.SetDirection(spreadDirection);
|
||||
bullet.Speed = WeaponData.BulletSpeed;
|
||||
bullet.Speed = WeaponData.BulletData.BulletSpeed;
|
||||
}
|
||||
|
||||
LoadedAmmo -= 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue