Turret Defense Game driving me mad.

0 favourites
  • 7 posts
From the Asset Store
10 turrets rendered in 3D with top down and menu views. Three upgrade levels per tower.
  • Hello, I'm new here! I've been using the software for going on 10 hours now and I've hit a slight snag.

    Making a turret defense game as I'm just seeing what the software has to give and so far its simple and enjoyable but, I can't figure out how to spawn a turret in the center of a square 32x32 block, the code it gives you in the tutorial makes the blocks spawn -in- the 32x32 block but in a way as I could spawn one in each corner as long as they don't overlap.

    I'm positive this is my fault and not the tutorial ;) I'ts bound to be something as simple as flipping a switch but I just can't wrap my head around it!

    Thanks in advance!

    PS: The sprite I'm using as a tower is also 32x32!

  • Theres 2 ways to fix this:

    1. Move the origin of your tower to the center/corner to match the block

    2. When you spawn the tower, move it 16 blocks right and down

  • Theres 2 ways to fix this:

    1. Move the origin of your tower to the center/corner to match the block

    2. When you spawn the tower, move it 16 blocks right and down

    Hey! Thanks for the swift reply! I was just wondering about your N.2 option do you mean 16 pixels right and down? and how would I put that in an expression? I have this so far;

    Sorry, edited because I'm actually using "round((Touch.X - 16) / 32) * 32+16" and the problem now is I can stack 2 Turrets on a 32x32 square!

    Thanks for your help and time!

  • OK! I've figured it out due to much trial and error! In the tutorial there is a "Grid" layer, I added that to my layer and realized that none of my walls matched up to the grid. I feel kind of stupid :P.

    But if anyone else ever has this issue its because of that!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah I meant pixels. I've been playing too much minecraft :)

  • Yeah I meant pixels. I've been playing too much minecraft :)

    Haha, nothing wrong with that!

    Thanks for the hand!

  • Do you know of a way for example when my "Space cash" variable reaches 0 to stop being able to spawn turrets?

    Thanks!

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