Engine (Solved)

Ozygiygas

  • Posts: 64

« Last Edit: September 22, 2019, 05:41:53 pm by Ozygiygas »

airman4

  • Posts: 875
are you french?

well you can download the jump and run extended kit and check the behaviors and see how it works.

Ryusui

  • Posts: 827
"Dilettante" is Italian in origin, and it's a perfectly legit English word. :P

You've got the basic idea right - being able to run up surfaces would probably involve tracking the character's speed. It might be possible to coax the built-in Box2D physics engine into doing the hard work, but for best results, it might be better to implement the exact physics yourself.

Personally, I'd recommend starting with the corkscrews from Sonic 2 - you don't have to implement the visual aspect, but a platform that's only solid while you're running at a certain speed would make a good proof-of-concept.

EDIT: Water-running would work the same way, come to think of it.

As for the famous loop-de-loops...personally, I'd set them up with a "trigger" region at the base of the ramp and simply take over the movement if the player is moving fast enough, rotating the sprite and moving it up and around the loop (this will take some trig!). Of course, if the player's speed drops below the threshold, then regular physics take hold again. The part I'm not sure about would be the "two-sided" aspect to the loop - obviously, there'd be another trigger at the apex of the loop which would "switch" the player to the opposite side, though I'm not sure how exactly to implement the switching.

Basically, it'd require a bit of setup, but it's all feasible in Stencyl, as far as I can imagine.

« Last Edit: April 18, 2012, 01:08:11 pm by Ryusui »
In the event of a firestorm, the salad bar will remain open.

airman4

  • Posts: 875
"Let me know if this is feasible"

^^


like "faisable" in french
nevermind
my bad dude.

« Last Edit: April 18, 2012, 01:01:17 pm by airman4 »

Ryusui

  • Posts: 827
I wasn't suggesting "rails" per se; you'd set a "gravity-defying stunt mode" flag or some such when the conditions are met, and instead of left and right moving the player left or right along the X axis, they'd instead move the player along a "stunt path" (okay, technically a rail), but you'd still be able to, say, jump or whatnot - this would disable the "gravity-defying stunt mode" flag just as slowing down would.

And yes, the default physics engine will rotate a sprite in conjunction with its collision box - if it lands on a slope, it'll rotate to match the box's resulting orientation.
In the event of a firestorm, the salad bar will remain open.

Ryusui

  • Posts: 827
As a side note, the jumping direction should be calculated as perpendicular to the "stunt path" - that way you can, for example, jump "backwards" off a wall instead of straight up, or jump to the ground from the apex of a loop.
In the event of a firestorm, the salad bar will remain open.

Rexasul

  • Posts: 147
The only problem I can see is the collision box of the loop/circle - I'd be interested to know how you could create a collision shape for what would essentially need to be an inverted circle. Anyone have any ideas or am I just being stupid?
my website |>>| shadowlabs.net

Hectate

  • *
  • Posts: 4645
I did a pretty good loop on a minigolf game (unreleased) once, and that was pure physics. With enough corners over multiple tiles or collision shapes (for an actor loop) you should have no trouble. For the "crossover" part, just switch the loop (or that part of it at least) once you go into stunt mode.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.