How can see and shoot using the same Sprite

0 favourites
  • 3 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • Hello Guys!!! I have a question for you... I hope you can help me because I'm going crazy.

    Image to have a game with 2 different teams. To create this temas I used only one sprite and I created 2 different istance: "ID" and "Team" for tracking who they are and undestand the correct team.

    Now, the Players go around the map without problem BUT when one player see other Players, if the player that he saw is in a different Team, it have to go to the player and shoot.

    simple. no? no!

    I have a problem with this last point.

    I use lineOfSight to see and pathfinding to move.

    I think that the issue that I have is this: the player see only itself or nobodyelse players. so I can check everything... but if the Players don't see anything...!!!! with a differt sprite there are no issues... it's working fine. so they see and go to the target.

    How can I do with the same sprite?

    pls, could you help me?

    Really really thanks for your time. in this moment I'm a disperate.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can't do it with the same sprite because when you pick yourself the instances are reduced to only yourself. There is one way which is to put the sprite in a family and say when 'sprite' has LOS of 'family' then move to family (which would be another sprite in the end). This aids the picking process. The variable would have to be moved to the family level as family instance vars. Or the other obvious way is to make team B a different sprite.

  • really thanks man!!!! really realy thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)