GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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 Posts: 15Member, PRO
    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 Posts: 8Member
    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 Posts: 263Member
    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.