mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 08:35:54 +00:00
Capacitors and parallax
This commit is contained in:
parent
c5ed30f458
commit
3670da9719
29 changed files with 705 additions and 57 deletions
|
|
@ -16,7 +16,7 @@ public partial class BulletEmitter : Node2D, IActivable
|
|||
|
||||
[Export] public float Spread { get; set; } = 0f;
|
||||
|
||||
[Export] public float Rotation { get; set; } = 0f;
|
||||
[Export] public float EmissionRotation { get; set; } = 0f;
|
||||
|
||||
private BulletSpawner _bulletSpawner;
|
||||
|
||||
|
|
@ -32,12 +32,12 @@ public partial class BulletEmitter : Node2D, IActivable
|
|||
case ActivationType.Toggle:
|
||||
break;
|
||||
case ActivationType.Enable:
|
||||
_bulletSpawner.SpawnBullet(BulletResource.MakeBullet(this.GlobalPosition, 1, Spread, Rotation));
|
||||
_bulletSpawner.SpawnBullet(BulletResource.MakeBullet(this.GlobalPosition, 1, Spread, EmissionRotation));
|
||||
break;
|
||||
case ActivationType.Disable:
|
||||
break;
|
||||
case ActivationType.Use:
|
||||
_bulletSpawner.SpawnBullet(BulletResource.MakeBullet(this.GlobalPosition, 1, Spread, Rotation));
|
||||
_bulletSpawner.SpawnBullet(BulletResource.MakeBullet(this.GlobalPosition, 1, Spread, EmissionRotation));
|
||||
break;
|
||||
case ActivationType.Destroy:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -31,19 +31,26 @@ public partial class Door : Activable
|
|||
{
|
||||
_animatedSprite.Play("Opening");
|
||||
State = DoorState.Open;
|
||||
_collisionShape.Disabled = true;
|
||||
_solidShape.Disabled = true;
|
||||
CallDeferred(MethodName.DeferredDisableCollision, true);
|
||||
//_collisionShape.Disabled = true;
|
||||
//_solidShape.Disabled = true;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
_animatedSprite.Play("Closing");
|
||||
State = DoorState.Closed;
|
||||
_collisionShape.Disabled = false;
|
||||
_solidShape.Disabled = false;
|
||||
|
||||
CallDeferred(MethodName.DeferredDisableCollision, false);
|
||||
//_collisionShape.Disabled = false;
|
||||
//_solidShape.Disabled = false;
|
||||
}
|
||||
|
||||
private void DeferredDisableCollision(bool state)
|
||||
{
|
||||
_collisionShape.Disabled = state;
|
||||
_solidShape.Disabled = state;
|
||||
}
|
||||
|
||||
public override void Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
{
|
||||
switch (activationType)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue