Moving Actor Randomly

PixcelPixcel Member Posts: 5
edited March 2012 in Working with GS (Mac)
Hello,

I'm new to the forum and was hoping to get some help since I'm new to GS. Hopefully, once I know GS better I'll be able to contribute to the forums by helping others too.

Anyway, what I'm having trouble with is getting an enemy to move randomly back and forth along a single axis.

I'm looking for movement similar to the enemy dropping bombs seen in the video below


This is the only thing left that may game needs and for some reason I can't figure out this seemingly simple problem.

I really appreciate any help anyone maybe able to provide.

Thank you

Comments

  • POMPOM Member Posts: 2,599
    In your "throwing bombs actor" make 2 rules :
    1)
    Timer every 0.5 sec
    Interpolate self.position.X TO random(40,440) (or whatever values you want)
    Duration 0.5

    2)
    Timer every 0.3 sec (again or whatever value you want)
    Spawn bomb .

    Photobucket Roy
  • PixcelPixcel Member Posts: 5
    edited March 2012
    Thank you so much. I was actually pretty close to what you had. I just wasn't using interpolate, but something else. Interpolate fixed it perfectly.

    I already had the bombs working. They increase in frequency and randomly spawn "special" bombs based on how high the player's score is. It was just the movement part I couldn't get working correctly. Again, thank you so much.
Sign In or Register to comment.