Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Whirlpool gimmick


Godmaster

Recommended Posts

Hi folks,

I've tried many ways to make a different gimmick for a sonic game, a whirlpool that takes sonic into an orbit, forcing him to spin around, slowly pulling him inside and throwing him outside after a while. The image below explains better:

whirlpooll.png

I also tried to make that, but works like those sonic & knuckles bonus stage sparkling balls, that's not right for me.

Anyone have a good solution for making this whirlpool? i don't care if you use my idea in your game.

360-sonicengine.zip

Link to comment
Share on other sites

Are you using Game maker? If so try creating a path exactly as you want. And then set the speed based on some sort of entrance speed or something. Maybe create 8 or so paths if you want different entrance-exit points. (shoot sonic out at one of 8 random points maybe) Its sort of cheating, but it might work.

Everyone forgets about that path feature, and it can be a real time-saver, especially when dealing with some crazy "on rails" gimmick or simple AI.

Link to comment
Share on other sites

It's Gamer Maker, judging by the attachment. Anyway, you can try to use sin/cosine to get this effect. Or, you can do it a basic way.

I'm not sure how it would look in GM, but in MMF, it would go something like this.

IF
objA X is > ObjB X
     THEN sub 1 from objA X speed.

IF
objA X is < ObjB X
     THEN add 1 to objA X speed.

Same for Y.

IF
objA Y is > ObjB Y
     THEN sub 1 from objA Y speed.

IF
objA Y is < ObjB Y
     THEN add 1 to objA Y speed.

Link to comment
Share on other sites

Are you using Game maker? If so try creating a path exactly as you want. And then set the speed based on some sort of entrance speed or something. Maybe create 8 or so paths if you want different entrance-exit points. (shoot sonic out at one of 8 random points maybe) Its sort of cheating, but it might work.

Everyone forgets about that path feature, and it can be a real time-saver, especially when dealing with some crazy "on rails" gimmick or simple AI.

Actually the whirlpool pulls the player from any side, different of corkscrews, tubes and other stuff, and spins that around, like a twister pulling and throwing nearby things.

It's Gamer Maker, judging by the attachment. Anyway, you can try to use sin/cosine to get this effect. Or, you can do it a basic way.

I'm not sure how it would look in GM, but in MMF, it would go something like this.

Code:

IF

objA X is > ObjB X

THEN sub 1 from objA X speed.

IF

objA X is < ObjB X

THEN add 1 to objA X speed.

Same for Y.

Code:

IF

objA Y is > ObjB Y

THEN sub 1 from objA Y speed.

IF

objA Y is < ObjB Y

THEN add 1 to objA Y speed.

I've tried that before, that uses to only pull the object to itself. In the attachment I made out an almost perfect way that doesn't make the object orbit around the whirl.

Link to comment
Share on other sites

You aren't going to be able to force an orbit with this, but you can at least get some pendulum movement.

Step 1 - Gimmick is activated - Set well strength to 20

player velocity x += strength * cos (well X - player X)

player velocity y += strength * sin (well Y - player Y)

every frame, subtract like .25 from the well strength Deactivate the gimmick when the strength hits 0.

This will cause a gravity well effect that depending on how it is entered can cause things like linear oscillation or a full fledged orbit.

Obviously, the values used may need some adjustment. You might also want to force a rolling action or whatever depending on what kind of game you are making.

Bottom line though is that if it's done that way, it probably won't be too predictable.

Link to comment
Share on other sites

Actually the whirlpool pulls the player from any side, different of corkscrews, tubes and other stuff, and spins that around, like a twister pulling and throwing nearby things.

doesn't mean you cant use a path, just have the object move towards the center (or one of the path entrances possibly based on its direction). . If it gets close, then trigger one of the paths when it hits near or at that point. Finally, at the end of the path, set speed and direction based on the status of the object at the end of the path.

You could do this with code, or entirely D&D, its that simplistic.

Move towards point D&D to

pulls the player from any side

then use a path to

spin that around

Then set speed at the end of the spriral path to

throw nearby things

As far as I can tell, that does everything you explained to us. Its not very random at all, but its does what you explained.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...