random movement on the x axis only

gamedivisiongamedivision Member Posts: 807
edited November -1 in Working with GS (Mac)
as this character is walking i would like him to walk up and down on the x axis only, i have tried numerous ways but there seems to be problems,like as i'm walking towards the character and he is walking away he bounces off the edge of the screen,like he cant walk away from me while he's in camera view,i've already got him attacking me when i come within a certain distance .i've bought the game salad book,i want to use random movement,but when i use that he also tries to go upwards on the y axis,which looks a mess.any help thanks

Comments

  • AppsRacKAppsRacK Member Posts: 346
    constraint the y attribute of the actor and use random function in the x attribute (random min,max). If you want him to attack you, you can set an real attribute (like monsterA range) and do a rule if "monsterArange" = "monsterA.x - actor.x" do this .....

    i hope you get the idea im kinda new in Gamesalad as well but i think the logic behind it will be something like that. Wait a while some pros here can give you a detailed explanation.

    :)
Sign In or Register to comment.