Jump to content


Photo

enemy shooting at player while off screne


  • Please log in to reply
3 replies to this topic

#1 _241189

_241189

    GMC Member

  • New Member
  • 23 posts

Posted 22 March 2012 - 10:00 PM

I have an enemy object that shoot at the player, however the enemy continues to shoot that the player when he is outside the view port  (off screen). What would be the best way to correct this?
  • 0

#2 mironic

mironic

    GMC Member

  • New Member
  • 783 posts

Posted 22 March 2012 - 10:40 PM

I have an enemy object that shoot at the player, however the enemy continues to shoot that the player when he is outside the view port (off screen). What would be the best way to correct this?

make a hollow box sprite the size of the port. so that any outside fire by enemys will be deleted.

and in all the enemy fire objects. just put in there collision event with the box to "instance_destory()"

Edited by mironic, 22 March 2012 - 10:42 PM.

  • 1

#3 _241189

_241189

    GMC Member

  • New Member
  • 23 posts

Posted 22 March 2012 - 11:02 PM

thanks for the help!
  • 0

#4 DZiW

DZiW

    GMC Member

  • GMC Member
  • 727 posts

Posted 25 March 2012 - 09:45 AM

Why so complicated? Just check in the shooting even if the distance is less than XXX.

Edited by DZiW, 25 March 2012 - 09:47 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users