Help With a Rule
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
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
The moving part or collision part?
http://www.mediafire.com/?mmnndug2zz64vd6
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
here is a screen shot of the zombie rule:
http://i.imgur.com/FcT7E.png
Just a thought.
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.
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!
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
http://forums.gamesalad.com/discussion/comment/279926#Comment_279926
Try making your rule stop on one side to change direction.