Help! Bouncing head behavior

earthsdefect

  • Posts: 10
Hello I'm new to programing. I need some help programing a bouncing head movement for my 2d platformer. Like one of those bouncing head toys. I want my sprite to have lots of free head movement, like you have something really heavy on your head and it's making you unstable as you walk forward or backwards jump land etc..

Any help would be greatly appreciated.  :)

earthsdefect

  • Posts: 10
Could this be achieved by animations alone?

t4u

  • Posts: 418
The question is too big. Show on example what result you want ot achieve.
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

tigerteeth

  • Posts: 733
No it couldn't be achieved by animation alone.

It's pretty complicated. You'd need to learn how to use the joints extension. http://community.stencyl.com/index.php?topic=31947.0

earthsdefect

  • Posts: 10
No it couldn't be achieved by animation alone.

It's pretty complicated. You'd need to learn how to use the joints extension. http://community.stencyl.com/index.php?topic=31947.0
Thanks tigerteeth I'll have a look into this. The rag doll kinda physics for his head as he moves or jumps around is what I'm after.

earthsdefect

  • Posts: 10
The question is too big. Show on example what result you want ot achieve.


There are no games I can find with a example of the head movement I want to achieve.


There is this.. "shaking head toys" on YouTube
https://youtu.be/6IckRUN71_s

Example.
Image you have a really heavy helmet on your head and it makes you unstable as you walk backwards or forwards..  If you were to run forwards the wight of your head because it's so heavy would carry you forward to almost the point of face planting the ground. Lol

t4u

  • Posts: 418
I would make it like this:
- If I run my head gets rotated to 45 degrees
- once I slow down based on how fast I run I trigger rotation around normal position firstly it rotates head with big speed and big angle but after some timew rotation speed slows down and rotates for smaller angle
- At some point it returns to normal position

The topic is not easy and depends on what you want to achieve. Im not interested in guessing what you want to accomplish.
USE PICTURES WHEN YOU ASK SOMETHING!
If I helped you be sure to mention it in your game.

Tutorials + downloads:
http://t4upl.blogspot.com/

merrak

  • *
  • Posts: 2738
I wonder if it would be simpler to attach an invisible box, slightly larger than the head, to the body, and have the head bounce in the box. You could then make the box stretch and compress according to the actor's velocities, as well as rotate with the actor (if the actor can rotate, that is).