How to make a movable actor immovable when hit by enemies
blackmoroi
Member Posts: 28
Pls help me..I am trying a top down maze game in which player has to move some blocks to advance the level.but the blocks should not move if hit by enemies.plss help me what to do..I tried many methods like varying the weight and drag but still no use....Pls give a suggestion..
Answers
Contrain the positions of the blocks unless they come in contact with the player.
Make 2 self attributes "real type"
Self-X
Self-Y
Constrain attribute. Self-X to self.position.X
Constrain attribute. Self-Y to self.position.Y
Rule
When actor receives event "overlaps and collides with player"
No code in main part of rule
Otherwise
Constrain attribute self.position.X to Self-X
Constrain attribute self.position.Y to Self-You
Make sure the code is ordered top to bottom as written so the position gets written to the self attributes before the otherwise of the rule kicks in.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
thanks a lot..I understood the ideas.Let me try it on my game.again thanku very much...