Eye ball follow Mouse position looks like 3 eyed Fish from "Simsons"

floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393
edited January 2015 in Working with GS (Mac)

Ok, So I have a little "Flappy bird" like animated character that can be moved with a mouse click with Interpolation.

When attribute game.mouse.button is true

Change attribute:game .clickX to game.mouse .positonX
Change attribute:game .clickY to game.mouse .positonY

Interpolate attribute:self.position.X to game.clickX
Interpolate attribute:self.position.Y to game.clickY

And then I have my animations set up...

I have no gravity (accelerate) setup it's not like a side scrolling game.

In a previous post I asked for help with giving the little bird some random movements to make it more life-like and several of you were gracious enough to chime in and help, Thanks. (Socks, tatting,Braydon, et. all).

http://forums.gamesalad.com/discussion/76466/looking-for-random-hummingbird-type-movement#latest

I had failed to mention that I gave the bird 2 eye balls that are constrained to an X,Y position on the bird and rotate to position following game mouse position X, Y.

Now, with the random (humming bird) movements when the bird completes its movement to where the mouse has been clicked the eyeballs (as one would expect) jump all over the place looking much like the 3 eyed fish from the Simpsons. My kids think this is hilarious, but it was not quite what I was going for.

I know that I need to drop the code that is creating the random movements to the bird into the eye balls as well. I'm thinking in a constrain attribute self.position.X and Y to scene.background.player.positionX and Y...and here maybe drop in+ the attributes used on the bird position to give random movements.

I've tried it several ways now and it's getting all messed up. I'm sure there is much more going on than I'm hip to. So to be clear my question is how can I drop the random movements that I have on the bird on to the eyeballs so that they move with the bird and stay where they should?

Comments

Sign In or Register to comment.