Skip to content

Commit

Permalink
Gamejam - Gameplay, SFX, VFX done. Added Vox source models.
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceJZ committed Dec 4, 2017
1 parent 057663d commit 65eff11
Show file tree
Hide file tree
Showing 28 changed files with 262 additions and 70 deletions.
56 changes: 18 additions & 38 deletions Shadow and Planet/Content/Content.mgcb
Original file line number Diff line number Diff line change
Expand Up @@ -811,25 +811,6 @@
/processorParam:TextureFormat=Compressed
/build:Models/SandP-Pirate.obj

#begin Models/cube - pirate.3DS
/importer:OpenAssetImporter
/processor:ModelProcessor
/processorParam:ColorKeyColor=0,0,0,0
/processorParam:ColorKeyEnabled=True
/processorParam:DefaultEffect=BasicEffect
/processorParam:GenerateMipmaps=True
/processorParam:GenerateTangentFrames=False
/processorParam:PremultiplyTextureAlpha=True
/processorParam:PremultiplyVertexColors=True
/processorParam:ResizeTexturesToPowerOfTwo=False
/processorParam:RotationX=0
/processorParam:RotationY=0
/processorParam:RotationZ=0
/processorParam:Scale=1
/processorParam:SwapWindingOrder=False
/processorParam:TextureFormat=Compressed
/build:Models/cube - pirate.3DS

#begin Models/SandP-Missile.obj
/importer:OpenAssetImporter
/processor:ModelProcessor
Expand Down Expand Up @@ -925,25 +906,6 @@
/processorParam:TextureFormat=Compressed
/build:Models/SandP-Base.obj

#begin Models/cube - green.3DS
/importer:OpenAssetImporter
/processor:ModelProcessor
/processorParam:ColorKeyColor=0,0,0,0
/processorParam:ColorKeyEnabled=True
/processorParam:DefaultEffect=BasicEffect
/processorParam:GenerateMipmaps=True
/processorParam:GenerateTangentFrames=False
/processorParam:PremultiplyTextureAlpha=True
/processorParam:PremultiplyVertexColors=True
/processorParam:ResizeTexturesToPowerOfTwo=False
/processorParam:RotationX=0
/processorParam:RotationY=0
/processorParam:RotationZ=0
/processorParam:Scale=1
/processorParam:SwapWindingOrder=False
/processorParam:TextureFormat=Compressed
/build:Models/cube - green.3DS

#begin Sounds/Thrust.wav
/importer:WavImporter
/processor:SoundEffectProcessor
Expand Down Expand Up @@ -1022,3 +984,21 @@
/processorParam:Quality=Best
/build:Sounds/PirateBump.wav

#begin Sounds/PlayerShotHit.wav
/importer:WavImporter
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Sounds/PlayerShotHit.wav

#begin Sounds/MissileHit.wav
/importer:WavImporter
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Sounds/MissileHit.wav

#begin Sounds/ShotHit.wav
/importer:WavImporter
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:Sounds/ShotHit.wav

