Skip to content

Commit

Permalink
Added Audio
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceJZ committed Dec 4, 2017
1 parent ae2ac6d commit 057663d
Show file tree
Hide file tree
Showing 36 changed files with 1,051 additions and 144 deletions.
154 changes: 154 additions & 0 deletions Shadow and Planet/Content/Content.mgcb
Original file line number Diff line number Diff line change
Expand Up @@ -868,3 +868,157 @@
/processorParam:TextureFormat=Compressed
/build:Models/SandP-PlayerFlame.obj

#begin Models/LavaLamp.obj
/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/LavaLamp.obj

#begin Models/SandP-Chest.obj
/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/SandP-Chest.obj

#begin Models/SandP-Base.obj
/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/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
/processorParam:Quality=Best
/build:Sounds/Thrust.wav

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

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

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

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

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

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

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

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

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

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

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

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

8 changes: 8 additions & 0 deletions Shadow and Planet/Content/Models/LavaLamp.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# MagicaVoxel @ Ephtracy

newmtl palette
illum 1
Ka 0.000 0.000 0.000
Kd 1.000 1.000 1.000
Ks 0.000 0.000 0.000
map_Kd LavaLamp.png
Binary file added Shadow and Planet/Content/Models/LavaLamp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Shadow and Planet/Content/Models/SandP-Base.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# MagicaVoxel @ Ephtracy

newmtl palette
illum 1
Ka 0.000 0.000 0.000
Kd 1.000 1.000 1.000
Ks 0.000 0.000 0.000
map_Kd SandP-Base.png
Binary file added Shadow and Planet/Content/Models/SandP-Base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Shadow and Planet/Content/Models/SandP-Chest.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# MagicaVoxel @ Ephtracy

newmtl palette
illum 1
Ka 0.000 0.000 0.000
Kd 1.000 1.000 1.000
Ks 0.000 0.000 0.000
map_Kd SandP-Chest.png
Binary file added Shadow and Planet/Content/Models/SandP-Chest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Shadow and Planet/Content/Models/cube - green.3DS
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/ChestPickup.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/Dock.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/LavaLampDrop.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/PickupChunk.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/PirateBump.wav
Binary file not shown.
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/PirateHit.wav
Binary file not shown.
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/PlayerDead.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/PlayerHit.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/PlayerShot.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/Thrust.wav
Binary file not shown.
Binary file added Shadow and Planet/Content/Sounds/UnDock.wav
Binary file not shown.
2 changes: 1 addition & 1 deletion Shadow and Planet/Engine/PositionedObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public override void Update(GameTime gameTime)
/// <param name="Parent">The parent to this class.</param>
/// <param name="activeDependent">Bind Active to child.</param>
/// <param name="directConnection">Bind Position and Rotation to child.</param>
public virtual void AddAsChild(PositionedObject Parent, bool activeDependent, bool directConnection)
public virtual void AddAsChildOf(PositionedObject Parent, bool activeDependent, bool directConnection)
{
ActiveDependent = activeDependent;
DirectConnection = directConnection;
Expand Down
24 changes: 12 additions & 12 deletions Shadow and Planet/Entities/Asteroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ public Asteroid(Game game, Player player, PirateControl pirate) : base(game)
{
PlayerRef = player;
PiratesRef = pirate;
LoadContent();
}

public override void Initialize()
{
Scale = 2;
Radius = 100;
ResetHitpoints();

base.Initialize();

LoadContent();
}

public override void LoadContent()
Expand All @@ -44,6 +42,7 @@ public override void LoadContent()
public override void BeginRun()
{
Velocity = SetRandomVelocity(25);
ResetHitpoints();

base.BeginRun();
}
Expand All @@ -58,17 +57,17 @@ public override void Update(GameTime gameTime)

void CheckEdge()
{
if (Position.X > 3000)
Position.X = -3000;
if (Position.X > 6000)
Position.X = -6000;

if (Position.X < -3000)
Position.X = 3000;
if (Position.X < -6000)
Position.X = 6000;

if (Position.Y > 2000)
Position.Y = -2000;
if (Position.Y > 4000)
Position.Y = -4000;

if (Position.Y < -2000)
Position.Y = 2000;
if (Position.Y < -4000)
Position.Y = 4000;
}

void CheckCollusion()
Expand Down Expand Up @@ -111,7 +110,8 @@ public void Bumped(Vector3 position, Vector3 velocity)

void ResetHitpoints()
{
HitPoints = (int)Services.RandomMinMax(10, 20);
int patato = PlayerRef.OreinHold;
HitPoints = (int)Services.RandomMinMax(20 + patato, 40 + patato);
}
}
}
72 changes: 56 additions & 16 deletions Shadow and Planet/Entities/AsteroidControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,23 @@ public override void Initialize()

