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.
Comments