Help with swimming game

worminaterworminater Member Posts: 4
edited November -1 in Working with GS (Mac)
I am making a game with similar style to Dolphin Olympics http://izismile.com/2009/01/05/dolphin_olympics_2.html
where the dolphin goes out of the water and depending on the angle of when it hits the water, gains more speed or loses speed. How could I do this in GameSalad?

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    As a rough something to play around with you could change velocity based on the angle you enter the water at.

    i.e. If your dolphin starts off parallel to the water you could have rules like;

    If self.rotation > x
    and
    if self.rotation < y

    Change Velocity to x

    You would just need to figure out the angles you wanted to put in

    I havent tried this but its something you could play around with
  • RHRH Member Posts: 1,079
    Yeh, i would suggest something like beefy_clyro said. Although I would make a very thin actor that rests at the top of the water and when it overlaps or collides and self.motion.Y is < 0, depending on the angle, speed up or slow down the angular velocity.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Ah yes, as RH pointed out, you'll need an invisible actor sat just above the water
  • worminaterworminater Member Posts: 4
    the thing is the angle is constantly changing. for example the character could go straight down at a 270 degree angle, or it might have to enter at say a 330 degree angle in order to maintain the momentum, so how could I tell GameSalad to detect the proper angle needed to maintain momentum?
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    You would have to figure out the maths. i.e. if angle is between 200 and 300 change velocity to ....

    If angle is between 100 and 199 change velocity to ...

    etc etc
  • RHRH Member Posts: 1,079
    I don't know how old you are so don't take this in a patronising way, but if your maths is quite good I'm sure you could come up with a formula to calculate the increase/decrease in velocity using cos, sin and tan, and some other maths I'm sure. I might have a little play with it later because, for some reason, i find figuring stuff like that out quite satisfying :?

    For now though, I have to work.
  • worminaterworminater Member Posts: 4
    thanks im only in algebra 2 but were basically doing pre calc now...i know some decent trig but i just wish you could use radian measures since im so used to it that i hardly remember degrees. ill work at it and if u figure out a good way to do it let me know
Sign In or Register to comment.