(solved) Placing turret not over other turret

0 favourites
  • 4 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • EDIT: Changed attachment, wrong project

    Hi,

    im building a towerdefense game with pathwalking monsters and turrets. Nothing special, its my third day with C2 im a noob

    I used the tutorial from Geometrix and made some changes... surely this is where i made the mistake.

    When i placed a turret on the grid it works. But i can place another turret over it - wrong

    Here ist the "code":

    I tried "Curser is not overlapping turret1" but doesnt helped me. I dont have a clue whats the Problem, plz help me.

    ________________________________________________________________________________

    There is another Problem with the tutorial from Geometrix (sry for the bad words). There is a rule that a tower only searchs target if placed ("not Floating) via boolean instance variable. It works for the first turret. If first turret is placed, second turrets shoots when "floating". I have the same problem. Maybe anyone can fix this Problem?

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe someone does anything similar with other Events? Any Idea for a workaround would be nice too.

  • McBuzzzy

    Try replacing the TiledBackground you build on with a Sprite and give it a boolean Instance Variable called Occupied that starts as false, when you go to build check that variable and set it to true once built.

    As an example I've edited your capx giving the TiledBackground the variable and you'll see you can only build one turret on each TiledBackground instance.

    [attachment=0:2psptj6s][/attachment:2psptj6s]

    Edit: Just changed it to fix the floating shooter issue

    Set the Turret behaviour's Initial State to Disabled on the pre-placed turrets on the layout (so it's the default value for created turrets), and set it to Enabled once it's placed.

  • Thanks u did it!

    It was so easy... but it didnt come into my mind

    Thank u alot!

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