When pressed actor make the other actor move to a position

henduhendu Member Posts: 8
edited January 2012 in Working with GS (Mac)
Hi

I was wondering if anybody knows how hen pressed actor make the other actor move to a position.

So you press actor 1 and then actor actor 2 moves to a location all the time

Comments

  • henduhendu Member Posts: 8
    any suggestions
  • henduhendu Member Posts: 8
    if this helps i want actor 2 to move instantly
  • MotherHooseMotherHoose Member Posts: 2,456
    you have to have both actors in screenEditor

    in actor1's behaviors (unlocked):
    Rule: when touch is pressed
    --changeAttribute: [expression] click: Current Scene > layer > actor2'sLayer > actor2 > Position > X To: where you want
    --changeAttribute: [expression] click: Current Scene > layer > actor2'sLayer > actor2 > Position > Y To: where you want
    the Expression will read: scene.Background.Actor 2.Position.X … depending on layer and name of Actor2


    MH
  • henduhendu Member Posts: 8
    Please can you put this in a demo or template for me please
  • henduhendu Member Posts: 8
    i really need some mega help please guys.

    what i am wanting is, when i press actor 1, actor 2 stop accelerating and moves to a location. when pressed play again actor 2 accelerates.
  • MotherHooseMotherHoose Member Posts: 2,456
    … simple 1 rule and 2 changeAttributes … the " > " represent a mouse click (5 clicks and enter a # for the where you want actor2)

    as you joined yesterday, you haven't allowed yourself any time to learn things.

    remember when you were a child and learned by playing ? … play around with GS Creator … click all the buttons, try all the behaviors, see what things do!
    think about how you can use those events/actions in building what you want.

    read: the Cookbook
    watch: Gamesalad Cookbook videos
    open all the demos/tutorials included with GS

    Enjoy yourself!

    MH
  • henduhendu Member Posts: 8
    yh, but i have been doing my game for a long time before i started. please do me a demo i have worked all day on this and not such luck. as i have said this is the first time i have setup the forum account because i did not need any help before
  • henduhendu Member Posts: 8
    Please i need some real help please.
  • henduhendu Member Posts: 8
    bump
  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    start a new project
    create two actors … leave them the white squares … drag both of them to the screenEditor (black rectangle on Right)

    on Actor 1
    click [Create Rule]
    in the Rule: when
    [Actor receives event] [Touch] is [pressed]

    -- drag in a Change Attribute behavior: click the […] in 1st Column click Current scene; 2nd Column click layers; 3rd Column click Background; 4th Column click Actor 2; 5th Column click Position; 6th Column click X … To: type in the X position you want … Example: 240

    -- drag in another Change Attribute behavior: click the […] in 1st Column click Current scene; 2nd Column click layers; 3rd Column click Background; 4th Column click Actor 2; 5th Column click Position; 6th Column click Y … To: type in the Y position you want … Example: 160

    that's it! … Preview and see it happen … then use it in your real Project.

    MH
Sign In or Register to comment.