Skip to content

Commit

Permalink
- Added Tombot enemy and the igloo Tombot generator.
Browse files Browse the repository at this point in the history
- Added Snow Shooter enemy.

- Added Snowball enemy.

- Finished the implementation of Jamming.

- Fixed Flammingle head hitbox.

- Changed Penguin RNG distribution to prevent (or reduce the changes of) him repeat his moves so many times in a row.

- Tweaked tiled sprite rendering by using the native capabilities of graphical API instead using a looping. This will allow to render a tiled sprite quickly even if the number of tiles is higer.
  • Loading branch information
sharivan committed Mar 22, 2023
1 parent 035bb43 commit c7a226d
Show file tree
Hide file tree
Showing 93 changed files with 1,887 additions and 353 deletions.
2 changes: 1 addition & 1 deletion XSharp/Engine/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,5 @@ public class Consts
public static readonly bool SKIP_MENU = false;
public static readonly bool SKIP_INTRO = false;
public const int INITIAL_LEVEL = 8;
public const int INITIAL_CHECKPOINT = 1;
public const int INITIAL_CHECKPOINT = 0;
}
8 changes: 4 additions & 4 deletions XSharp/Engine/Entities/Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public bool IsVisible(Box box)
return VisibleBox(box).IsValid();
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down Expand Up @@ -383,9 +383,9 @@ private bool DoMoving()
}

// TODO : Smooth movement is not working right for some situations. Please fix it!
protected internal override void PostThink()
protected override void OnPostThink()
{
base.PostThink();
base.OnPostThink();

DoMoving();
}
Expand All @@ -394,7 +394,7 @@ protected override void OnStartTouch(Entity entity)
{
base.OnStartTouch(entity);

if (entity.Alive || entity.Spawning || !entity.Respawnable || !entity.RespawnOnNear)
if (entity.Alive || entity.Spawning || !entity.SpawnOnNear)
return;

if ((!entity.Dead || Engine.FrameCounter - entity.DeathFrame >= entity.MinimumIntervalToRespawn) && entity.IsInSpawnArea(VectorKind.ORIGIN))
Expand Down
2 changes: 1 addition & 1 deletion XSharp/Engine/Entities/Checkpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected override Box GetHitbox()
return hitbox;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down
8 changes: 8 additions & 0 deletions XSharp/Engine/Entities/Direction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,12 @@ public static int GetVerticalSignal(this Direction direction)
{
return direction == Direction.UP ? -1 : direction == Direction.DOWN ? 1 : 0;
}

public static Vector GetUnitaryVector(this Direction direction)
{
var huv = direction.GetHorizontalUnitaryVector();
var vuv = direction.GetVerticalUnitaryVector();
var s = huv + vuv;
return s.Versor();
}
}
6 changes: 3 additions & 3 deletions XSharp/Engine/Entities/Effects/ChargingEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ public ChargingEffect()
SetAnimationNames("ChargingLevel1", "ChargingLevel2");
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

level = 1;
}

protected override void Think()
protected override void OnThink()
{
if (!soundPlayed)
{
Expand All @@ -137,7 +137,7 @@ protected override void Think()
Origin = Charger.Hitbox.Center;
Direction = Charger.Direction;

base.Think();
base.OnThink();
}

protected override void OnDeath()
Expand Down
2 changes: 1 addition & 1 deletion XSharp/Engine/Entities/Effects/DashSmokeEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public DashSmokeEffect()
SetAnimationNames("DashSmokeEffect");
}

protected internal override void OnAnimationEnd(Animation animation)
protected override void OnAnimationEnd(Animation animation)
{
base.OnAnimationEnd(animation);
KillOnNextFrame();
Expand Down
6 changes: 3 additions & 3 deletions XSharp/Engine/Entities/Effects/DashSparkEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public DashSparkEffect()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand All @@ -71,14 +71,14 @@ protected internal override void OnCreate()
SetAnimationNames("PreDashSparkEffect", "DashSparkEffect");
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Direction = Player != null ? Player.Direction : DefaultDirection;
}

protected internal override void OnAnimationEnd(Animation animation)
protected override void OnAnimationEnd(Animation animation)
{
base.OnAnimationEnd(animation);

Expand Down
4 changes: 2 additions & 2 deletions XSharp/Engine/Entities/Effects/ExplosionEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ExplosionEffect()
SetAnimationNames("Explosion");
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand All @@ -87,7 +87,7 @@ protected internal override void OnSpawn()
}
}

protected internal override void OnAnimationEnd(Animation animation)
protected override void OnAnimationEnd(Animation animation)
{
base.OnAnimationEnd(animation);
KillOnNextFrame();
Expand Down
2 changes: 1 addition & 1 deletion XSharp/Engine/Entities/Effects/SpriteEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public override FixedSingle GetGravity()
return HasGravity ? base.GetGravity() : FixedSingle.ZERO;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down
2 changes: 1 addition & 1 deletion XSharp/Engine/Entities/Effects/WallKickEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public WallKickEffect()
SetAnimationNames("WallKickEffect");
}

