Help with looping movement

spikeyfish2spikeyfish2 Member Posts: 1
edited November -1 in Working with GS (Mac)
I've pretty much made my complete game (the first 5 levels of), but in subsequent levels, I need something to move around the screen. Basically the movement involves:

- Moving left to the left side of the screen
- Rotating towards the opposite way
- Moving right to the right side of the screen
- Rotating towards the left side
- *loop above*

I just can't find a way to do it. I've set rules to see where on the screen, and which direction the actor is, but the behaviors just don't seem to run inside (the "otherwise" ones do, though).

Any ideas?

Thanks :)

Comments

  • DreamLabDreamLab Member Posts: 2,127
    I'm not the best at GS or anywhere close but you could do
    Set 2 actors on each side of the screen(make them invisible)
    Put once the actor(character thing) hits the actor on the right side turn left and go left. And the same for the left side. Or use the interpolate behavior. Again I am probably not the person to answer this question.
    DL
  • FranzKellerFranzKeller Member Posts: 517
    you might be able to use the "every 10 seconds..." type rules in creative way to automate this type of thing... think it out carefully

    in a way, GS itself is a Puzzle game. ;-) You know what you want, you have to figure "how to do it".
  • AjBlueAjBlue Member Posts: 215
    rule when boolean1 is true move to position x and y. rule when actor = position x and y, make boolean1 false, change attribute self rotation to opposite direction, interpolate. rule when actor rotation = opposite direction move to x and y on right side of screen. rule when self x and y = x and y or rightside, make boolean1 true. * you are going to want to give the boolean a checkmark in the attribute screen so its starts as true.

    then if you want to make the actor have better performance in the game depending on what you do with him you can give it an interpolate instead of move to, so physics don't have to be used.

    good luck with your game.

    AjBlue
  • AjBlueAjBlue Member Posts: 215
Sign In or Register to comment.