How to make 2 (or more) objects have the same X and Y?

junioracsjunioracs Member Posts: 2
edited November -1 in Working with GS (Mac)
I need to move 2 objects around using the same X and Y values. How can I make this? Can anyone help me, please?

Comments

  • ColorplayGamesColorplayGames PRO Posts: 69
    I think that this page
    http://gamesalad.com/wiki/how_tos:gsc_follow_another_actor
    has what you're looking for.

    If I understand your question correctly, you need two actors to always have the same X/Y location values? Try making 2 game attributes, constrain those attributes to the first actor's X/Y position, then you can constrain the second actor's X/Y position to the game attributes.

    Hope that helps!
  • junioracsjunioracs Member Posts: 2
    That is what I'm talking about! But I still having a problem...
    That is the situation: I want to make a bus with a rectangle and 2 circles below it. I need this circles following the rectangle all the time, so I need the same X/Y values for all of them with just a little offset. Is that right? Even if the bus will do a "backflip", those circles should stay just below the rectangle. How can I solve this? Thanks for everyone.
  • synthesissynthesis Member Posts: 1,693
    One way is to do a bunch of constrains and algos to keep the wheels connected to the bus. Another way is to temporarily change the bus graphic to a graphic that includes wheels in it (which may require in game image height resizing)...when your new game attribute switch "busIsInTheAir"=true.

    Then when that value is true...change the bus tires to a transparent PNG.

    Then when game.busIsInTheAir = false...change the images back and continue.
    This would be the easiest and most efficient (for the game engine) to execute. Its a little "theater" magic and it may not be 100% authentic (ie tires wont spin) but it will work well I think. To add to the illusion...you might blur the tires a bit with rotational motion blur in Photoshop to help with the "image trick". If the bus' back flip is quick enough and the graphics are small enough...the gamer won't know the difference.

    Hope this might help you.
Sign In or Register to comment.