Platform Games. Collision ect

BlitzMax Forums/BlitzMax Beginners Area/Platform Games. Collision ect

DavidSimon(Posted 2007) [#1]
Can somebody share their ideas on the best way to make a character move on platforms?

Like Flimbo's Quest, Rastan, Ghouls & Ghosts ect.

I know how to use tilemapping and can make a tiny tilemap eg. single screen.

You know when you check what tile you are on in a tilemap editor, would it be the same checking for a player on a tile?

Please help me. tanx.


Dreamora(Posted 2007) [#2]
You would most likely not need anything like that.

Draw the tilemap data to a collision layer you do not clear (until screen change) including the type references of the tiles and only read collisions for the players and monsters.

Now you get the tiles you are colliding with directly as object array back from BM.
Extremely fast, powerfull and simple.


DavidSimon(Posted 2007) [#3]
I'm sorry but I don't understand what you mean.

How would i read collision?

If I check the position of my character how would I know that he is resting on a tile or falling?


tonyg(Posted 2007) [#4]
You might want to check this and this


DavidSimon(Posted 2007) [#5]
tanks. Will have a look at it.


SoggyP(Posted 2007) [#6]
Hello.

I have an on-topic question that hopefully someone can answer.

If I have a scrolling screen then my world is bigger than the visible screen. If I want collisions to take place off screen, eg, dropping a bomb down a mineshaft should I make my collision layer as big as the world, and if so what would be the memory impact of doing this?

Collisions with static objects are a pain but if there's no major impact in using collision layers, drawing my entire static world to the collision layer and only drawing the images to the visible screen would make things much simpler.

The world size I am thinking about is 16k*16k (that is 256*256 tiles of 64*64) an image of which size is pretty much going to kill the computer. But, if a collision layer of that size is feasible...?

Goodbye.


SoggyP(Posted 2007) [#7]
Hello.

Just bumping this to see if anyone has an answer.

Thanks.

Goodbye.

Jes


Perturbatio(Posted 2007) [#8]
Does it really need to be pixel perfect off screen?


SoggyP(Posted 2007) [#9]
Hello.

It might be. I'm just considering options and if I can manage all such collisions in one way, that'd keep things nice and simple, eh?

Goodbye.


Grey Alien(Posted 2007) [#10]
No way would I do it like that for a huge world. For Iron Fist, I didn't use a tilemap, each tile was a separate object. I just worked out each frame which tiles (objects) I needed to check for collisions with the character - this is super fast on modern PCs. I even just checked the ones immediately surrounding the character instead of all of the ones on (and off) the screen which would be lame.