bird flying help

Dazza006Dazza006 Member Posts: 248
edited July 2012 in Working with GS (PC)
Hi,
I'm trying to find the best way for getting a bird to fly right to left continuously, and dropping an item and then picking it up again.
I need quite a lot of these actors in one level,

Bird:
After 0 secs Run to completion
Interpolate self.position x to 683
Animate right flying

Self position x = 683
interpolate Self position x to 80
After 0 secs Run to completion
Animate left flying

Self position x = 80
Interpolate Self position x to 683
After 0 secs Run to completion
Animate right flying

Item:
Interpolate self.position x to 683

Self position x = 683
Ater 6 secs Run to completion
interpolate Self position x = 80

Self position x = 80
Interpolate self.position x to 683

I Have tried it this way but there are to many timers and it is lagging.
If someone could help me it would make my game run a lot smoother.
Cheers
Darren.

Best Answer

  • Fal01Fal01 Posts: 460
    Accepted Answer
    This may help,I made a game with platforms moving backwards and forwards.

    Make 2 invisible wall actors, LEFT and RIGHT. With collide behaviour on your actor
    Then make a boolean self attribute on your bird - self.direction

    Rule-when self.direction is false-MOVE direction 0 at whatever speed you want

    Rule-when self.direction is true-MOVE direction 180 at whatever speed you want

    Rule-when actor overlaps/collides with RIGHT wall
    Change attribute self.direction to TRUE

    Rule-when actor overlaps/collides with LEFT wall
    Change attribute self.direction to False.

    Hope this makes sense!

    It’s not a bug – it’s an undocumented feature

Answers

  • ashtmjashtmj Member, PRO Posts: 405
    Make a true/false attribute within the actor named right/left

    Rule 1: If right/left is false
    Change attribute self graphic flip horizontally to false.
    Constrain self motion x to 50 (or however fast you want him to move)

    Rule 2: If self position X is equal or greater then 500 change left/right to true

    Reverse above rules for moving left.
  • Dazza006Dazza006 Member Posts: 248
    @ashtmj thanks for your reply but I just can't get this to work the bird is just moving right.
Sign In or Register to comment.