my jet explodes after passing through the point of pevious collision

if my jet passes through the same location where there was a previous collision with my missile and opponent plane ( an sprite sheet showing explosion is played ) … the jet aslo explodes

 

function plane:preCollision( event )      local platform = event.other            if platform.myName == "missile" then           event.contact.isEnabled = false           if self.isVisible == true then                    targetsDestroyed = targetsDestroyed +1;                explosion.xScale = 1;                explosion.yScale = 1;                explosion.x = self.x;      explosion.y = self.y;                explosion.isVisible = true;                explosion:play();            end            self.isVisible = false             end      if platform.myName == "jet" then             event.contact.isEnabled = false             explosion.xScale = 1;             explosion.yScale = 1;             explosion.x = self.x;      explosion.y = self.y;             explosion.isVisible = true;             explosion:play();             self.isVisible = false             jet.isVisible=false             if jet.collided == false then                 jet.collided = true                 jet.bodyType = "static"                 applyForceToJet = false                 gameOver()             end         end         if platform.myName == "shieldCover" then             event.contact.isEnabled = false             if self.isVisible == true then                 if shieldCover.isVisible == true then                     targetsDestroyed = targetsDestroyed +1;                                         explosion.xScale = 1;                     explosion.yScale = 1;                     explosion.x = self.x;     explosion.y = self.y;                     explosion.isVisible = true;                     explosion:play();                     self.isVisible = false               end          end     end end plane:addEventListener( "preCollision" )

Sorry, I don’t use physics so I can’t help you out. However, I would advise you to edit your post and format your code (search the faq or forum on how), because it is so hard to read right now that few people will bother to help, I think.

 it’s okay … thnx for the advise :slight_smile:

The code for putting code in is:   &nbsp;&nbsp; and   (leave out the space after the [)  or you can click on the < > icon in the bar above.

Rob

thanx Rob :smiley:

Sorry, I don’t use physics so I can’t help you out. However, I would advise you to edit your post and format your code (search the faq or forum on how), because it is so hard to read right now that few people will bother to help, I think.

 it’s okay … thnx for the advise :slight_smile:

The code for putting code in is:   &nbsp;&nbsp; and   (leave out the space after the [)  or you can click on the < > icon in the bar above.

Rob

thanx Rob :smiley: