The Daily Click ::. Forums ::. Klik Coding Help ::. Platform Game Sliding
 

Post Reply  Post Oekaki 
 

Posted By Message

Logiq



Registered
  09/04/2007
Points
  120
19th September, 2008 at 20:13:29 -

As you can tell from the title I am working on a platform game. I'm getting pretty close to making all of the movements I planned for the game. I am having trouble with one such movement.

I would like to have my player slide down surfaces that are bigger than a 45 degree angle. What would be the best way of accomplishing this goal? Thanks in advance for any help.

 
Hello guys! I'm New! -- I've been new for a year now...haha

Logiq



Registered
  09/04/2007
Points
  120
20th September, 2008 at 14:06:53 -

Okay so my first attempt didn't work out like I wanted it to. I tried making 2 detectors that if the player was standing on the ground and one of the detectors was overlapping an obstacle then to make the player slide. but that did work at all.

 
Hello guys! I'm New! -- I've been new for a year now...haha

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
20th September, 2008 at 14:19:04 -

If you have your gravity built correctly, you could just have the X position set in a similar fashion as the Y, depending on the slope angle. I suppose you could just have an object (invisible, of course) overlap the slope, and program the movement for each angle. I dunno, it's what popped in my head. I'll think about it for a bit.

 

  		
  		

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
20th September, 2008 at 15:02:15 -

You can make two detectors for feet... and then compare the angle of both when on a slope slide it.

 
Code me a sausage!

Logiq



Registered
  09/04/2007
Points
  120
20th September, 2008 at 15:03:53 -

So I did it I made 3 detectors one to detect the slope, and two detects to find out whether the player should be sliding left or right. I originally found that if I used one detector (the slope one) it would trigger a slide if he just walked far enough towards the edge of a flat surface.

 
Hello guys! I'm New! -- I've been new for a year now...haha

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
20th September, 2008 at 15:05:14 -

Image

 
Code me a sausage!

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
20th September, 2008 at 15:06:39 -

lol, well i guess my sketchy drawing didn't helped u much now.

 
Code me a sausage!

Logiq



Registered
  09/04/2007
Points
  120
20th September, 2008 at 15:44:46 -

I do like that method. I might try it and see if it works better than mine. I'll let you know later as I'm off to the gym.

 
Hello guys! I'm New! -- I've been new for a year now...haha
   

Post Reply



 



Advertisement

Worth A Click