The Daily Click ::. Forums ::. Klik Coding Help ::. My fastloop platform engine can't handle ramps
 

Post Reply  Post Oekaki 
 

Posted By Message

aphant



Registered
  18/05/2008
Points
  1242
16th June, 2008 at 10:46:26 -

I followed David Newton's fastloop platform engine tutorial to assist in the creation of my platform movement, but one thing it can't do is go up ramps. If the player hits a single pixel that juts from the flat platform (flatform?), then they stop. Another thing about it is that going down ramps kind of makes it behave like a ball going down steps.

The only thing I have to make ramps traversable only works on a specific slope (up 1, over 3), and there technically isn't any sort of friction; It really just makes any ramp an air lift of sorts, as long as you're going upwards. Going down ramps behaves as mentioned above. My method also uses 5 additional detectors which seems like 5 too many.

Anybody know a better way of doing ramps?

 

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
16th June, 2008 at 11:06:44 -

I don't know how David Newton's engine works but I imagine you need 4 new loops that moves the player up and right, up and left, down and right and down and left whenever dealing with a slope.
You might need 4 detectors for this two below the floor and two directly above the other two.

 
.

Roseweave



Registered
  31/07/2007
Points
  341
16th June, 2008 at 12:38:26 -

Have you considered using the Platform Movement object? It's quite customisable.

 
Check out my Telekinesis'em'up Thread and the ALICE Machines -

http://www.create-games.com/project.asp?id=1213

"Did you know there's a million bucks hidden in the house next door?"
"But there is no house next door?"
"No? Then let's go build one!"

aphant



Registered
  18/05/2008
Points
  1242
16th June, 2008 at 12:57:19 -

I did try playing with the platform movement object awhile back, but all it seemed to do was make the player float.

I'll have to try that, Andyman. If I'm interpreting what you said correctly, then I may actually be able to do it using only two or three detectors.

 

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
16th June, 2008 at 13:56:15 -

Fastloop movement... so you're checking collisions between the object and the background one pixel movement at a time, correct?

So for going up slopes, you simply adjust the horizontal movement loop. Something like this:

- Move the object one pixel to the right, and check for collisions.
No collision? Let it stay.
Collision? Then...
- Move the object one pixel up, and check for collisions.
No collision? It's just moved up a slope. Let it stay.
Collision? Then...
- Move the object one pixel down and one pixel to the left. It just hit a wall.

...and if you want a working example (and are using MMF 1.5 or above), you can check out this:
http://www.create-games.com/download.asp?id=6764

Going down slopes can be a little more tricky, I'm afraid...

 
Go Moon!

aphant



Registered
  18/05/2008
Points
  1242
17th June, 2008 at 07:30:04 -

That example works well, Fifth. The only problem with it is that player's box-shaped object can't go up anything larger than 1 pixel. But, I know a way to fix this so it's not a big problem.

Thanks!

 
   

Post Reply



 



Advertisement

Worth A Click