Platform Game - Beginner help

Monkey Forums/Monkey Programming/Platform Game - Beginner help

darky000(Posted 2013) [#1]
Hello,

I have been trying out different tile-based games and I'm now confident to move on and try platform genre. I've been reading documents and theories of it but haven't been able to grasp how to code it from scratch.

My question is:

1. How do I get to map them?
2. How to implement objects outside the camera boundary?
3. How to move the camera?

If you know any basic platform codes out there to guide me that would help me tremendously. Thanks.


therevills(Posted 2013) [#2]
There is a platformer example in Diddy if you want to look, it does use line-casting which is pretty advance way of doing to collisions. You can see it running here: http://www.monkeycoder.co.nz/Community/topics.php?forum=1047&app_id=47

And some simple code here: http://www.monkeycoder.co.nz/Community/posts.php?topic=449

1. Normally you would either create a tile map editor yourself (basically use arrays) and save to a file or use a 3rd party editor such as Tiled: http://sourceforge.net/projects/tiled/
2. Say your camera is pointing at 100,100 on your map, you just create your object at 150,100 and when you scroll (normally with an offset) it moves all the objects
3. See 2 ;) You don't move the camera, you move the objects :P


darky000(Posted 2013) [#3]
Thanks therevills! I've tried your game and I'm already that excited to try coding it myself. Thanks for your basic ball platform game code and the tiled source too. This would definitely jumpstart me. Time to hit the studydesk... oh bump. :|

I always thought there's a camera that moves and not the objects. Thanks for the clarifications.


Gerry Quinn(Posted 2013) [#4]
I guess it's a matter of taste which you consider to be moving, so long as they move relatively...