Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Plutonium

Member Since 30 Aug 2011
Offline Last Active May 22 2013 11:49 AM
-----

Topics I've Started

2D Pathfinding

02 April 2013 - 01:12 PM

Hello, as allways doing some feature to my "game engine", and now I need info about path finding. Maybe anybody could give some advice what to read smile.png

What I want I painted, so would be easier to explain. There is pictures https://www.dropbox.com/sh/3apm1hupb12xdu4/jGuutop3aB

 

I need that my object go from one point to another.  As in first picture, if there is no blocks in path, so go simple straight line. Only begin and end points. As in second, if there would be block in path, find fastest way to walk around it. Now would be three point: begin, block corner and end points. If there would be more blocks - so more points would be too. 

My game is will be tile based. Now all object is 32x32 (tiles, enemies and so on), but what I thinking, is to make tiles 4x4, and all object would be same proportion as it (4x4, 8x8, 16x16, 32x32 ...) so one object could be on more then one tile. But it's just thinking for now

 

And sorry for english, really hard to remember to write good smile.png


C# for 2D game

14 March 2013 - 12:34 PM

Hello everybody, I went into some problem: want to create game, but don't find with what.

Was trying to try work with C++, but just don't like it. So came back to C# (because in work using it), and i'm struggling what to choose. What I know a bit is XNA, so could go with it, but it's dead, so what is alternative? Now installed monoGame, and created project, and seeing that xna is included. So it use XNA libs? Tried to give my friend realeased project, but only gets error. I think because he don't have XNA installed. So, monogame need XNA libs to be standalone game? So why choose monogame, if XNA won't be updated? Isn't simplier to choose XNA and make game? Read something about sharpdx and monoGame. Possible to programming game with monoGame without using XNA framework?

Or maybe u have to suggest other C# game dev solution? And no, I don't wanna try Unity. I just want create 2D games smile.png


XNA + Camera2D + PerPixelCollision

09 February 2013 - 02:40 AM

Hi, everybody smile.png

For some time playing with XNA 2D. I implemented Camera2D from tutorials: it have move, rotate and zoom. It work pretty good with simple Rectangle collision. But then I try to do PerPixelCollision with zoom - boom, game crashes. On method Texture2D.GetData(Color[]). Error says: The size of the data passed in is too large or too small for this resource. But if I dont zoom - works perfectly.

Maybe somebody have same problem?

 

I adding project (visual studio 2010), maybe somebody will know what doing not right. All logics about game objects is in Entity, in end of UpdateEntity, and next method is PerPixelCollision

 

Uh, was forget to add project. Now tried, and didn't let to add, so there is link: https://www.dropbox.com/s/gimojdfhdzspzpl/TestGame.7z


C# 2d game engine

19 August 2012 - 10:12 AM

Hi, everybody ;)
About 2 month working a lot with C# and .net, and started to think that learned a lot new things, and wanna try to make game :) Yesterday looked in C# game engine list, and didn't found really good (or looked bad?). I have some experience with XNA, but now don't wanna use it. Wanna something new :)
So, what C# game engine could use for 2d games programming?

2D movement

01 June 2012 - 08:40 AM

Hello, I'm trying to make simple 2d platformer with tile based map. And second day I stuck with movement. Maybe anybody know really good tutorial. What I looking is gravitation and jumping.
I have made player states: Falling, Standing, Walking,Running. With last two I have handled, and don't know how to make first two to work.
Have made some methods:
1. For checking if there is no collision. If many and how is same number, then object don't collide with any other object (tile)
		private void gravity(ArrayList collisionBlocks)
		{
			int many = collisionBlocks.Count;
			int how = 0;
			foreach (Block x in collisionBlocks)
			{
				if (!this.collision(x))
					how++;
			}
			if (how == many)
			{
				mCurrentState = State.Falling;
			}
		}
2. For stoping gravity if collides with any object. And if collides, then put player on top of collided tile
	   private void stopGravity(ArrayList collisionBlocks)
		{
			foreach (Block x in collisionBlocks)
			{
				if (mCurrentState == State.Falling)
					if (this.collision(x))
					{
						this.worldXY.Y = x.bounds.Top - this.height;
						mCurrentState = State.Standing;
						break;
					}
			}
		}
3. And last one - update method


	 public void movement(ArrayList collisionBlocks)
		{

			Console.WriteLine("State - " + mCurrentState);
			gravity(collisionBlocks);
			stopGravity(collisionBlocks);
			if (mCurrentState == State.Falling)
				mGravitation();



			if (mCurrentState != State.Falling)
			{
				if (Keyboard.GetState().IsKeyDown(Keys.A))
				{
					moveLeft();
					mCurrentState = State.Walking;

				} if (Keyboard.GetState().IsKeyDown(Keys.D))
				{
					moveRight();
					mCurrentState = State.Walking;

				}
				if (Keyboard.GetState().IsKeyDown(Keys.LeftShift))
				{
					acceleration();
					mCurrentState = State.Running;
				}
				if ((Keyboard.GetState().IsKeyUp(Keys.A) && Keyboard.GetState().IsKeyUp(Keys.D)))
					mCurrentState = State.Standing;
			}
.....
}

Maybe anybody see my mistake? This that code my character jumping all the time. Like move down per pixel, move back, move down and so on. This effect only ends if player is in falling state

PARTNERS