Game Development Community

Slopes in Platformer

by James Petruzzi · in Torque Game Builder · 09/18/2006 (4:25 pm) · 3 replies

Hey guys. just finished going through the little tutorial for platformer at tdn. the one thing i have no idea how to do (nor did it leave me with any idea how to do it) was slopes, or diagonal platforms. i searched around and saw people mentioning this, but i havent found any solutions. could someone please show me a code example or explain how it would be done? i'd rather not reinvent the wheel this early in the game.

thanks!

#1
09/18/2006 (6:19 pm)
Well in a project that I am working on, I am simply making diagonal tiles and adjusting the collision box to match the shape. Check out the tiles that came with the outdated platformer tutorial, it used diagonal tiles
#2
09/21/2006 (10:58 am)
i13.photobucket.com/albums/a252/seafrench/collisionRamps.gif
Load in your brush the same way you did with the square tiles in the tutorial. Make sure collision is selected. Click on the image to place your first point for you collision area - the green outlined around the box should vanish. drop a second point to create a line by clicking in another location on the image. click a few more times if you'd like to get a feel for how the collision drawing works. To remove a point right click its approximate location. To drag a point left click, hold and drag to where you would like the point to be dropped at. If you are trying to get the point in the corner make sure you get it in there all the way... you may have to grab it and shove it in there a few times.


i13.photobucket.com/albums/a252/seafrench/collisionRamps2.gif
#3
09/21/2006 (11:16 am)
You can always check *your_game"/managed/brushes.cs

to make sure that the coordinates of your collision area aren't funky. Just locate the block of code for the brush in question and take notice of the values stored for the collisionpoly variable. If all your points are in corners they should all be ones and negative ones.