Looking for Random Hummingbird type Movement

floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

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. What I would like to do is give him a little life by creating small random movements when he is hovering. Sort of like a Humming bird. Especially when he is still, it might be cool if there were randomness in his flight path too but not necessary.

Any ideas of where to start? Like change attribute: self.positionx to game.clickx + random????

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    Here's a little demo, it's quicker to make than to explain, but basically move the object in a 'circle', but with all the values screwed up and compounded with more screwed up values, hope that makes sense (it makes no sense to me and I wrote it).

    File attached:

    Click somewhere on the screen.

  • SocksSocks London, UK.Member Posts: 12,822

    @floatingwoo said:

    it might be cool if there were randomness in his flight path too but not necessary.

    Here's a version (file attached) with more randomness in the flight path (the move between the current position and the clicked position).

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Socks I always like how much "life" your creations seem to have. :D

    Do you mind if I use this for the last page of my book when it's published?

    hope that makes sense (it makes no sense to me and I wrote it).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • SocksSocks London, UK.Member Posts: 12,822

    @tatiang said:
    Socks I always like how much "life" your creations seem to have. :D

    If by 'life' you mean 'sine wave', then yes :smiley:

    Do you mind if I use this for the last page of my book when it's published?

    Lol :smile:

  • SocksSocks London, UK.Member Posts: 12,822

    To increase or decrease the amount of randomness in the flight path . . . (using the 2nd demo "Humming Bird2.zip") . . .

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    @Socks said:
    If by 'life' you mean 'sine wave', then yes :smiley:

    Same thing, what is life other than a sine wave?

    Follow us: Twitter - Website

  • HopscotchHopscotch Member, PRO Posts: 2,782
  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @Hopscotch said:
    I think Socks needs to get out more. :)

    What is this 'out' ? Sounds good, can you get it delivered to your home ?

  • SocksSocks London, UK.Member Posts: 12,822

    @AlchimiaStudios said:
    Same thing, what is life other than a sine wave?

    A cosine wave ?

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @Socks said:
    A cosine wave ?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @Socks said:
    What is this 'out' ? Sounds good, can you get it delivered to your home ?

    You can but you have to be there to sine for it.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @tatiang said:
    You can but you have to be there to sine for it.

    ... cos it's not free!

    @tatiang, you missed that :D

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Sorry for all the tangents. We're happy to help if you have other questions!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    You can but you have to be there to sine for it.

    Just don't drop it on the floor, it may contain a log, probably 10 of them.

    @tatiang said:

    Sorry for all the tangents. We're happy to help if you have other questions!

    Ooo now that's good, hard to tell if intentional or just being a mod()

    Follow us: Twitter - Website

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

    Thanks guys, much more than I expected . You rock!!!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Wow, you guys are much better at this than me. Are they just random() things that pop into your mind??

  • floatingwoofloatingwoo Los Angeles, Calif.Member Posts: 393

    That demo made me laugh, thats funny looking on it's own!

  • Village IdiotVillage Idiot Member, PRO Posts: 486

    Can someone help me adjust the hummingbird example for touch? Sorry if that sounds dumb - but I'm new to all of this and its hard for me..

  • SocksSocks London, UK.Member Posts: 12,822

    @monkeyboy simian said:

    Can someone help me adjust the hummingbird example for touch?

    It works with touch as it is.

  • Village IdiotVillage Idiot Member, PRO Posts: 486

    oh - I thought that you had to change those bits depending on what platform you intend publishing to.. Does that all get converted through GS automatically when you publish? It's just that all of those references to click and mouse make me think that it's meant for a desktop.

  • SocksSocks London, UK.Member Posts: 12,822

    @monkeyboy simian said:
    . . . all of those references to click and mouse make me think that it's meant for a desktop.

    Mouse click = touch on a tablet.

  • Village IdiotVillage Idiot Member, PRO Posts: 486

    so I can just use those click and mouse settings and GS understands that it needs to be converted when being published for tablet/phone etc?

  • SocksSocks London, UK.Member Posts: 12,822

    @monkeyboy simian said:
    so I can just use those click and mouse settings and GS understands that it needs to be converted when being published for tablet/phone etc?

    Converted to what ?

  • Village IdiotVillage Idiot Member, PRO Posts: 486

    It seems to me that GS can accept any input and at the time of publishing, make it work on whatever device that you designate? Is this true? Sorry if I sound remedial - but I think I am.. I am trying though.

  • Village IdiotVillage Idiot Member, PRO Posts: 486

    Have I annoyed you? Sorry if I did.

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2015

    @monkeyboy simian said:
    Have I annoyed you? Sorry if I did.

    What ?!?

    P.S. if you just post in a thread without alerting the person your post is aimed at they are very very unlikely to see your post. Think of it like picking your phone up and starting to talk in the hope that maybe, somehow, the right person will hear you ! :smile: In the same way that you need to dial an actual number, you need to notify someone that you are attempting to talk to them. Otherwise you are relying on someone just happening to spot that there's been a reply in a thread they posted in days/weeks/months ago, a little like replying on the person you want to speak to on the phone just happening to wonder passed ! :wink:

Sign In or Register to comment.