The Daily Click ::. Forums ::. Klik Coding Help ::. Camera & Boundaries
 

Post Reply  Post Oekaki 
 

Posted By Message

Tokinsom



Registered
  22/11/2009
Points
  25
13th March, 2010 at 20:14:01 -

I'm trying to make a camera that is similar to Metroid / Megaman X, and other platformers.

Basically, the camera follows the player through the level, but there are boundaries that keep the camera from going "off track" (too far past the floor or ceiling or wall, revealing empty parts of the level)

The camera I've made almost achieves this, but I'm having a few problems with it; mainly when switching from a horizontal path to a vertical path. I've made a video demonstrating my current camera and it's issues. I also uploaded the code.

VID: http://www.youtube.com/watch?v=X_VzFRQ_dGY
CODE: http://i369.photobucket.com/albums/oo136/4Sweet2Leaf0/CamCode.jpg

So yeah, I'd like to know if I'm even doing this right, and if so, how to fix the bugs. If not, could someone lend a hand? Any help would be great. I've been trying to figure this out for OVER A YEAR, compensating with crappy cameras in various games of mine. Thanks

 
n/a

Solgryn

Solgryn dot org

Registered
  20/12/2008
Points
  12572

GOTW Winner!VIP MemberWii OwnerIt's-a me, Mario!The Cake is a LieGOTM 2ND PLACE! - APRIL 2009GOTM 2ND PLACE - JUNE 2009PS3 OwnerKlikCast #15 Compo Winner!LOL Sign
You've Been Circy'd!GOTM WINNER - JANUARY 2010I am an April FoolGOTW MARCH 2010 WINNER!Santa Hat
13th March, 2010 at 23:15:27 -

Hmm, atleast I tried

Example =P:
http://www.solgryn.org/Stuff/Random/Cam.zip

Edited by Solgryn

 
www.Solgryn.org

Image

Tokinsom



Registered
  22/11/2009
Points
  25
14th March, 2010 at 00:24:37 -

Well thanks for trying, every bit counts. The camera in your example is exactly what I'm going for.

But seriously, I will compensate for anyone that can help me figure this out. Whether it be helping with your game or giving full credit or what have you. I've started on so many games that were never realized simply because I couldn't get this type of camera system going; It's a necessity. Thanks again

Edited by Tokinsom

 
n/a

aphant



Registered
  18/05/2008
Points
  1242
14th March, 2010 at 13:40:57 -

While the camera is following the player, it's movement will be jerky as it tries to be in two places at once. So, don't have the camera follow the player. Make the camera a separate object from the player, and just have it mimic the player's movements while colliding solely with the boundaries. If your screen size is 320x240, then make the camera a rectangle, sized 320x240. You'd also be able to reduce the number of boundaries you use.

 
   

Post Reply



 



Advertisement

Worth A Click