Turret/Wall

Get help using Construct 2

Post » Wed Apr 17, 2013 10:08 pm

I've been practicing with a top down shooter, so far I've made something I like and my friends are finding it quite hard (that's the idea).

Every 15 kills I'm giving the player 1 piece of in-game cash and the idea is that once they have 25 cash they can purchase either a turret or a wall.

I followed a turret guide but it was aimed at a turret vs player. I'd like it to shoot the nearest sprite, but there will be more than one. I've tried looking on Google but I can't seem to find what I am looking for so I'm wondering if anyone knows of a tutorial or a way to do this?

I'd also like help with the wall, I'm planning on having a straight line for the wall that a player can place down. But I can't figure out how to rotate an object 90 degress and have it snap to a grid and be placed?
B
5
Posts: 13
Reputation: 555

Post » Wed Apr 17, 2013 11:10 pm

there is an action or condition built-in in C2 called "pick nearest" but i havent worked with it yet.
try to search here in the forum section i'm sure you will find a tutorial or a solved thread how to pick the nearest sprite since this is a very frequently asked question.

is the player able to rotate the wall by himself in-game?
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Wed Apr 17, 2013 11:28 pm

You can do a couple of things, you can have a condition that when objects of a certain type (or family) are within range of the turret, have it acquire target.

You can have an instance variable that says wether the object is an enemy or not and have the turret lock onto it if the variable shows it to be an enemy once it is within range.

You could also do pick nearest as @philx suggested, though you may have to do one for each type of enemy unless they are in a family...

Just a few ideas...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Wed Apr 17, 2013 11:57 pm

Thanks for the tips, I'll look into the pick nearest and see if that works.
B
5
Posts: 13
Reputation: 555

Post » Thu Apr 18, 2013 11:15 am

ps:
https://www.scirra.com/manual/131/common-conditions
here's the manual entry about the pick nearest condition.
B
23
S
6
G
5
Posts: 132
Reputation: 4,487


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 18 guests