protected internal override void OnAnimationEnd(Animation animation)
protected override void OnAnimationEnd(Animation animation)
{
base.OnAnimationEnd(animation);
KillOnNextFrame();
Expand Down
2 changes: 1 addition & 1 deletion XSharp/Engine/Entities/Effects/WallSlideEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public WallSlideEffect()
SetAnimationNames("WallSlideEffect");
}

protected internal override void OnAnimationEnd(Animation animation)
protected override void OnAnimationEnd(Animation animation)
{
base.OnAnimationEnd(animation);
KillOnNextFrame();
Expand Down
4 changes: 2 additions & 2 deletions XSharp/Engine/Entities/Enemies/AxeMax/AxeMax.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public AxeMax()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand All @@ -141,7 +141,7 @@ protected override Box GetHitbox()
return AxeMaxTrunkBase.HITBOX;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down
4 changes: 2 additions & 2 deletions XSharp/Engine/Entities/Enemies/AxeMax/AxeMaxLumberjack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public AxeMaxLumberjack()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand Down Expand Up @@ -126,7 +126,7 @@ protected override FixedSingle GetCollisionBoxLegsHeight()
return COLLISION_BOX_LEGS_HEIGHT;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down
8 changes: 4 additions & 4 deletions XSharp/Engine/Entities/Enemies/AxeMax/AxeMaxTrunk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public AxeMaxTrunk()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand Down Expand Up @@ -134,7 +134,7 @@ public override FixedSingle GetGravity()
return Idle ? base.GetGravity() : 0;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand All @@ -157,9 +157,9 @@ protected internal override void OnSpawn()
}
}

protected override void Think()
protected override void OnThink()
{
base.Think();
base.OnThink();

if (TrunkIndex >= 0)
{
Expand Down
8 changes: 4 additions & 4 deletions XSharp/Engine/Entities/Enemies/AxeMax/AxeMaxTrunkBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public AxeMaxTrunkBase()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand Down Expand Up @@ -96,7 +96,7 @@ internal Vector GetTrunkPositionFromIndex(int index)
return (origin.X, origin.Y - 16 * (index + 1));
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down Expand Up @@ -126,9 +126,9 @@ private void SpawnTrunk(int index)
trunk.Spawn();
}

protected override void Think()
protected override void OnThink()
{
base.Think();
base.OnThink();

if (!Regenerating)
{
Expand Down
4 changes: 2 additions & 2 deletions XSharp/Engine/Entities/Enemies/AxeMax/AxeMaxTrunkHurtbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public AxeMaxTrunkHurtbox()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand Down Expand Up @@ -63,7 +63,7 @@ protected override Box GetCollisionBox()
return COLLISION_BOX;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down
4 changes: 2 additions & 2 deletions XSharp/Engine/Entities/Enemies/BattonBoneG.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public BattonBoneG()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand All @@ -119,7 +119,7 @@ public override FixedSingle GetGravity()
return 0;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down
4 changes: 2 additions & 2 deletions XSharp/Engine/Entities/Enemies/BombBeen/BombBeen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public BombBeen()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand Down Expand Up @@ -239,7 +239,7 @@ protected override Box GetHitbox()
return HITBOX;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand Down
5 changes: 3 additions & 2 deletions XSharp/Engine/Entities/Enemies/BombBeen/BombBeenBomb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public BombBeenBomb()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand Down Expand Up @@ -103,10 +103,11 @@ protected override Box GetCollisionBox()
return BombBeen.BOMB_COLLISION_BOX;
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

KillOnOffscreen = true;
Health = BombBeen.BOMB_HEALTH;

tick = 0;
Expand Down
8 changes: 4 additions & 4 deletions XSharp/Engine/Entities/Enemies/Bosses/Boss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected Boss()
{
}

protected internal override void OnCreate()
protected override void OnCreate()
{
base.OnCreate();

Expand Down Expand Up @@ -232,7 +232,7 @@ protected override bool OnTakeDamage(Sprite attacker, ref FixedSingle damage)
return base.OnTakeDamage(attacker, ref damage);
}

protected internal override void OnSpawn()
protected override void OnSpawn()
{
base.OnSpawn();

Expand All @@ -253,9 +253,9 @@ protected override void OnDeath()
base.OnDeath();
}

protected override void Think()
protected override void OnThink()
{
base.Think();
base.OnThink();

if (HealthFilling)
{
Expand Down
4 changes: 2 additions & 2 deletions XSharp/Engine/Entities/Enemies/Bosses/BossHealthHUD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public BossHealthHUD()
Image = HUDImage.BOSS;
}

protected internal override void PostThink()
protected override void OnPostThink()
{
Capacity = Boss.MaxHealth;
Value = Boss.Health;

base.PostThink();
base.OnPostThink();
}
}
Loading

0 comments on commit c7a226d

Please sign in to comment.