The Daily Click ::. Forums ::. Klik Coding Help ::. Custom Platform Problems
 

Post Reply  Post Oekaki 
 

Posted By Message

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
20th June, 2007 at 13:42:41 -

OK.... Before you all unanimously shout "NOOB!" I have never made a platformer so therefore needed a CPM. I have got a basic engine set-up now (jumping and left/right) but i cannot for the life of me get slopes working properly. i have got four detectors (top left bottom right) which can be set to any height/length if needed. I have had slopes working a little bit but it is nowhere near as smooth as i would like it to be. Any suggestions as to what I should do??? If slopes are a problem with custom engines i will just have t oscrap them but the way i see it someone MUST know how to create a smooth method. Please help.

 
n/a

Deleted User
20th June, 2007 at 14:02:40 -

A simple way would be to have two detectors on either side, at the bottom, then move the guy up if you're moving in a direction and the detector on that side is overlapping something but the detector on the other side isn't.

 

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14444

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
20th June, 2007 at 18:53:49 -

I used to make the main mask (or whatever you used for collisions) move up if it's in the ground and down if it's in the air. This worked quite well for ramps, so long as you turn it off when you're not jumping or falling. It interferes with the jump height.

 
.

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
22nd June, 2007 at 11:48:11 -

I have tried to set it so that when the bottom detector and the side detector are overlapping the background then set the y position of the player to y player+1 but this made the movement really jerky

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
23rd June, 2007 at 18:01:22 -

Ok. I'm all out of ideas now. I really need slopes for my game cos blocky platforms just don't cut it. If anyone can help then please do so.

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
23rd June, 2007 at 18:58:04 -

Thank you Phizzy. I dont remember you sending me an engine with slopes in but will look again. I will tray and implement this code later and let you know how it is going. I have posted a preview of the game (http://www.create-games.com/preview.asp?id=2879 ) if you would like to see how it is coming along.

Image Edited by the Author.

 
n/a

»xerus



Registered
  28/06/2002
Points
  675

You've Been Circy'd!Game of the Week Winner
23rd June, 2007 at 23:03:53 -

Is there a way to do slopes without using collision detectors? Like perhaps with the method that pushes the object around by 1 pixel to check for collisions?

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5690

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNER
24th June, 2007 at 01:01:11 -

you can still do slopes with the detectorless, 1-pixel fastloop push method. It's just a slightly more complex process.

Ordinarily, the object would use fastloops to move 1 pixel at a time, and if it detects a backdrop on its loop (in this case, the horizontal loop), it moves one pixel back and ceases movement.
To detect slopes, you instead have it, when detecting a backdrop, move one pixel up and check again. If there's nothing there, it remains, and will continue moving. If it detects backdrop, though, you move it one pixel back and one pixel down, and stop it. And that'll allow for up to 45° slopes, which is generally good enough.

...that IS the sort of method you mean, right?

 
Go Moon!

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
24th June, 2007 at 09:51:06 -

i is confuzzled by the detectorless method. please can you post some code for me in order to help me work it out??

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
24th June, 2007 at 11:08:21 -

ok i have put your code into my engine phizzy but it still isn't that smooth. the player seems to move in a jerky fashion all the way up the slope.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5690

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNER
24th June, 2007 at 16:41:49 -

I dunno, I think the detectorless way is pretty decent, as you can end up applying it to multiple objects at once.

I uploaded a little example, if you'd care to take a look. I just hope it's commented well enough (it's not something I normally do).

http://www.create-games.com/download.asp?id=6764

 
Go Moon!

»xerus



Registered
  28/06/2002
Points
  675

You've Been Circy'd!Game of the Week Winner
24th June, 2007 at 18:23:18 -

Yeah, I've been using a detectorless fastloop-less movement for my latest project (Bonesaw: The Game) and I've gotten really good results. The platform engine is just applied to Group.0, and then all the enemies and the player are just in that group, so everything obeys the same platform engine that I only had to code once.

Down the road I want to refine the engine and add slopes and some other things, and really get it working perfectly. Thanks a lot for the example, it'll definitely help me out ;D

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click