Make actor move in random direction

I'm working on a version of the classic pong-game.
I simply want the ball to begin moving in a random direction at the beginning of each round.

I've tried using the "move"-commando and setting it to random(0,360) but this apparently doesn't work. How do I solve this?

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    Hi @OlympusMons and welcome to the GS Forums.

    You're almost there... you need to separate obtaining the random angle from the Move behaviour. So make an attribute, angle or integer, let's call it RandAngle

    Change Attribute randAngle to random(0,359)
    
    Move behaviour: direction: scene.randAngle
    

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

Sign In or Register to comment.