Skip to content

Commit

Permalink
bugfix; the spartan kick wasn't always triggered, which is important …
Browse files Browse the repository at this point in the history
…for progress
  • Loading branch information
Lajbert committed Apr 26, 2021
1 parent 3a1812c commit d570f85
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
8 changes: 6 additions & 2 deletions lurum_dare_48/Source/Entities/Enemies/EnemyTest.cs
Expand Up @@ -59,11 +59,15 @@ public EnemyTest(AbstractScene scene, Vector2 position, Direction direction) : b

CollisionOffsetBottom = 1;

AddComponent(new BoxCollisionComponent(this, 18, 30, new Vector2(-8, -30)));
//AddComponent(new BoxCollisionComponent(this, 18, 30, new Vector2(-8, -30)));

if (!Tutorial)
{
//AddComponent(new BoxTrigger)
AddComponent(new BoxCollisionComponent(this, 18, 30, new Vector2(-8, -30)));
}
else
{
AddComponent(new BoxCollisionComponent(this, 22, 30, new Vector2(-8, -30)));
}

//DEBUG_SHOW_COLLIDER = true;
Expand Down
43 changes: 19 additions & 24 deletions lurum_dare_48/Source/Entities/Hero.cs
Expand Up @@ -225,6 +225,25 @@ public Hero(AbstractScene scene, Vector2 position) : base(scene.LayerManager.Ent
{
AudioEngine.Play("Kick");
IsKicking = true;
if (THIS_IS_SPARTAAAAA && collidingWith.Count > 0)
{
THIS_IS_SPARTAAAAA = false;
Vector2 canSpawnPos = collidingWith[0].Transform.Position;
FuelCan can = new FuelCan(scene, canSpawnPos + new Vector2(0, -20), TankCapacity);
can.Velocity += new Vector2(-3, -1);
can.CollisionsEnabled = false;
Ammo ammo = new Ammo(scene, canSpawnPos + new Vector2(0, -20), 20, typeof(Handgun));
ammo.Velocity += new Vector2(-4f, -1.5f);
ammo.CollisionsEnabled = false;
Timer.TriggerAfter(2000, () =>
{
can.CollisionsEnabled = true;
ammo.CollisionsEnabled = true;
new TextPopup(Scene, Assets.GetTexture("FuelAmmoText"), Transform.Position + new Vector2(-20, -80), 0.3f, 3000);
});
}
});
kickLeft.AddFrameAction(6, (frame) =>
{
Expand All @@ -234,32 +253,8 @@ public Hero(AbstractScene scene, Vector2 position) : base(scene.LayerManager.Ent
{
if (THIS_IS_SPARTAAAAA && collidingWith.Count > 0)
{
THIS_IS_SPARTAAAAA = false;
THIS_IS_SPARTA();
Globals.FixedUpdateMultiplier = 0.1f;
Vector2 canSpawnPos = collidingWith[0].Transform.Position;
Timer.TriggerAfter(1500, () =>
{
FuelCan can = new FuelCan(scene, canSpawnPos + new Vector2(0, -20), TankCapacity);
can.Velocity += new Vector2(-3, -1);
can.CollisionsEnabled = false;
Ammo ammo = new Ammo(scene, canSpawnPos + new Vector2(0, -20), 20, typeof(Handgun));
ammo.Velocity += new Vector2(-4f, -1.5f);
ammo.CollisionsEnabled = false;
Timer.TriggerAfter(2000, () =>
{
can.CollisionsEnabled = true;
ammo.CollisionsEnabled = true;
new TextPopup(Scene, Assets.GetTexture("FuelAmmoText"), Transform.Position + new Vector2(-20, -80), 0.3f, 3000);
});
});
Timer.TriggerAfter(3000, () =>
{
Globals.FixedUpdateMultiplier = 0.5f;
Expand Down

0 comments on commit d570f85

Please sign in to comment.