Skip to content

Commit

Permalink
Added turrets in rows in front of gate. Tweaked missile class.
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceJZ committed Jan 11, 2018
1 parent b7c77ec commit 6b2d59e
Show file tree
Hide file tree
Showing 27 changed files with 699 additions and 102 deletions.
5 changes: 4 additions & 1 deletion CFNGamejam2/CFNGamejam2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<AssemblyFileVersionSettings>MMddStamp.DayOfYearStamp.MonthStamp.TimeStamp</AssemblyFileVersionSettings>
<AssemblyInfoVersionSettings>YearStamp.DateStamp.DeltaDayStamp.Increment</AssemblyInfoVersionSettings>
<PrimaryVersionType>AssemblyVersionAttribute</PrimaryVersionType>
<AssemblyVersion>1.425.8.0101</AssemblyVersion>
<AssemblyVersion>1.560.11.0101</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -81,11 +81,14 @@
<Compile Include="Entities\EnemyControl.cs" />
<Compile Include="Entities\Explode.cs" />
<Compile Include="Entities\ExplodeParticle.cs" />
<Compile Include="Entities\Gateway.cs" />
<Compile Include="Entities\Ground.cs" />
<Compile Include="Entities\Missile.cs" />
<Compile Include="Entities\MissileBattery.cs" />
<Compile Include="Entities\Player.cs" />
<Compile Include="Entities\Rock.cs" />
<Compile Include="Entities\TankShot.cs" />
<Compile Include="Entities\Wall.cs" />
<Compile Include="Game1.cs" />
<Compile Include="GameLogic.cs" />
<Compile Include="Program.cs" />
Expand Down
95 changes: 95 additions & 0 deletions CFNGamejam2/Content/Content.mgcb
Original file line number Diff line number Diff line change
Expand Up @@ -1039,3 +1039,98 @@
/processorParam:TextureFormat=Compressed
/build:Models/Bomb.obj

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

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

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

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

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

8 changes: 8 additions & 0 deletions CFNGamejam2/Content/Models/Gate-0.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 Gate-0.png
Binary file added CFNGamejam2/Content/Models/Gate-0.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 CFNGamejam2/Content/Models/Gate-1.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 Gate-1.png
Binary file added CFNGamejam2/Content/Models/Gate-1.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 CFNGamejam2/Content/Models/Gate-2.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 Gate-2.png
Binary file added CFNGamejam2/Content/Models/Gate-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions CFNGamejam2/Content/Models/GateDoor.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 09.01.2018 14:03:47

newmtl palette
Ns 30.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 1.0000 1.0000 1.0000
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Gate-1.png
map_Kd E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Gate-1.png
16 changes: 16 additions & 0 deletions CFNGamejam2/Content/Models/GateFrame.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 09.01.2018 14:02:49

newmtl palette
Ns 30.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 1.0000 1.0000 1.0000
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Gate-0.png
map_Kd E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Gate-0.png
16 changes: 16 additions & 0 deletions CFNGamejam2/Content/Models/GateWall.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 09.01.2018 14:16:16

newmtl palette
Ns 30.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 1.0000 1.0000 1.0000
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Gate-2.png
map_Kd E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Gate-2.png
16 changes: 16 additions & 0 deletions CFNGamejam2/Content/Models/Mountain.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 10.01.2018 12:58:46

newmtl palette
Ns 30.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 1.0000 1.0000 1.0000
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Mountain.png
map_Kd E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Mountain.png
Binary file added CFNGamejam2/Content/Models/Mountain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions CFNGamejam2/Content/Models/Water.mtl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 10.01.2018 13:50:19

newmtl palette
Ns 30.0000
Ni 1.5000
d 1.0000
Tr 0.0000
Tf 1.0000 1.0000 1.0000
illum 2
Ka 0.0000 0.0000 0.0000
Kd 1.0000 1.0000 1.0000
Ks 0.0000 0.0000 0.0000
Ke 0.0000 0.0000 0.0000
map_Ka E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Water.png
map_Kd E:\Documents\Visual Studio 2017\Projects\VS2017C#\MonoGame\CFNGamejam2\CFNGamejam2\Content\Models\Water.png
Binary file added CFNGamejam2/Content/Models/Water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 15 additions & 16 deletions CFNGamejam2/Engine/AModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class AModel : PositionedObject, IDrawComponent, ILoadContent
public XnaModel XNAModel { get; private set; }
public Matrix TheWoldMatrix { get => BaseWorld; }
public BoundingSphere Sphere { get => XNAModel.Meshes[0].BoundingSphere; }
public float SphereRadius { get => XNAModel.Meshes[0].BoundingSphere.Radius; }
public bool AnimatedScale { get => m_AnimatedScale; set => m_AnimatedScale = value; }
public bool Visable { get => Enabled; set => Enabled = value; }

Expand Down Expand Up @@ -182,6 +181,7 @@ public virtual void Spawn(Vector3 position, Vector3 rotation)
public virtual void Spawn(Vector3 position)
{
Active = true;
Hit = false;
Position = position;
MatrixUpdate();
}
Expand All @@ -190,15 +190,16 @@ public virtual void Spawn(Vector3 position)
/// Will return true of they intersect on the X and Y plane.
/// The Z plane is ignored.
/// </summary>
/// <param name="Target">Target Positioned Object.</param>
/// <param name="target">Target Positioned Object.</param>
/// <returns></returns>
public bool SphereIntersect2D(AModel Target)
public bool SphereIntersect2DZ(AModel target)
{
float distanceX = Target.Position.X - Position.X;
float distanceY = Target.Position.Y - Position.Y;
float radius = (SphereRadius * Scale) + (Target.SphereRadius * Scale);
float distanceX = target.Position.X - Position.X;
float distanceY = target.Position.Y - Position.Y;
float radius = ((Sphere.Radius * Scale) * 0.8f) +
((target.Sphere.Radius * target.Scale) * 0.8f);

if ((distanceX * distanceX) + (distanceY * distanceY) < radius * radius)
if ((distanceX * distanceX) + (distanceY * distanceY) < radius)
return true;

return false;
Expand All @@ -207,16 +208,14 @@ public bool SphereIntersect2D(AModel Target)
/// <summary>
/// Sphere collusion detection. Target sphere will be compared to this class's.
/// </summary>
/// <param name="Target">Target Positioned Object.</param>
/// <param name="target">Target Positioned Object.</param>
/// <returns></returns>
public bool SphereIntersect(AModel Target)
public bool SphereIntersect(AModel target)
{
float distanceX = Target.Position.X - Position.X;
float distanceY = Target.Position.Y - Position.Y;
float distanceZ = Target.Position.Z - Position.Z;
float radius = (SphereRadius * Scale) + (Target.SphereRadius * Scale);
float radius = ((Sphere.Radius * Scale) * 0.8f) +
((target.Sphere.Radius * target.Scale) * 0.8f);

if ((distanceX * distanceX) + (distanceY * distanceY) + (distanceZ * distanceZ) < radius * radius)
if (Vector3.Distance(Position, target.Position) < radius)
return true;

return false;
Expand All @@ -228,8 +227,8 @@ public void SetModel(XnaModel model)
{
XNAModel = model;

ModelTransforms = new Matrix[XNAModel.Bones.Count];
XNAModel.CopyAbsoluteBoneTransformsTo(ModelTransforms);
//ModelTransforms = new Matrix[XNAModel.Bones.Count];
//XNAModel.CopyAbsoluteBoneTransformsTo(ModelTransforms);
}
}

Expand Down
Loading

0 comments on commit 6b2d59e

Please sign in to comment.