public void BeginRun()
{
for (int i = 0; i < 10; i++)
for (int i = 0; i < 6; i++)
{
Asteroids.Add(new Asteroid(Game, PlayerRef, PiratesRef));
ActivateRockRadar();

if (Services.RandomMinMax(0, 10) > 5)
{
Asteroids.Last().Position = new Vector3(Services.RandomMinMax(-3000, -300),
Services.RandomMinMax(-2000, -200), 0);
Asteroids.Last().Position = new Vector3(Services.RandomMinMax(-4000, -2000),
Services.RandomMinMax(-4000, -2000), 0);

Asteroids.Last().RotationVelocity = new Vector3(Services.RandomMinMax(-1, 1),
0, Services.RandomMinMax(-0.5f, 0.5f));
}
else
{
Asteroids.Last().Position = new Vector3(Services.RandomMinMax(300, 3000),
Services.RandomMinMax(200, 2000), 0);
Asteroids.Last().Position = new Vector3(Services.RandomMinMax(2000, 4000),
Services.RandomMinMax(2000, 4000), 0);

Asteroids.Last().RotationVelocity = new Vector3(Services.RandomMinMax(-1, 1),
0, Services.RandomMinMax(-0.5f, 0.5f));
Expand All @@ -86,16 +86,60 @@ public override void Update(GameTime gameTime)
EjectChunk(rock);
}

Vector3 offset = PlayerRef.
SetVelocity(PlayerRef.AngleFromVectors(PlayerRef.Position, rock.Position), 80);
offset.Z = 250;
RockRadar[i].Position = PlayerRef.Position + offset;
i++;
foreach(Pirate pirate in PiratesRef.Pirates)
{
pirate.CheckMissileHit(rock);

foreach (Chunk chunk in Chunks)
{
if (chunk.Active)
{
if (rock.CirclesIntersect(chunk))
{
chunk.Bumped(rock.Position, rock.Velocity);
}

if (pirate.Active)
{
if (pirate.CirclesIntersect(chunk))
{
pirate.Bumped(chunk.Position, chunk.Velocity);
chunk.Bumped(pirate.Position, pirate.Velocity);
}
}
}

}
}

if (PlayerRef.Active)
{
Vector3 offset = PlayerRef.
SetVelocity(PlayerRef.AngleFromVectors(PlayerRef.Position, rock.Position), 80);
offset.Z = 250;
RockRadar[i].Position = PlayerRef.Position + offset;
i++;
}
else
{
foreach(Mod radar in RockRadar)
{
radar.Active = false;
}
}
}

base.Update(gameTime);
}

public void NewGame()
{
foreach(Mod radar in RockRadar)
{
radar.Active = true;
}
}

void ActivateRockRadar()
{
RockRadar.Add(new Mod(Game));
Expand Down Expand Up @@ -138,14 +182,10 @@ void EjectChunk(Asteroid rock)

if (spawnNewChunk)
{
Chunks.Add(new Chunk(Game));
Chunks.Last().PlayerRef = PlayerRef;
Chunks.Add(new Chunk(Game, PlayerRef));
}

Chunks[freeChunk].Active = true;
Chunks[freeChunk].Position = rock.Position;
Chunks[freeChunk].Velocity = Chunks[0].SetRandomVelocity(150);
Chunks[freeChunk].RotationVelocity = new Vector3(Services.RandomMinMax(-1, 1), Services.RandomMinMax(-1, 1), 0);
Chunks[freeChunk].Spawn(rock.Position);
}
}
}
4 changes: 2 additions & 2 deletions Shadow and Planet/Entities/Background.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Shadow_and_Planet.Entities

public class Background : GameComponent, IBeginable, IUpdateableComponent, ILoadContent
{
Engine.AModel[] Stars = new Engine.AModel[300];
Engine.AModel[] Stars = new Engine.AModel[400];
Engine.AModel[] StarsBack = new Engine.AModel[40];

Vector3[] StarsOrg;
Expand Down Expand Up @@ -42,7 +42,7 @@ public override void Initialize()

for (int i = 0; i < Stars.Length; i++)
{
Stars[i].Position = new Vector3(Services.RandomMinMax(-3000, 3000), Services.RandomMinMax(-2000, 2000), -200);
Stars[i].Position = new Vector3(Services.RandomMinMax(-6000, 6000), Services.RandomMinMax(-4000, 4000), -200);
Stars[i].RotationVelocity = new Vector3(Services.RandomMinMax(-spinSpeed, spinSpeed),
Services.RandomMinMax(-spinSpeed, spinSpeed), Services.RandomMinMax(-spinSpeed, spinSpeed));
}
Expand Down
Loading

0 comments on commit 057663d

Please sign in to comment.