I must be really stupid! Moving Left then Right

DanielADanielA Member Posts: 101
edited November -1 in Working with GS (Mac)
Ok im stumped. I bet theres an easy way to do this but i dont know how.
IF Actor 1 hits Actor2 Move right. IF Actor 1 hits Actor2 Move left. EXT! So if Actor1 hits Actor2 go the opposite directions and so on. But Actor1 is going to keep hitting Actor2.

I have tried a few things like.
1st tried this:
Atributes: "Actors1 Direction"
Actor1: Rule if "Actors1 Direction" = 0 Move Right at 100,
Rule if "Actors1 Direction" = 1 Move Left at 100,
Rule if Actor1 Collides with Actor2 and "Actors1 Direction" = 0 then change "Actors1 Direction" to 1.
And so on i have tried lots of these ideas.

I just cant figure this "thing" out for some reason. Please help with a detailed response haha
Thanks BadAsApps :)

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi Daniel; bit confused here: which Actor out of the two is mouse/touch controlled? Or have you got it that pressing/touching a button toggles between them for user control?

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

  • design219design219 Member Posts: 2,273
    gyroscope said:
    bit confused here

    Me too.

    Can you describe the action you want to happen (leaving out your behaviors/code)?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    By the way, Daniel, no way are you stupid! Lack of knowledge and/or experience isn't a lack of intelligence (although there's a few people about who'll say it is); don'na worry about it!

    :-)

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

  • DanielADanielA Member Posts: 101
    Haha thanks @GyroScope. OK so what i want to happen is there are 2 walls on the left side of the screen and on the right side of the screen. I want my Actor to walk into one and change direction till he walks into another one then change direction again. I just want my actor to keep going back and forth from ech wall. I want this all to happen with out me doing anything.

    He will walk into walls kinda like this HAHA!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Over 16 million hits...good ol' Bizkit, he deserves it!

    There are two wiki entries which will help you out. The first is called "How do make an actor pace back and forth?" That's here:

    http://gamesalad.com/wiki/how_tos:gsc_pacing

    In that article is a link to Directional Animation, if you need it.

    Sure it'll work out as you want after running through those!

    :-)

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

  • DanielADanielA Member Posts: 101
    Thanks Gyroscope!
    I really dont understand how u found that. Im always asking questions on the forums and then they show me a wiki for exactly what i need. Where in the Wiki does it show all of these lessons?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    No probs to find: on the GameSalad main page is a menu at the top, and the last item is called Support. You'll find a fair bit of stuff there.

    In case you don't know: there are game templates from other members by clicking Shared Projects, in the dialog that first opens with the GS prog (although it's down again for maintenance at the moment). Also, if you click on Profiles – also on the GameSalad home page – then Browse, there are quite a few games there from other members; many allowing you to download the GS game file, for you to study/emulate/learn from.

    I'm certain these'll help you out.

    :-)

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

  • DanielADanielA Member Posts: 101
    Ok thanks for the info!
    One more questions :/
    Have any ideas or way to check that if the actor touches a wall and then touches the next wall in less then 1 second something happens.
    Sorry for all the questions
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    DanielA said:
    Sorry for all the questions

    No probs, Daniel; that's what the Forum's for, as they say! (Or someone says...)

    As it's getting on for quarter to one in the morning here in the UK, I'm feeling a bit weary so can't quite work it out exactly, but here are a few thoughts off the top of my head:

    Firstly, it's best to make your two walls as two seperate Actors. Make two boolean game or scene attributes, called HitW1 + HitW2, for an example.

    When the first wall is hit, make HitW1 true, the other false. Vice verse for the other wall. A timer will be involved as well, as an attribute, counting the fractions of a second, triggered to count from 0 when the first wall is encountered, stopping it when the second wall is hit; another Rules that says if Timer attribute <1, then the something happens.

    Sorry I can't be more helpful at the moment, i'm about to fall off of my chair with tiredness! (I'll still be making myself one last cup of tea, though...)

    ;-)

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

  • DanielADanielA Member Posts: 101
    I don't think you are awake right know haha (If so good night).
    Thats a good idea and i have thought of a few things like that idea but theres a few problems. The walls have to be the same actor... What im trying to make in this game is a computer controlled person walk back and forth and you move the walls till he is trapped, and hits both walls in under a second. I don't want to give out to much detail of the gameplay because as much as i would like to trust everyone on the forums i cant. (and its not even that good of an idea)
    I can obviously trust you so If im not making enough sense please email me at Davnieli@gmail.com.
    Thanks for all the help Gyroscope
    Daniel/BadAsApps
Sign In or Register to comment.