Flying dragon or fish - front view... (the code behind it)

evertevert Member Posts: 266
edited January 2015 in Working with GS (Mac)

Hi there!

Some time ago @socks posted a flying carped and and dragon in the 'spare a code' topic.
(.gif of socks dragon below) I love what he made, but i'm looking further into it.
I'm looking how to make the same thing but from a frontal view.
If you have the dragon (like the one from below) but faced to the camera and the tale behind him. So you have a little perspective.

Socks image:

The view i'm looking for:

EDIT: i'm not looking for artwork, i'm looking for a way to create this kind of effect in game salad!

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2015

    Hi @evert Fine looking dragons.

    Asking for free stuff is not allowed here in the GSC Forums. Are you willing to pay an artist to draw what you want, if so how much? (I can't match the quality of the graphics you've shown - this info will be for other members).

    By the look of it, you need a series of graphics for animation frames.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • evertevert Member Posts: 266

    No i'm not looking for drawing or any form of artwork.
    I'm looking for the way this movement can be done like in the second link i posted

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2015

    I see, sorry for misunderstanding. Off the top of my head, the task needs to be broken down as follows:

    A static graphic following the touch (Google this to find out how - it's relatively straightforward - then an algorithm/equation ( which I can't think at the moment what that would be) for changing animation frames depending on relative position of the dragon to the touch.

    In fact, the more I think about it, I'm not certain this can be done in GSC... perhaps another member will prove me wrong... (as far as I can make out, your example is all done programmatically with code).

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • evertevert Member Posts: 266

    @gyroscope said:
    I see, sorry for misunderstanding. Off the top of my head, the task needs to be broken down as follows:

    A static graphic following the touch (Google this to find out how - it's relatively straightforward - then an algorithm/equation ( which I can't think at the moment what that would be) for changing animation frames depending on relative position of the dragon to the touch.

    In fact, the more I think about it, I'm not certain this can be done in GSC... perhaps another member will prove me wrong... (as far as I can make out, your example is all done programmatically with code).

    Its my fault, my text was not clear enough.. :)
    I think this should be possible with a few images maybe about 5, but i don't know how..
    maybe @Socks‌ or @tatiang‌ now how to do this?

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited January 2015

    Right, only about 5 images should be workable then - though of course it won't be smooth animation at all - be rather jumpy.

    Yes, I'm sure either @Socks or @tatian would/will be able to help... (even I could help here if I put my mind to it! :wink: though it takes me hours to wake up... :) )

    Another approach would be to have to have static images as segments and follow each other from the main dragon head which is following touch - but perhaps that's what you mean anyway - easy if we had joints...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ArmellineArmelline Member, PRO Posts: 5,369
    edited January 2015

    This is a very quick, rough attempt that shows it's entirely possible. I tried to keep the logic as simple as possible. With more complex logic to control the movement (to give it a more smooth feel when changing direction) it could be improved upon greatly. I'm sure @Socks will be in to show us how it's really done soon, this kind of thing is his bread and butter! I might spend some time improving it and dump it in my free stuff thread, if I remember.

    Each segment follows the touch location, with each one being slightly slower than the last. It's one prototype actor with 10 instances. The spawning of the instances could be automated easily, but I didn't bother to do that now.

    (The gif came out really badly, sorry. Apparently this kind of thing doesn't record to gif very well at all!)

  • evertevert Member Posts: 266

    @Armelline said:
    This is a very quick, rough attempt that shows it's entirely possible. I tried to keep the logic as simple as possible. With more complex logic to control the movement (to give it a more smooth feel when changing direction) it could be improved upon greatly. I'm sure Socks will be in to show us how it's really done soon, this kind of thing is his bread and butter! I might spend some time improving it and dump it in my free stuff thread, if I remember.

    Each segment follows the touch location, with each one being slightly slower than the last. It's one prototype actor with 10 instances. The spawning of the instances could be automated easily, but I didn't bother to do that now.

    (The gif came out really badly, sorry. Apparently this kind of thing doesn't record to gif very well at all!)

    wow this is just amazing! thank you very very much!

  • ArmellineArmelline Member, PRO Posts: 5,369

    @evert said:
    wow this is just amazing! thank you very very much!

    It will definitely need some real work before you can put it in a game but hopefully it gets you started! I'd recommend using a more reliable method of moving them than Move To... it can be really buggy.

  • ArmellineArmelline Member, PRO Posts: 5,369
    edited January 2015

    @evert

    Here's one that has more reliable movement. It's a little more difficult to understand and the formula needs work, but the result is definitely more responsive.

    Still doesn't translate very well to gif form...

    The delay in movement for each segment is really going to have to be individually defined to get just the right effect. Right now I'm just making the segments move slower the further back they are, which obviously isn't ideal.

  • evertevert Member Posts: 266

    @armelline this is exactly what i was looking for! how can i thank you more??
    If you are ever looking for graphics or artwork just let me know! thats the least i can do!

  • ArmellineArmelline Member, PRO Posts: 5,369
    edited January 2015

    @evert said:
    armelline this is exactly what i was looking for! how can i thank you more??
    If you are ever looking for graphics or artwork just let me know! thats the least i can do!

    You're welcome! Good luck with your game, and thanks for the offer - I may take you up on it one day :D

    I'd recommend adding a new real self attribute, called "Delay" or something like that. Replace all instances of "Segment No." in the logic with the new "Delay" attribute. Then go into each actor and adjust the delay until it's just right. That way you can have the tail segments move faster than the middle if you want, without losing track of which actor is which.

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

    @Armelline said:

    Nice, that's basically how I would have set it up too, throw in a couple of hours of fine tuning and artwork chopped up to work with it and it'll start to look nice and fluid, this question came up a while back, I posted basically the same thing, it uses a different equation which might also be useful:

    http://forums.gamesalad.com/discussion/72640/is-this-possible-in-gamesalad

  • evertevert Member Posts: 266

    Ah funny he used the same example as i did! great! I have time, i was just looking for the basics and i even got more. So perfect, now its time for me to make my game! :)

  • ArmellineArmelline Member, PRO Posts: 5,369

    @Socks hah I must have been a lot busier that day! I have no recollection of that thread at all :D

Sign In or Register to comment.