Permalink
Browse files

for merging

  • Loading branch information...
Patrick Madden
Patrick Madden committed Jul 15, 2012
2 parents 8612b98 + 9e250e4 commit 199ba57e57cce88cbbfc9d218ce3a3cf67c86533
View
@@ -18,16 +18,16 @@ public class Billy : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
- PlayerInput keyboard;
- List<Actor> actors;
+
+ PlayerInput testInput;
+ StaticComponent statictestComp;
+
public Billy()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
-
-
}
/// <summary>
@@ -39,14 +39,19 @@ public Billy()
protected override void Initialize()
{
// TODO: Add your initialization logic here
-
+
base.Initialize();
+<<<<<<< HEAD
keyboard = new PlayerInput();
//Init player
Actor player = new Actor();
PlayerInputComponent pic = new PlayerInputComponent();
player.addComponent(pic);
+=======
+ testInput = new PlayerInput();
+ statictestComp = new StaticComponent();
+>>>>>>> 9e250e4bf89b5260edf5d94e5cf6a9c7d9bbc600
}
/// <summary>
@@ -57,7 +62,7 @@ protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
-
+
// TODO: use this.Content to load your game content here
}
@@ -109,6 +114,7 @@ protected override void Draw(GameTime gameTime)
// TODO: Add your drawing code here
+<<<<<<< HEAD
foreach (Actor a in actors)
{
if (a.hasComponent("DrawableComponent"))
@@ -121,6 +127,9 @@ protected override void Draw(GameTime gameTime)
}
+=======
+ statictestComp.Draw(gameTime);
+>>>>>>> 9e250e4bf89b5260edf5d94e5cf6a9c7d9bbc600
base.Draw(gameTime);
}
}
View
@@ -109,12 +109,14 @@
<ItemGroup>
<Compile Include="Actor.cs" />
<Compile Include="Component.cs" />
+ <Compile Include="DrawableComponent.cs" />
<Compile Include="Input.cs" />
<Compile Include="PlayerInputComponent.cs" />
<Compile Include="PlayerInput.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Program.cs" />
<Compile Include="Billy.cs" />
+ <Compile Include="StaticComponent.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Game.ico" />
@@ -0,0 +1 @@
+Content\test.xnb
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+
+namespace Billy
+{
+ class DrawableComponent
+ {
+
+ void Apply(Actor a) { }
+ void Draw(GameTime gt) { }
+
+
+ }
+}
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Billy
+{
+ class InputComponent
+ {
+
+ }
+}
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Graphics;
+using Microsoft.Xna.Framework.Content;
+
+namespace Billy
+{
+ class StaticComponent : DrawableComponent
+ {
+ int x, y;
+ Vector2 myPos;
+ Texture2D texture;
+
+ System.IO.FileStream stream;
+ //Potential problem with GraphicsDevice initializing null for some reason
+ SpriteBatch spriteBatch;
+ GraphicsDevice gd;
+
+ void main() {
+ spriteBatch = new SpriteBatch(gd);
+
+ stream = new System.IO.FileStream(@"C:\Programming\Billy\Billy\BillyContent\test.png", System.IO.FileMode.Open);
+ texture = Texture2D.FromStream(gd, stream);
+ }
+
+ void Apply(Actor a)
+ {
+ //myPos = a.pos;
+ }
+
+ public void Draw(GameTime gt)
+ {
+
+ spriteBatch.Begin();
+ spriteBatch.Draw(texture, myPos, Color.White);
+ spriteBatch.End();
+
+
+ }
+
+ }
+}
@@ -41,6 +41,14 @@
<Private>False</Private>
</Reference>
</ItemGroup>
+ <ItemGroup>
+ <Compile Include="test.png">
+ <Name>test</Name>
+ <Importer>TextureImporter</Importer>
+ <Processor>TextureProcessor</Processor>
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </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.
View
Binary file not shown.
View
Binary file not shown.

0 comments on commit 199ba57

Please sign in to comment.