Making a liquid game layer

as7494as7494 Member Posts: 70
edited November -1 in Working with GS (Mac)
Hello,

I want to ask you guys how its possible to create a sort of liquid layer in which i can add actors to interact with using Gamesalad. What I would like is a fixed volume that has similar physics to that of water, but Im not sure how this can be implemented. Thanks in advance for your help...

Comments

  • QbAnYtOQbAnYtO Member Posts: 523
    you can try reducing gravity (or add drag??)

    u mean when the actor is swimming (or walking) through water?
  • as7494as7494 Member Posts: 70
    yea i just want to make a visible liquid layer. You know the drinks applications on the iphone? Like i want to bea ble to see the actual liquid moving around and then being able to work around with it.
  • JCFordJCFord Member Posts: 785
    So a semi-transparent graphic that would be larger than the screen area and picking up on the angle of rotation of the device it would rotate the graphic to match? Is that what you mean?
  • as7494as7494 Member Posts: 70
    Yes, provided this semi-transparent contents similar physics (i.e. resistance) to that of water/liquid. I would like certain actors to be able to move inside of this "semi transparent graphic", however i wouldn't want it to necessarily rotate, but to react to acceleration of different objects inside of it.(Lets say we have a rock in this graphic, i want to be able to push the rock with an acceleration, causing the water to displace in this fixed volume.)
  • PhoticsPhotics Member Posts: 4,172
    as7494 said:
    I would like certain actors to be able to move inside of this "semi transparent graphic", however i wouldn't want it to necessarily rotate, but to react to acceleration of different objects inside of it.

    In The Unofficial Gamesalad Textbook, one of my physics examples explains how to slow down actors as they overlap or collide with a water actor.

    I'm not entirely sure if that's what you're looking for, but it's not hard to do with GameSalad. Basically, you alter the maximum speed attribute with a rule. When the main character actor overlaps the water actor, the main character can be slowed down.

    This idea could be expanded to work with accelerometer data.
  • as7494as7494 Member Posts: 70
    I get the physics part, but visually I'm not sure how I can make this transparent layer that shifts as if it's a liquid.
  • PhoticsPhotics Member Posts: 4,172
    as7494 said:
    I get the physics part, but visually I'm not sure how I can make this transparent layer that shifts as if it's a liquid.

    That's tricky. Maybe you can do it mathematically. You can certainly make a box that rotates based on the accelerometer data. So, how to expand on that? Maybe it can be accomplished with a combination of animation and accelerometer data. That would likely be very intensive though.

    I'm not sure what you're trying to do. I'm picturing an animated wave actor at the top of a transparent water actor. The wave would swoosh back and forth, based on accelerometer data. That should keep the performance optimal, while creating the effect of water sloshing around.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    To add to what Photics said. If you wanted to have say a pond thats the screen, then when you touch it is splashes, you could start by having animations to have the water just moving around in the wind so when you dont touch it, but your tilting the phone it still looks like a pond. Then you could have 3 seperate animations for touching a little touching more, and then touching alot to make the biggest splash. For the first one wherever touch is pressed you could spawn the first splash, and destroy right after the splash. Then when touch is pressed and then use a timer to determen how long its pressed do the other 2. Im sure theres alot more to this, but maybe that can get u started
  • as7494as7494 Member Posts: 70
    Thanks I'll try that out
This discussion has been closed.