Help With a Rule

flapairflapair Member Posts: 67
edited January 2012 in Working with GS (Mac)
So hey everyone im making a game and i got a problem with the zombie actor going to the hero! Its the exact the same code from
This is the code i puted to the Zombie:

Part Working:

(this code will make the Zombie move until the hero and animate to the left < side and move left)
When attribute game. Hero X is < self.Position.X and attribute self.Overlaps or Collides is false
Move To game.Hero X +45 and game.Hero Y relative to scene
animate *some pictures*

(this code will make the zombie hit the character if its self.position.x its 45 greater pixels of the heros position. hit the hero if its on the left)
When Attribute self.position.x is < or = to game.Hero X +50 and attribute self.position.x > game.hero.X and self.Overlaps or Collides is true
animate *for now i didn't make the life yet*

Not Working:

(this code was suppose to make the Zombie move until the hero and animate to the right > side and move left)
When attribute game. Hero X is > self.Position.X and attribute self.Overlaps or Collides is false
Move To game.Hero X -45 and game.Hero Y relative to scene
animate *some pictures*

(this code was suppose make the zombie hit the character if its self.position.x is 45 pixels less of the heros position. hi the hero if its on the right)
When Attribute self.position.x is < or = to game.Hero X +50 and attribute self.position.x < game.hero.X and self.Overlaps or Collides is true
animate *for now i didn't make the life yet*

if you didn't understood my explanation just comment and i will try to explain in a simpler way!

Thanks,
Flap Air Games

Comments

  • GLGAMESGLGAMES SingaporeMember Posts: 988
    You have not said whats not working?
    The moving part or collision part?
  • flapairflapair Member Posts: 67
    Like when he wants to follow the hero and the hero X is bigger than his he doesnt follow the hero but when the Hero X is smaller than his self.Position.X he will follow the hero and used the exact same code for both i jsut changed the bigger then to smaller then and the smaller then to bigger then but it doesn't work
  • flapairflapair Member Posts: 67
    Here is my game but with no art so if anyone wants to see my problem (the problem is with the zombie) :
    http://www.mediafire.com/?mmnndug2zz64vd6
  • MotherHooseMotherHoose Member Posts: 2,456
    @flapair

    the download wont open in GS 0.9.9 nor in 0.9.8 series
    Alert: unreadable!

    perhaps in stripping it of art, many rules/behaviors were invalid thus the projectFile was corrupted

    please try another upload … and we will try another download

    @};- MH
  • flapairflapair Member Posts: 67
    edited January 2012

    here is a screen shot of the zombie rule:
    http://i.imgur.com/FcT7E.png
  • flapairflapair Member Posts: 67
    anyone know whats going wrong?
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Did you unlock the characters onstage? If you did, and you change code in the prototype, it won't work until you replace the unlocked one with the new prototype.

    Just a thought.
  • flapairflapair Member Posts: 67
    Yeah i just checked but no its the same i don't have any idea of why isn't working the code i puted in the zombie makes sense im sure and it should be working i think!
  • PrimePrime Member Posts: 8
    Maybee you should put some actors that display some text to see whats happening under the hood.I would start with 2 actor always on screen one spitting out the position of x of the main actor and the other the x position of the green dude. The rule sounds like it make sense...seeing the number would at least nail that part down.
    Your background is also black...it seems like you move beyond the screen size.

    I believe code to move object beyond the original size usually involve a code that adds xmovement + origin cam. Are both character x is set with the x + origin cam?

    In any case...try the debug text on some on screen actors to see the position x read out.
  • flapairflapair Member Posts: 67
    @Prime

    So yeah i did what you said but like it was everything right thing and the strange thing is because it animates to the heros side but it doesn't move!
  • PrimePrime Member Posts: 8
    edited January 2012
    @flapair

    I'm at a concert so pardon the short reply.

    I once asked on the forum about a "stop "
    Command.

    Check in the forum for a tread name "stop" command. It worked and was related to change of direction . It might be something you can try on your rule
  • flapairflapair Member Posts: 67
    I tried to find the Stop tread but i couldn't find it could you put the link here?
  • SAZ_1SAZ_1 Member Posts: 397
    if the problem is the punching animation... then its something in code thats not happening when going to the right... i haven't checked your code but you sure its 100% exactly the same going the other way? left seems fine... im pretty certain your problem is something little like to rules executing at the same time or one animation overuling another... by the way does health reduce when colliding with the enemy from the right side?
  • flapairflapair Member Posts: 67
    edited January 2012
    I still didn't create life so he will never die. Im sure i just did the same code but to the other side. But like i don't get it because if he starts at the other side of the hero he moves to the hero normally but after like the hero gets through him and goes to his other side it still works but when it goes back doesn't work anymore!
  • PrimePrime Member Posts: 8
    @flapair

    http://forums.gamesalad.com/discussion/comment/279926#Comment_279926

    Try making your rule stop on one side to change direction.
Sign In or Register to comment.