Non-Tile Based 2d Side Scroller

Post: #1
Hey guys,

Me and my friends have been working on a game for a while now, and we've been running into alot of problems

the game we're making uses 1 big image as a the level background image, and we use a Black and White picture to do the collision detection all this is is working now.

However our character is 64*64 and only one point of the image collides with the Collision Data (Black and White Images) how do I get the bitmap to be recognized as 64*64 rather than just 1 pixel at the top left hand corner.

I am using wxWidgets as our FrameWork. I am willing to post the code however you need to have wxWidgets installed with Visual Studio

We are running into a corner and we're thinking of starting over, and do a simple tile based game. Sad

Quote this message in a reply
Posts: 613
Joined: 2004.09
Post: #2
I dont know what your code looks like but it sounds like you are shooting for a single pixel rather then the width of the object. There are a number of ways to detect collision for an entire object. It depends on how to set things up, if you only need basic detection you can set four points on on the top, bottom, left and right and test for collision or you can create a bounding sphere and detect for hits on that.

All depends on how you set up you system in the first place.

Kyle Richter
Twitter: @kylerichter
Quote this message in a reply
Post: #3
we tried the bounding box method, we created 2 rectangles 1 for the player and 1 for the enemy.

and we check whether the rectangle intesect if they do we make them stop moving but that didn't seem to work.

so now we are using the code from this link

and we also ran into another problem.

the thing is we are very new to object oriented and we were kinda forced to write a whole game based on object oriented from the ground up. so now we're kinda stuck.
Quote this message in a reply
Posts: 469
Joined: 2002.10
Post: #4
wxWidgets... Ugh. You are better off going SDL.

If you are trying to do collision of two silhouettes, you're going to have a hell of a time with that. You are better off doing bounding boxes and circles. Code is readily available on the net.

15.4" MacBook Pro revA
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  inapp purchase server side sefiroths 0 4,274 Sep 28, 2012 08:47 AM
Last Post: sefiroths
  Side-Scrolling pchukwura 7 14,350 Dec 27, 2010 10:14 AM
Last Post: pchukwura
  Tile Based Map Arrays for Collision Detection paulkite 4 7,252 Oct 27, 2004 12:02 PM
Last Post: KiroNeem
  Slopes in Side-Scrollers Bachus 8 11,883 Jun 5, 2002 08:06 PM
Last Post: Unregistered
  Beginner, 2D side scroller Why37 2 7,619 Apr 26, 2002 10:40 PM
Last Post: Why37