Shooting off screen

Im making a tank game and i only want characters to shoot while they are on screen. How do i do that?

Comments

  • aanbariaanbari Member, PRO Posts: 15
    You can create a Boolean attribute "InsideScreen". This attribute will be set to true using a rule if the tank's self.position.x is above 0 and under your screen width. If that attribute is true AND your player has clicked on a button or pressed a key, etc., then the tank can fire. If the attribute is false, then the tank will not respond to a firing command.
  • Jtek98Jtek98 Member Posts: 8
    so how would i put the self.position.x above 0 and under my screen? By the way its a enemy actor so i dont control them.
  • chicopchicop Member Posts: 263
    edited August 2013
    I guess a work around could Be adding transparent borders just off/on screen then do a if Collide then set shoot to true inside the enemy actor
Sign In or Register to comment.