Shot and Shooting Classes added (not working yet)
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace DepthsBelow.Component
|
||||
{
|
||||
class Shooting : Component
|
||||
{
|
||||
protected int stepsTaken = 0;
|
||||
protected int distanceToTarget = 0;
|
||||
protected int panic = 0;
|
||||
protected int soldierAim = 0;
|
||||
protected int weaponAccuracy = 0;
|
||||
protected int enemyDodge = 0;
|
||||
|
||||
protected int penaltyRange = 5;
|
||||
|
||||
public Shooting(Entity parent) : base (parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public int CalculateChance()
|
||||
{
|
||||
int baseHitChance = soldierAim + weaponAccuracy;
|
||||
int baseDodgeChance = panic + enemyDodge;
|
||||
int basePenalty = ReturnPenalty(stepsTaken) + (int)(ReturnPenalty(distanceToTarget) / 2);
|
||||
int chanceToHit = baseHitChance - baseDodgeChance - basePenalty;
|
||||
return chanceToHit;
|
||||
}
|
||||
|
||||
public int ReturnPenalty(int distance)
|
||||
{
|
||||
int penalty = 0;
|
||||
if (distance >= penaltyRange * 3)
|
||||
{
|
||||
penalty = 100;
|
||||
}
|
||||
else if (distance >= penaltyRange * 2)
|
||||
{
|
||||
distance -= penaltyRange * 2;
|
||||
penalty = penaltyRange + penaltyRange * 3 + distance * 5;
|
||||
}
|
||||
else if (distance >= penaltyRange)
|
||||
{
|
||||
distance -= penaltyRange;
|
||||
penalty = penaltyRange + distance * 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
penalty = distance;
|
||||
}
|
||||
return penalty;
|
||||
}
|
||||
}
|
||||
}
|
||||
+211
-202
@@ -1,202 +1,211 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using DepthsBelow.GUI;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.GamerServices;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using Microsoft.Xna.Framework.Media;
|
||||
|
||||
namespace DepthsBelow
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the main type for your game
|
||||
/// </summary>
|
||||
public class Core : Microsoft.Xna.Framework.Game
|
||||
{
|
||||
public static GraphicsDeviceManager GraphicsDeviceManager;
|
||||
SpriteBatch spriteBatch;
|
||||
|
||||
public Camera Camera;
|
||||
|
||||
public bool PlayerTurn = true;
|
||||
public static MouseInput MouseInput;
|
||||
public static KeyboardInput KeyboardInput;
|
||||
public List<Soldier> Squad;
|
||||
public List<SmallEnemy> Swarm;
|
||||
public static Map Map;
|
||||
|
||||
public SmallEnemy TestMonster;
|
||||
|
||||
public Core()
|
||||
{
|
||||
GraphicsDeviceManager = new GraphicsDeviceManager(this);
|
||||
Content.RootDirectory = "Content";
|
||||
|
||||
GraphicsDeviceManager.PreferredBackBufferWidth = 1280;
|
||||
GraphicsDeviceManager.PreferredBackBufferHeight = 720;
|
||||
GraphicsDeviceManager.IsFullScreen = false;
|
||||
|
||||
//graphics.SynchronizeWithVerticalRetrace = false;
|
||||
this.IsFixedTimeStep = false;
|
||||
GraphicsDeviceManager.ApplyChanges();
|
||||
|
||||
this.IsMouseVisible = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the game to perform any initialization it needs to before starting to run.
|
||||
/// This is where it can query for any required services and load any non-graphic
|
||||
/// related content. Calling base.Initialize will enumerate through any components
|
||||
/// and initialize them as well.
|
||||
/// </summary>
|
||||
protected override void Initialize()
|
||||
{
|
||||
// TODO: Add your initialization logic here
|
||||
Camera = new Camera(this);
|
||||
Squad = new List<Soldier>();
|
||||
Swarm = new List<SmallEnemy>();
|
||||
|
||||
TestMonster = new SmallEnemy(this, ref Swarm);
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LoadContent will be called once per game and is the place to load
|
||||
/// all of your content.
|
||||
/// </summary>
|
||||
protected override void LoadContent()
|
||||
{
|
||||
// Create a new SpriteBatch, which can be used to draw textures.
|
||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
|
||||
Map = Content.Load<Map>("maps/Cave.Level1");
|
||||
// Load map objects
|
||||
Map.ParseObjects(this);
|
||||
|
||||
// TODO: use this.Content to load your game content here
|
||||
Soldier.LoadContent(this);
|
||||
SmallEnemy.LoadContent(this);
|
||||
|
||||
MouseInput = new MouseInput(this);
|
||||
MouseInput.LoadContent();
|
||||
KeyboardInput = new KeyboardInput(this);
|
||||
|
||||
TestMonster.X = 12;
|
||||
TestMonster.Y = 4;
|
||||
// Test GUI frames
|
||||
var frame = new GUI.Button()
|
||||
{
|
||||
X = 100,
|
||||
Width = 48,
|
||||
Height = 23,
|
||||
Texture = Content.Load<Texture2D>("images/Enter"),
|
||||
OnClick = delegate(Point clickPos)
|
||||
{
|
||||
Debug.WriteLine("That ugly button was clicked at (" + clickPos.X + "," + clickPos.Y + ")");
|
||||
}
|
||||
};
|
||||
var text = new GUI.Text(Content.Load<SpriteFont>("Arial"));
|
||||
text.Value = "Hello world!";
|
||||
frame.Add(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UnloadContent will be called once per game and is the place to unload
|
||||
/// all content.
|
||||
/// </summary>
|
||||
protected override void UnloadContent()
|
||||
{
|
||||
// TODO: Unload any non ContentManager content here
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the game to run logic such as updating the world,
|
||||
/// checking for collisions, gathering input, and playing audio.
|
||||
/// </summary>
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Update(GameTime gameTime)
|
||||
{
|
||||
// Allows the game to exit
|
||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
|
||||
this.Exit();
|
||||
|
||||
Camera.Update(gameTime);
|
||||
MouseInput.Update(gameTime);
|
||||
KeyboardInput.Update(gameTime);
|
||||
|
||||
// Update soldiers in squad
|
||||
foreach (var soldier in Squad)
|
||||
soldier.Update(gameTime);
|
||||
|
||||
foreach (var body in Swarm)
|
||||
body.Update(gameTime);
|
||||
|
||||
TestMonster.Update(gameTime);
|
||||
GUIManager.Update(gameTime);
|
||||
|
||||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
public int FindDistance(Vector2 target, Vector2 start)
|
||||
{
|
||||
Vector2 combine = new Vector2(target.X - start.X, target.Y - start.Y);
|
||||
|
||||
int result = 0;
|
||||
int firstRestult = (int)Math.Sqrt((int)combine.X^2 + (int)combine.Y^2);
|
||||
|
||||
result = (int)Vector2.Distance(target, start);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is called when the game should draw itself.
|
||||
/// </summary>
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
GraphicsDevice.Clear(Color.Black);
|
||||
|
||||
// Start drawing using the Camera transform
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null,
|
||||
Camera.Transform);
|
||||
|
||||
// Draw the level
|
||||
Map.Draw(spriteBatch);
|
||||
|
||||
// Draw units
|
||||
foreach (var soldier in Squad)
|
||||
{
|
||||
var sr = soldier.GetComponent<Component.SpriteRenderer>();
|
||||
if (sr != null)
|
||||
sr.Draw(spriteBatch);
|
||||
}
|
||||
foreach (var body in Swarm)
|
||||
{
|
||||
var sr = body.GetComponent<Component.SpriteRenderer>();
|
||||
if (sr != null)
|
||||
sr.Draw(spriteBatch);
|
||||
}
|
||||
|
||||
// Draw mouse input visuals
|
||||
MouseInput.Draw(spriteBatch);
|
||||
|
||||
TestMonster.GetComponent<Component.SpriteRenderer>().Draw(spriteBatch);
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
// Start drawing GUI components
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.AnisotropicClamp, null, null, null, Matrix.Identity);
|
||||
GUIManager.Draw(spriteBatch);
|
||||
spriteBatch.End();
|
||||
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using DepthsBelow.GUI;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.GamerServices;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using Microsoft.Xna.Framework.Media;
|
||||
|
||||
namespace DepthsBelow
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the main type for your game
|
||||
/// </summary>
|
||||
public class Core : Microsoft.Xna.Framework.Game
|
||||
{
|
||||
public static GraphicsDeviceManager GraphicsDeviceManager;
|
||||
SpriteBatch spriteBatch;
|
||||
|
||||
public Camera Camera;
|
||||
|
||||
public bool PlayerTurn = true;
|
||||
public static MouseInput MouseInput;
|
||||
public static KeyboardInput KeyboardInput;
|
||||
public List<Soldier> Squad;
|
||||
public List<SmallEnemy> Swarm;
|
||||
public List<Shot> Volley;
|
||||
public static Map Map;
|
||||
|
||||
public SmallEnemy TestMonster;
|
||||
|
||||
public Core()
|
||||
{
|
||||
GraphicsDeviceManager = new GraphicsDeviceManager(this);
|
||||
Content.RootDirectory = "Content";
|
||||
|
||||
GraphicsDeviceManager.PreferredBackBufferWidth = 1280;
|
||||
GraphicsDeviceManager.PreferredBackBufferHeight = 720;
|
||||
GraphicsDeviceManager.IsFullScreen = false;
|
||||
|
||||
//graphics.SynchronizeWithVerticalRetrace = false;
|
||||
this.IsFixedTimeStep = false;
|
||||
GraphicsDeviceManager.ApplyChanges();
|
||||
|
||||
this.IsMouseVisible = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the game to perform any initialization it needs to before starting to run.
|
||||
/// This is where it can query for any required services and load any non-graphic
|
||||
/// related content. Calling base.Initialize will enumerate through any components
|
||||
/// and initialize them as well.
|
||||
/// </summary>
|
||||
protected override void Initialize()
|
||||
{
|
||||
// TODO: Add your initialization logic here
|
||||
Camera = new Camera(this);
|
||||
Squad = new List<Soldier>();
|
||||
Swarm = new List<SmallEnemy>();
|
||||
Volley = new List<Shot>();
|
||||
|
||||
TestMonster = new SmallEnemy(this, ref Swarm);
|
||||
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// LoadContent will be called once per game and is the place to load
|
||||
/// all of your content.
|
||||
/// </summary>
|
||||
protected override void LoadContent()
|
||||
{
|
||||
// Create a new SpriteBatch, which can be used to draw textures.
|
||||
spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||
|
||||
Map = Content.Load<Map>("maps/Cave.Level1");
|
||||
// Load map objects
|
||||
Map.ParseObjects(this);
|
||||
|
||||
// TODO: use this.Content to load your game content here
|
||||
Soldier.LoadContent(this);
|
||||
SmallEnemy.LoadContent(this);
|
||||
Shot.LoadContent(this);
|
||||
|
||||
MouseInput = new MouseInput(this);
|
||||
MouseInput.LoadContent();
|
||||
KeyboardInput = new KeyboardInput(this);
|
||||
|
||||
TestMonster.X = 12;
|
||||
TestMonster.Y = 4;
|
||||
// Test GUI frames
|
||||
var frame = new GUI.Button()
|
||||
{
|
||||
X = 100,
|
||||
Width = 48,
|
||||
Height = 23,
|
||||
Texture = Content.Load<Texture2D>("images/Enter"),
|
||||
OnClick = delegate(Point clickPos)
|
||||
{
|
||||
Debug.WriteLine("That ugly button was clicked at (" + clickPos.X + "," + clickPos.Y + ")");
|
||||
}
|
||||
};
|
||||
var text = new GUI.Text(Content.Load<SpriteFont>("Arial"));
|
||||
text.Value = "Hello world!";
|
||||
frame.Add(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// UnloadContent will be called once per game and is the place to unload
|
||||
/// all content.
|
||||
/// </summary>
|
||||
protected override void UnloadContent()
|
||||
{
|
||||
// TODO: Unload any non ContentManager content here
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the game to run logic such as updating the world,
|
||||
/// checking for collisions, gathering input, and playing audio.
|
||||
/// </summary>
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Update(GameTime gameTime)
|
||||
{
|
||||
// Allows the game to exit
|
||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
|
||||
this.Exit();
|
||||
|
||||
Camera.Update(gameTime);
|
||||
MouseInput.Update(gameTime);
|
||||
KeyboardInput.Update(gameTime);
|
||||
|
||||
// Update soldiers in squad
|
||||
foreach (var soldier in Squad)
|
||||
soldier.Update(gameTime);
|
||||
|
||||
foreach (var body in Swarm)
|
||||
body.Update(gameTime);
|
||||
|
||||
TestMonster.Update(gameTime);
|
||||
GUIManager.Update(gameTime);
|
||||
|
||||
base.Update(gameTime);
|
||||
}
|
||||
|
||||
public int FindDistance(Vector2 target, Vector2 start)
|
||||
{
|
||||
Vector2 combine = new Vector2(target.X - start.X, target.Y - start.Y);
|
||||
|
||||
int result = 0;
|
||||
int firstRestult = (int)Math.Sqrt((int)combine.X^2 + (int)combine.Y^2);
|
||||
|
||||
result = (int)Vector2.Distance(target, start);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is called when the game should draw itself.
|
||||
/// </summary>
|
||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||
protected override void Draw(GameTime gameTime)
|
||||
{
|
||||
GraphicsDevice.Clear(Color.Black);
|
||||
|
||||
// Start drawing using the Camera transform
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null,
|
||||
Camera.Transform);
|
||||
|
||||
// Draw the level
|
||||
Map.Draw(spriteBatch);
|
||||
|
||||
// Draw units
|
||||
foreach (var soldier in Squad)
|
||||
{
|
||||
var sr = soldier.GetComponent<Component.SpriteRenderer>();
|
||||
if (sr != null)
|
||||
sr.Draw(spriteBatch);
|
||||
}
|
||||
foreach (var body in Swarm)
|
||||
{
|
||||
var sr = body.GetComponent<Component.SpriteRenderer>();
|
||||
if (sr != null)
|
||||
sr.Draw(spriteBatch);
|
||||
}
|
||||
foreach (var bullet in Volley)
|
||||
{
|
||||
var sr = bullet.GetComponent<Component.SpriteRenderer>();
|
||||
if (sr != null)
|
||||
sr.Draw(spriteBatch);
|
||||
}
|
||||
|
||||
// Draw mouse input visuals
|
||||
MouseInput.Draw(spriteBatch);
|
||||
|
||||
TestMonster.GetComponent<Component.SpriteRenderer>().Draw(spriteBatch);
|
||||
|
||||
spriteBatch.End();
|
||||
|
||||
// Start drawing GUI components
|
||||
spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.AnisotropicClamp, null, null, null, Matrix.Identity);
|
||||
GUIManager.Draw(spriteBatch);
|
||||
spriteBatch.End();
|
||||
|
||||
base.Draw(gameTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,198 +1,200 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{94683C5B-052D-4143-96D8-35C67E831000}</ProjectGuid>
|
||||
<ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DepthsBelow</RootNamespace>
|
||||
<AssemblyName>DepthsBelow</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
|
||||
<XnaPlatform>Windows</XnaPlatform>
|
||||
<XnaProfile>HiDef</XnaProfile>
|
||||
<XnaCrossPlatformGroupID>faa0577e-a03e-43cf-89c7-0a03f4c22717</XnaCrossPlatformGroupID>
|
||||
<XnaOutputType>Game</XnaOutputType>
|
||||
<ApplicationIcon>Game.ico</ApplicationIcon>
|
||||
<Thumbnail>GameThumbnail.png</Thumbnail>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x86\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<XnaCompressContent>false</XnaCompressContent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\x86\Release</OutputPath>
|
||||
<DefineConstants>TRACE;WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<XnaCompressContent>true</XnaCompressContent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestCertificateThumbprint>ECE66DEF071576E8D2F7D57232C0569623E3E2DF</ManifestCertificateThumbprint>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestKeyFile>DepthsBelow_TemporaryKey.pfx</ManifestKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateManifests>true</GenerateManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignManifests>true</SignManifests>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Video, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Avatar, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Camera.cs" />
|
||||
<Compile Include="GUIManager.cs" />
|
||||
<Compile Include="GUI\Button.cs" />
|
||||
<Compile Include="GUI\Frame.cs" />
|
||||
<Compile Include="GUI\Text.cs" />
|
||||
<Compile Include="KeyboardInput.cs" />
|
||||
<Compile Include="Component\PathFinder.cs" />
|
||||
<Compile Include="Component\Transform.cs" />
|
||||
<Compile Include="Grid.cs" />
|
||||
<Compile Include="Component\Collision.cs" />
|
||||
<Compile Include="Component\Component.cs" />
|
||||
<Compile Include="Component\GridTransform.cs" />
|
||||
<Compile Include="Core.cs" />
|
||||
<Compile Include="Entity.cs" />
|
||||
<Compile Include="Map.cs" />
|
||||
<Compile Include="MouseInput.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Component\SpriteRenderer.cs" />
|
||||
<Compile Include="RenderHelpers.cs" />
|
||||
<Compile Include="SmallEnemy.cs" />
|
||||
<Compile Include="Soldier.cs" />
|
||||
<Compile Include="Component\PixelTransform.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Game.ico" />
|
||||
<Content Include="GameThumbnail.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\AStar\AStar.csproj">
|
||||
<Project>{CD3F949D-54AA-4D38-99DB-92905A375D84}</Project>
|
||||
<Name>AStar</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DepthsBelowContent\DepthsBelowContent.contentproj">
|
||||
<Name>DepthsBelowContent %28Content%29</Name>
|
||||
<XnaReferenceType>Content</XnaReferenceType>
|
||||
<Project>{433A77A2-DE52-4875-A4EF-232CF59C2DD3}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DepthsBelow_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{94683C5B-052D-4143-96D8-35C67E831000}</ProjectGuid>
|
||||
<ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DepthsBelow</RootNamespace>
|
||||
<AssemblyName>DepthsBelow</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
|
||||
<XnaPlatform>Windows</XnaPlatform>
|
||||
<XnaProfile>HiDef</XnaProfile>
|
||||
<XnaCrossPlatformGroupID>faa0577e-a03e-43cf-89c7-0a03f4c22717</XnaCrossPlatformGroupID>
|
||||
<XnaOutputType>Game</XnaOutputType>
|
||||
<ApplicationIcon>Game.ico</ApplicationIcon>
|
||||
<Thumbnail>GameThumbnail.png</Thumbnail>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>1</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\x86\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<XnaCompressContent>false</XnaCompressContent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\x86\Release</OutputPath>
|
||||
<DefineConstants>TRACE;WINDOWS</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<XnaCompressContent>true</XnaCompressContent>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestCertificateThumbprint>ECE66DEF071576E8D2F7D57232C0569623E3E2DF</ManifestCertificateThumbprint>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ManifestKeyFile>DepthsBelow_TemporaryKey.pfx</ManifestKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateManifests>true</GenerateManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SignManifests>true</SignManifests>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Video, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Avatar, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xml">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Net">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Camera.cs" />
|
||||
<Compile Include="Shot.cs" />
|
||||
<Compile Include="Component\Shooting.cs" />
|
||||
<Compile Include="GUIManager.cs" />
|
||||
<Compile Include="GUI\Button.cs" />
|
||||
<Compile Include="GUI\Frame.cs" />
|
||||
<Compile Include="GUI\Text.cs" />
|
||||
<Compile Include="KeyboardInput.cs" />
|
||||
<Compile Include="Component\PathFinder.cs" />
|
||||
<Compile Include="Component\Transform.cs" />
|
||||
<Compile Include="Grid.cs" />
|
||||
<Compile Include="Component\Collision.cs" />
|
||||
<Compile Include="Component\Component.cs" />
|
||||
<Compile Include="Component\GridTransform.cs" />
|
||||
<Compile Include="Core.cs" />
|
||||
<Compile Include="Entity.cs" />
|
||||
<Compile Include="Map.cs" />
|
||||
<Compile Include="MouseInput.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Component\SpriteRenderer.cs" />
|
||||
<Compile Include="RenderHelpers.cs" />
|
||||
<Compile Include="SmallEnemy.cs" />
|
||||
<Compile Include="Soldier.cs" />
|
||||
<Compile Include="Component\PixelTransform.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Game.ico" />
|
||||
<Content Include="GameThumbnail.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\AStar\AStar.csproj">
|
||||
<Project>{CD3F949D-54AA-4D38-99DB-92905A375D84}</Project>
|
||||
<Name>AStar</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DepthsBelowContent\DepthsBelowContent.contentproj">
|
||||
<Name>DepthsBelowContent %28Content%29</Name>
|
||||
<XnaReferenceType>Content</XnaReferenceType>
|
||||
<Project>{433A77A2-DE52-4875-A4EF-232CF59C2DD3}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Windows Installer 3.1</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Xna.Framework.4.0">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft XNA Framework Redistributable 4.0</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DepthsBelow_TemporaryKey.pfx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
@@ -200,5 +202,5 @@
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,78 +1,82 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using Microsoft.Xna.Framework.Media;
|
||||
|
||||
namespace DepthsBelow
|
||||
{
|
||||
public class KeyboardInput
|
||||
{
|
||||
Core core;
|
||||
bool Enter = false;
|
||||
bool turn;
|
||||
|
||||
public KeyboardInput(Core core)
|
||||
{
|
||||
this.core = core;
|
||||
}
|
||||
|
||||
public void Update(GameTime gameTime)
|
||||
{
|
||||
KeyboardState ks = Keyboard.GetState();
|
||||
|
||||
if (ks.IsKeyUp(Keys.Enter) && Enter == true)
|
||||
{
|
||||
Enter = false;
|
||||
}
|
||||
|
||||
if (ks.IsKeyDown(Keys.Enter) && Enter == false)
|
||||
{
|
||||
Enter = true;
|
||||
if (core.PlayerTurn == false)
|
||||
{
|
||||
core.PlayerTurn = true;
|
||||
foreach (var unit in core.Squad)
|
||||
{
|
||||
unit.step = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
core.TestMonster.step = 0;
|
||||
core.PlayerTurn = false;
|
||||
Point target = Point.Zero;
|
||||
int distance = 7000;
|
||||
foreach (var unit in core.Squad)
|
||||
{
|
||||
Vector2 soldier = new Vector2(unit.Transform.Grid.X, unit.Transform.Grid.Y);
|
||||
Vector2 monster = new Vector2(core.TestMonster.Transform.Grid.X, core.TestMonster.Transform.Grid.Y);
|
||||
|
||||
int newDistance = core.FindDistance(soldier, monster);
|
||||
if (newDistance < distance)
|
||||
{
|
||||
target = unit.Transform.Grid;
|
||||
distance = newDistance;
|
||||
}
|
||||
}
|
||||
core.TestMonster.GetComponent<Component.PathFinder>().Goal = target;
|
||||
distance = 7000;
|
||||
}
|
||||
}
|
||||
if (ks.IsKeyDown(Keys.A))
|
||||
{
|
||||
/*foreach (var unit in core.Swarm)
|
||||
{
|
||||
unit.X = 200;
|
||||
unit.Y = 200;
|
||||
}*/
|
||||
core.TestMonster.X = 12;
|
||||
core.TestMonster.Y = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
using Microsoft.Xna.Framework.Media;
|
||||
|
||||
namespace DepthsBelow
|
||||
{
|
||||
public class KeyboardInput
|
||||
{
|
||||
Core core;
|
||||
bool Enter = false;
|
||||
bool turn;
|
||||
|
||||
public KeyboardInput(Core core)
|
||||
{
|
||||
this.core = core;
|
||||
}
|
||||
|
||||
public void Update(GameTime gameTime)
|
||||
{
|
||||
KeyboardState ks = Keyboard.GetState();
|
||||
|
||||
if (ks.IsKeyUp(Keys.Enter) && Enter == true)
|
||||
{
|
||||
Enter = false;
|
||||
}
|
||||
|
||||
if (ks.IsKeyDown(Keys.Enter) && Enter == false)
|
||||
{
|
||||
Enter = true;
|
||||
if (core.PlayerTurn == false)
|
||||
{
|
||||
core.PlayerTurn = true;
|
||||
foreach (var unit in core.Squad)
|
||||
{
|
||||
unit.step = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
core.TestMonster.step = 0;
|
||||
core.PlayerTurn = false;
|
||||
Point target = Point.Zero;
|
||||
int distance = 7000;
|
||||
foreach (var unit in core.Squad)
|
||||
{
|
||||
Vector2 soldier = new Vector2(unit.Transform.Grid.X, unit.Transform.Grid.Y);
|
||||
Vector2 monster = new Vector2(core.TestMonster.Transform.Grid.X, core.TestMonster.Transform.Grid.Y);
|
||||
|
||||
int newDistance = core.FindDistance(soldier, monster);
|
||||
if (newDistance < distance)
|
||||
{
|
||||
target = unit.Transform.Grid;
|
||||
distance = newDistance;
|
||||
}
|
||||
}
|
||||
core.TestMonster.GetComponent<Component.PathFinder>().Goal = target;
|
||||
distance = 7000;
|
||||
}
|
||||
}
|
||||
if (ks.IsKeyDown(Keys.A))
|
||||
{
|
||||
/*foreach (var unit in core.Swarm)
|
||||
{
|
||||
unit.X = 200;
|
||||
unit.Y = 200;
|
||||
}*/
|
||||
core.TestMonster.X = 12;
|
||||
core.TestMonster.Y = 4;
|
||||
}
|
||||
if (ks.IsKeyDown(Keys.S))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using DepthsBelow.Component;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
|
||||
namespace DepthsBelow
|
||||
{
|
||||
public class Shot : Entity
|
||||
{
|
||||
public static Texture2D Texture;
|
||||
public Color Color;
|
||||
public static Point Origin;
|
||||
|
||||
private bool _selected; //I guess as in "currently doing something"
|
||||
|
||||
public List<Shot> Volley;
|
||||
|
||||
private PathFinder.Node nextNode;
|
||||
public Vector2 direction = Vector2.Zero;
|
||||
|
||||
public Shot(Core core)
|
||||
: base(core)
|
||||
{
|
||||
if (Texture == null)
|
||||
LoadContent(core);
|
||||
|
||||
Transform.World.Origin = new Vector2(16, 16);
|
||||
|
||||
this.Color = Color.White;
|
||||
var rc = new SpriteRenderer(this) { Texture = Texture, Color = Color.White };
|
||||
AddComponent(rc);
|
||||
|
||||
var cc = new Collision(this, 32, 32);
|
||||
AddComponent(cc);
|
||||
|
||||
}
|
||||
public static void LoadContent(Core core)
|
||||
{
|
||||
Texture = core.Content.Load<Texture2D>("images/Shot");
|
||||
}
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
base.Update(gameTime);
|
||||
|
||||
float elapsed = gameTime.ElapsedGameTime.Milliseconds / 1000.0f;
|
||||
List<Point> soldierCollisions = new List<Point>();
|
||||
|
||||
foreach (var body in core.Swarm)
|
||||
{
|
||||
if (this.GetComponent<Collision>().Rectangle.Intersects(body.GetComponent<Collision>().Rectangle))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var soldier in core.Squad)
|
||||
{
|
||||
if (this.GetComponent<Collision>().Rectangle.Intersects(soldier.GetComponent<Collision>().Rectangle))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
// HACK: Make this work properly with other speeds...
|
||||
float speed = 4f;
|
||||
Transform.World.Position += speed * direction;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,131 +1,138 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{433A77A2-DE52-4875-A4EF-232CF59C2DD3}</ProjectGuid>
|
||||
<ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)</OutputPath>
|
||||
<ContentRootDirectory>Content</ContentRootDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RootNamespace>DepthsBelowContent</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\soldier.png">
|
||||
<Name>soldier</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
<Compile Include="maps\test.tmx">
|
||||
<Name>test</Name>
|
||||
<Importer>TmxImporter</Importer>
|
||||
<Processor>MapProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\TiledLib\TiledLib\TiledLib.csproj">
|
||||
<Project>{EC3F6988-459C-4783-89E9-F34C0CC731C7}</Project>
|
||||
<Name>TiledLib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DepthsBelowContentPipeline\DepthsBelowContentPipeline.csproj">
|
||||
<Project>{D054E3A6-7E05-4255-984F-69FE40D9137F}</Project>
|
||||
<Name>DepthsBelowContentPipeline</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\tilesets\aztek.jpg">
|
||||
<Name>aztek</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\soldier2.png">
|
||||
<Name>soldier2</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\tilesets\collision.png">
|
||||
<Name>collision</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\Cave.Level1.tmx">
|
||||
<Name>Cave.Level1</Name>
|
||||
<Processor>MapProcessor</Processor>
|
||||
<Importer>TmxImporter</Importer>
|
||||
<SubType>Designer</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\tilesets\cave.png">
|
||||
<Name>cave</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\Monster.png">
|
||||
<Name>Monster</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\Enter.bmp">
|
||||
<Name>Enter</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Arial.spritefont">
|
||||
<Name>Arial</Name>
|
||||
<Importer>FontDescriptionImporter</Importer>
|
||||
<Processor>FontDescriptionProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{433A77A2-DE52-4875-A4EF-232CF59C2DD3}</ProjectGuid>
|
||||
<ProjectTypeGuids>{96E2B04D-8817-42c6-938A-82C39BA4D311};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
|
||||
<OutputPath>bin\$(Platform)\$(Configuration)</OutputPath>
|
||||
<ContentRootDirectory>Content</ContentRootDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<RootNamespace>DepthsBelowContent</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.EffectImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.FBXImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.TextureImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.XImporter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.AudioImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Content.Pipeline.VideoImporters, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\soldier.png">
|
||||
<Name>soldier</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
<Compile Include="maps\test.tmx">
|
||||
<Name>test</Name>
|
||||
<Importer>TmxImporter</Importer>
|
||||
<Processor>MapProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\TiledLib\TiledLib\TiledLib.csproj">
|
||||
<Project>{EC3F6988-459C-4783-89E9-F34C0CC731C7}</Project>
|
||||
<Name>TiledLib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DepthsBelowContentPipeline\DepthsBelowContentPipeline.csproj">
|
||||
<Project>{D054E3A6-7E05-4255-984F-69FE40D9137F}</Project>
|
||||
<Name>DepthsBelowContentPipeline</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\tilesets\aztek.jpg">
|
||||
<Name>aztek</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\soldier2.png">
|
||||
<Name>soldier2</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\tilesets\collision.png">
|
||||
<Name>collision</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\Cave.Level1.tmx">
|
||||
<Name>Cave.Level1</Name>
|
||||
<Processor>MapProcessor</Processor>
|
||||
<Importer>TmxImporter</Importer>
|
||||
<SubType>Designer</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="maps\tilesets\cave.png">
|
||||
<Name>cave</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\Monster.png">
|
||||
<Name>Monster</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\Enter.bmp">
|
||||
<Name>Enter</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Arial.spritefont">
|
||||
<Name>Arial</Name>
|
||||
<Importer>FontDescriptionImporter</Importer>
|
||||
<Processor>FontDescriptionProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="images\Shot.bmp">
|
||||
<Name>Shot</Name>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 222 B |
Reference in New Issue
Block a user