Binary file removed Shadow and Planet/Content/Models/cube - green.3DS
Binary file not shown.
Binary file removed Shadow and Planet/Content/Models/cube - pirate.3DS
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/MissileHit.wav
Binary file not shown.
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/ShotHit.wav
Binary file not shown.
2 changes: 1 addition & 1 deletion Shadow and Planet/Engine/AModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AModel : PositionedObject, IDrawComponent, ILoadContent
{
public XnaModel XNAModel { get; private set; }
public bool Visable { get => m_Visable; set => m_Visable = value; }
public Vector3 DefuseColor = Vector3.Zero;
public Vector3 DefuseColor = new Vector3(1,1,1);
Texture2D XNATexture;
private Matrix[] ModelTransforms;
private Matrix BaseWorld;
Expand Down
9 changes: 4 additions & 5 deletions Shadow and Planet/Engine/Words.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Words : GameComponent, IUpdateableComponent, ILoadContent, IBeginable
{
XnaModel[] WordModels = new XnaModel[27];
List<Mod> WordEs = new List<Mod>();
string WordString;
float Scale;
int TextSize;
public Vector3 Position = Vector3.Zero;

public Words (Game game) : base(game)
Expand Down Expand Up @@ -52,18 +52,17 @@ public void BeginRun()
public void ProcessWords(string words, Vector3 locationStart, float scale)
{
Position = locationStart;
WordString = words;
Scale = scale;

UpdateWords(words);
}

public void UpdateWords(string words)
{
int textSize = WordString.Length;
TextSize = words.Length;
DeleteWords();

foreach (char letter in WordString)
foreach (char letter in words)
{
if ((int)letter > 64 && (int)letter < 91 || (int)letter == 95)
{
Expand All @@ -90,7 +89,7 @@ public void UpdatePosition()
foreach (Mod letter in WordEs)
{
letter.Position = Position - new Vector3(space, 0, 0);
space -= Scale * 11;
space -= Scale * 11.5f;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Shadow and Planet/Entities/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public override void LoadContent()

public override void BeginRun()
{
OreText.ProcessWords("BASE ORE", Vector3.Zero, 2);
OreText.ProcessWords("BASE_ORE", Vector3.Zero, 2);
OreText.Position.Z = 150;
OreAmount.ProcessNumber(OreOnBase, Vector3.Zero, 2);
OreAmount.Position.Z = 150;
Expand Down
92 changes: 92 additions & 0 deletions Shadow and Planet/Entities/Explode.cs
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);
}
}
}
}
59 changes: 59 additions & 0 deletions Shadow and Planet/Entities/ExplodeParticle.cs
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));
}
}
}
8 changes: 8 additions & 0 deletions Shadow and Planet/Entities/Missile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ public class Missile : Mod
{
PositionedObject TargetRef;
Timer LifeTimer;
SoundEffect HitSound;
Explode Explosion;

public Missile(Game game) : base(game)
{
LifeTimer = new Timer(game);
Explosion = new Explode(game);

LoadContent();
}

Expand All @@ -31,6 +35,8 @@ public override void Initialize()
public override void LoadContent()
{
LoadModel("SandP-Missile");
HitSound = LoadSoundEffect("MissileHit");

BeginRun();
}

Expand Down Expand Up @@ -71,6 +77,8 @@ void CheckCollusions()
{
if (CirclesIntersect(TargetRef))
{
HitSound.Play();
Explosion.Spawn(Position, Radius * 0.25f);
TargetRef.Hit = true;
Active = false;
}
Expand Down
6 changes: 5 additions & 1 deletion Shadow and Planet/Entities/Pirate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Pirate : Mod
SoundEffect ExplodSound;
SoundEffect HitSound;
SoundEffect BumpSound;
SoundEffect MissileSound;

Vector3 NewHeading = Vector3.Zero;

Expand Down Expand Up @@ -57,10 +58,11 @@ public override void Initialize()
public override void LoadContent()
{
LoadModel("SandP-Pirate");
HealthModel = Load("cube - green");
HealthModel = Load("cube");
ExplodSound = LoadSoundEffect("PirateExplode");
HitSound = LoadSoundEffect("PirateHit");
BumpSound = LoadSoundEffect("PirateBump");
MissileSound = LoadSoundEffect("PirateMissile");

BeginRun();
}
Expand Down Expand Up @@ -88,6 +90,7 @@ public override void Update(GameTime gameTime)
RotationVelocity.X = 0;
RotationVelocity.Y = 0;
BumpTimer.Enabled = false;
FireTimer.Reset();
}

if (ChaseTimer.Expired)
Expand Down Expand Up @@ -215,6 +218,7 @@ void CheckForPlayer()

void FireMissile()
{
MissileSound.Play();
bool spawnNew = true;
int freeOne = Missiles.Count;

Expand Down
Loading

0 comments on commit 65eff11

Please sign in to comment.