Turret Defense Game driving me mad.

Get help using Construct 2

Post » Thu Jun 27, 2013 7:22 am

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!
B
4
S
1
Posts: 12
Reputation: 507

Post » Thu Jun 27, 2013 8:03 am

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
B
46
S
14
G
7
Posts: 603
Reputation: 8,096

Post » Thu Jun 27, 2013 5:32 pm

[QUOTE=EncryptedCow] 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[/QUOTE]

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!
Pbodeh2013-06-27 17:39:55
B
4
S
1
Posts: 12
Reputation: 507

Post » Thu Jun 27, 2013 6:49 pm

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!
B
4
S
1
Posts: 12
Reputation: 507

Post » Thu Jun 27, 2013 7:11 pm

Yeah I meant pixels. I've been playing too much minecraft :)
B
46
S
14
G
7
Posts: 603
Reputation: 8,096

Post » Thu Jun 27, 2013 7:20 pm

[QUOTE=EncryptedCow] Yeah I meant pixels. I've been playing too much minecraft :)[/QUOTE]

Haha, nothing wrong with that!

Thanks for the hand!
B
4
S
1
Posts: 12
Reputation: 507

Post » Thu Jun 27, 2013 8:03 pm

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

Thanks!
B
4
S
1
Posts: 12
Reputation: 507


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 1 guest