Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calling all IT Pros from Canada and Australia.. we need your help! Support our site by taking a quick sponsored surveyand win a chance at a $50 Amazon gift card. Click here to get started!


emforce

Member Since 16 May 2009
Offline Last Active Aug 24 2015 03:25 AM

Topics I've Started

New LWJGL 3 Tutorial Series on YouTube

06 August 2015 - 11:34 AM

Hi guys, 

 

Just wanted to announce and try and promote my latest YouTube videos on the lightweight java game library.

 

Here's the link to the channel: https://www.youtube.com/c/tutorial-edge

 

and here's a link to the first in the newest series: https://www.youtube.com/watch?v=61TGl10YmSc

 

Hopefully trying to reach 500 subs this month so if you want to help me out then please do!

 

Cheers,

 

Elliot


Tutorial Site for Game Developers

20 April 2015 - 06:21 AM

Hi Guys,

 

I've recently been working on a tutorial site that focuses primarily on game developers and helping people to write beautiful code. The current tutorial series I've been working on is based on design patterns with a gaming twist and comes complete with java code examples.

 

If you want to check it out and tell me what you think then here's the link: Tutorial-Edge

 

Cheers guys!

 

 


xna splitscreen

03 September 2010 - 08:26 AM

So I am trying to add splitscreen to my game and i cant get it to render to two viewports properly. basically it just renders to the right viewport which is not what I want. Anyway if you could have a look at my code and tell me what I am not doing properly then that would be a great help!

Heres my code:




private void DrawModel(Model model, Matrix world)
{
Matrix[] transforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(transforms);

foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
effect.World = transforms[mesh.ParentBone.Index] * world;

// Use the matrices provided by the chase camera
effect.View = view;
effect.Projection = projection;
}
mesh.Draw();
}
}


/// <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 device = graphics.GraphicsDevice;

device.Clear(Color.CornflowerBlue);

DrawModel(shipModel, Player1.World);
DrawModel(shipModel, Player2.World);
DrawModel(terrainModel, Matrix.Identity);

view = Matrix.CreateLookAt(camera.Position, camera.LookAt, camera.Up);
projection = Matrix.CreatePerspectiveFieldOfView(camera.FieldOfView,
camera.AspectRatio, camera.NearPlaneDistance, camera.FarPlaneDistance);

if (twoplayer)
{



GraphicsDevice.Viewport = leftViewport;

GraphicsDevice.Clear(Color.CornflowerBlue);


view = Matrix.CreateLookAt(camera2.Position, camera2.LookAt, camera2.Up);
projection = Matrix.CreatePerspectiveFieldOfView(camera2.FieldOfView,
camera2.AspectRatio, camera2.NearPlaneDistance, camera2.FarPlaneDistance);



DrawModel(shipModel, Player1.World);
DrawModel(shipModel, Player2.World);
DrawModel(terrainModel, Matrix.Identity);


GraphicsDevice.Viewport = rightViewport;

GraphicsDevice.Clear(Color.CornflowerBlue);


view = Matrix.CreateLookAt(camera.Position, camera.LookAt, camera.Up);
projection = Matrix.CreatePerspectiveFieldOfView(camera.FieldOfView,
camera.AspectRatio, camera.NearPlaneDistance, camera.FarPlaneDistance);

DrawModel(shipModel, Player1.World);
DrawModel(shipModel, Player2.World);
DrawModel(terrainModel, Matrix.Identity);


}


base.Draw(gameTime);
}


}





Restricting 3D movement XNA c#

23 August 2010 - 09:54 AM

Guys I was trying to get the basics down for my game and I can't seem to be able to restrict the characters movement on the X and Z axis. I have the following code:



// Prevent ship from flying under the ground
Position.Y = Math.Max(Position.Y, MinimumAltitude);

//Prevent ship from flying past the floor boundaries
Position.X = Math.Max(-650000.0f, 65000.0f);
Position.Z = Math.Max(-650000.0f, 65000.0f);

although this just stops the character from moving off this one spot.

One way I thought I could fix this is using some sort of sin or cos function to restrict its movement although how I would implement it is beyond me so any help would be really appreciated!

Virtual Town

04 August 2010 - 09:47 PM

Hi guys. So I have decided that I am going to create a virtual medieval town this year for my portfolio and I am going to be doing it in XNA and C# so I was wondering if any of you guys could help me out.

Currently I would like it to be a purely AI powered town that will grow/decrease in size depending on variable factors. I would like each person in this town to have his own AI which will help him decide things like, what job to get and what he should do in various circumstances.

But I was wondering if anyone has ever done this before and documented their path.
And I was also looking for various articles on pathfinding and things that you would deem relevant to the task at hand.

If you would like to know where I am at right now with my project, then I can tell you that I am just laying down the foundations and am soon going to start work on a (simple) procedural terrain generator.

Thanks :)

PARTNERS