Slopes in Simple Physics

KGBlag

  • Posts: 35
Is there a way of pulling it off? I have a few ideas but I'd like to know if any of you already have an way of doing it. I know the ramps will have to be actors, if cave story was able to do it then I'm sure it can be pulled off somehow.

« Last Edit: January 04, 2019, 01:46:30 pm by KGBlag »

RosalinaGalaxer

  • Posts: 239
Shouldn't you be able to just make a sloped tile? Or am I misunderstanding the question?
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̯͍̓̇̾̎Ť̵̳̻̙̦̈́̅̓͆̚h̴̗̩̫͖̍͑̋̋͗͜͜e̴̻̰̔̂ ̷̢͈̖̏́b̸̘̻͖̣̙̍͒̆́a̶̺̗̟̿͒n̵̡̼̘̺̚ḙ̸̗̹̥̜͐͘͝ ̸̨̮̭̳̓͜ō̸̧͙̜̮̌͑f̴̜̒̔̆͊ ̵̪̹̱̪̌͘͝Y̸͔̪̽͠u̷̱̳̟͒̂̊͒̕͜ḿ̸̡̤͚̬̪ë̵̪͍̹͝k̶̝̣̗̞̹̖̅̊̅y̶̧̞̟̤͚̋̀̔o̴̯̾'̷̠̐̋͂̇̿̕s̴̡̬̲̠̰̦͗͂ ̴̢̘̤̝͆̀͘b̸̛͖̲͒̅̊̏͝o̶̘̮͊͐͗̇͠͝r̷̰͓͍̣̀̄d̷̢̞̂̚e̶͖̲̯̰̫̅̈͗r̸̢̒̊͜ͅ

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

KGBlag

  • Posts: 35
They only work in 2dbox

RosalinaGalaxer

  • Posts: 239
Really? Huh. The more you know, I guess.

Are you sure you need simple physics? What kind of game are you making, and for what platform?
Ģ̷̓l̴̥̒͑̕͝ì̷̘͈̬͈̖̂͂̔̕t̷͔͇̯̥̬̀̽̓͜͝c̵͇̦̼̮̉̐̈́̕͝ͅͅḣ̵̡̫̞͚̐̅ͅë̶̗̦̪̖͚̜́͊̄͑s̵̺̹̖̼̥̃.̴̮̫͐ ̶̛̯͍̓̇̾̎Ť̵̳̻̙̦̈́̅̓͆̚h̴̗̩̫͖̍͑̋̋͗͜͜e̴̻̰̔̂ ̷̢͈̖̏́b̸̘̻͖̣̙̍͒̆́a̶̺̗̟̿͒n̵̡̼̘̺̚ḙ̸̗̹̥̜͐͘͝ ̸̨̮̭̳̓͜ō̸̧͙̜̮̌͑f̴̜̒̔̆͊ ̵̪̹̱̪̌͘͝Y̸͔̪̽͠u̷̱̳̟͒̂̊͒̕͜ḿ̸̡̤͚̬̪ë̵̪͍̹͝k̶̝̣̗̞̹̖̅̊̅y̶̧̞̟̤͚̋̀̔o̴̯̾'̷̠̐̋͂̇̿̕s̴̡̬̲̠̰̦͗͂ ̴̢̘̤̝͆̀͘b̸̛͖̲͒̅̊̏͝o̶̘̮͊͐͗̇͠͝r̷̰͓͍̣̀̄d̷̢̞̂̚e̶͖̲̯̰̫̅̈͗r̸̢̒̊͜ͅ

“I have never seen a more heated discussion about context, jazz, and cats.” - VanillaButterz

KGBlag

  • Posts: 35
I prefer simple physics as of right now because it's what i'm comfortable with and 2dbox has a few problems regarding the physics like actors getting stuck on tiles and tile actors. Found a method that may work, something like this: https://www.youtube.com/watch?v=1r1rElIiWqw
Not sure if something like this could be pulled off or not though.

KGBlag

  • Posts: 35
I'm working on my own solution to this problem. Still rough but seems promising: http://www.stencyl.com/game/play/39847

Still, if anyone has any working methods that have proven to work I'm all ears.

JeffreyDriver

  • Posts: 2076
I'm working on my own solution to this problem. Still rough but seems promising: http://www.stencyl.com/game/play/39847

Still, if anyone has any working methods that have proven to work I'm all ears.

That's pretty good!It looks like the actor is actually walking upstairs.

I have one idea in mind, but I haven't properly thought it out, nevermind experimented with it.

But if you had the slope of tile stored in the tile data. For example if the data was 45, you could then grab that so you know to push the actor at 45 (or whatever) degrees rather than just horizontally.
Current Projects:
The Grand Grimoire Chronicles Episode 1 now on Kongregate!.
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

KGBlag

  • Posts: 35
Update: I've made progress I feel. I just wish the code itself was cleaner. Everything I do is kind of a ducktape style solution unfortunately. I'll try and clean it myself but if anyone is curious or have any butter solutions on how to write this mess I'd like to hear.

http://www.stencyl.com/game/play/39847

You can ignore the game attributes as I never used them outside of this actor. The collisions on the steps are exactly how they look.

ceosol

  • *
  • Posts: 2258
What I did was detect what tile was there (using tileset ID and tile ID). You already have that "if tile exists" boolean. Just check its tileID and if it is a ramp tile, add an x-speed to your character.

KGBlag

  • Posts: 35
Correct me if I'm wrong but I believe last time I checked simple physics does not allow for the use of sloped tiles. It reads them as blocks.

Update on that code btw. Still flawed but coming along. Might be ready to finish the collision on the ramp and upgrade from stairs to a proper slope. The test has been updated as well so feel free to play it. I'll post the code here. Again, the game attributes can be ignored as just attributes.

« Last Edit: January 06, 2019, 10:08:49 am by KGBlag »