-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gamejam - Gameplay, SFX, VFX done. Added Vox source models.
- Loading branch information
Showing
28 changed files
with
262 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | ||
using Microsoft.Xna.Framework.Input; | ||
using Microsoft.Xna.Framework.Audio; | ||
using XnaModel = Microsoft.Xna.Framework.Graphics.Model; | ||
using System.Collections.Generic; | ||
using System; | ||
using Engine; | ||
|
||
namespace Shadow_and_Planet.Entities | ||
{ | ||
using Mod = Engine.AModel; | ||
|
||
public class Explode : GameComponent, IBeginable, IUpdateableComponent, ILoadContent | ||
{ | ||
List<ExplodeParticle> Particles; | ||
bool _Active; | ||
|
||
public bool Active { get => _Active; set => _Active = value; } | ||
|
||
public Explode(Game game) : base(game) | ||
{ | ||
Particles = new List<ExplodeParticle>(); | ||
|
||
game.Components.Add(this); | ||
LoadContent(); | ||
BeginRun(); | ||
} | ||
|
||
public override void Initialize() | ||
{ | ||
|
||
base.Initialize(); | ||
} | ||
|
||
public void LoadContent() | ||
{ | ||
|
||
} | ||
|
||
public void BeginRun() | ||
{ | ||
|
||
} | ||
|
||
public override void Update(GameTime gameTime) | ||
{ | ||
if (_Active) | ||
{ | ||
bool done = true; | ||
|
||
foreach(ExplodeParticle particle in Particles) | ||
{ | ||
if (particle.Active) | ||
{ | ||
done = false; | ||
break; | ||
} | ||
} | ||
|
||
if (done) | ||
_Active = false; | ||
|
||
base.Update(gameTime); | ||
} | ||
} | ||
|
||
public void Spawn(Vector3 position, float radius) | ||
{ | ||
_Active = true; | ||
int count = (int)Services.RandomMinMax(10, 10 + radius * 2); | ||
|
||
if (count > Particles.Count) | ||
{ | ||
int more = count - Particles.Count; | ||
|
||
for (int i = 0; i < more; i++) | ||
{ | ||
Particles.Add(new ExplodeParticle(Game)); | ||
} | ||
} | ||
|
||
foreach (ExplodeParticle particle in Particles) | ||
{ | ||
position += new Vector3(Services.RandomMinMax(-radius, radius), | ||
Services.RandomMinMax(-radius, radius), 0); | ||
|
||
particle.Spawn(position); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Graphics; | ||
using Microsoft.Xna.Framework.Input; | ||
using Microsoft.Xna.Framework.Audio; | ||
using XnaModel = Microsoft.Xna.Framework.Graphics.Model; | ||
using System.Collections.Generic; | ||
using System; | ||
using Engine; | ||
|
||
namespace Shadow_and_Planet.Entities | ||
{ | ||
using Mod = AModel; | ||
|
||
public class ExplodeParticle : Mod | ||
{ | ||
Timer LifeTimer; | ||
|
||
public ExplodeParticle(Game game) : base(game) | ||
{ | ||
LifeTimer = new Timer(game); | ||
|
||
LoadContent(); | ||
BeginRun(); | ||
} | ||
|
||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
} | ||
|
||
public override void LoadContent() | ||
{ | ||
LoadModel("Cube"); | ||
} | ||
|
||
public override void BeginRun() | ||
{ | ||
|
||
base.BeginRun(); | ||
} | ||
|
||
public override void Update(GameTime gameTime) | ||
{ | ||
if (LifeTimer.Expired) | ||
Active = false; | ||
|
||
base.Update(gameTime); | ||
} | ||
|
||
public void Spawn(Vector3 position) | ||
{ | ||
Velocity = SetRandomVelocity(50); | ||
Position = position; | ||
Active = true; | ||
Scale = Services.RandomMinMax(1, 2); | ||
LifeTimer.Reset(Services.RandomMinMax(0.1f, 1)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.