I’m working on a adventure/platform game and I want to be able to include a stage with slopes and inclines.
My game works fine with flat ground and walls. What I did was create htiboxes for my charcter and if collision was detected it would calculate the angle of collision and set the charcters X velocity or Y velocity to 0. However, this method doesnt work well with inclines and slopes for obvious reasons.
Does anyone know the proper way in dealing with this? BTW, I dont think it matters but I am using BitmapData for my stage and collision (aka no hitTest).
EDIT* I found a video that breifly shows an example of slope detection in action, however there is no explanation on it’s structure. http://www.youtube.com/watch?v=c9li34vNSrY (It’s about 2 minutes in)
well i havnt ever done this but ive seen it where the character has a small dot in frotn of him and im guessing that when the characte hits the ground it just rotates until it has the dot hit the ground but also you should try putting your left and right movement speeds into different variables for as it is now if you walk up to the wall your stuck. :party:
I’m pulling this out of the air based on the Fancy Pants video, but try it that when the right dot hits the ground, rotate the four dots upward using the left dot as the centre point, and when the left dot hits the ground rotate using the right dot as the centre point.
Well even though tonypa’s tutorials are extremely usefull and I’ve learned alot after reading it over (quite a few times) his examples dont cover my specific problem.
However I did find a tutorial that looks like will explain exactly what I need. (cant look at now)