[SOLVED] Create a tower defense

For questions about using Classic.

Post » Sat Jan 14, 2012 5:02 pm

Hi, it's my first time I post in this forum. I don't know if it's here, sorry if not. I'm french so sorry if I do something wrong. ^^
I tried to create a tower but i have a problem : I created a tower that shoot an enemy, but if he's fast, the bullet don't touch him.
My question is : How to do the bullet follow the ennemy ?
I searched tower defense tutorial, but nothing helped me.

Thank you.The_Lord_King2012-01-14 17:30:32
B
7
G
1
Posts: 20
Reputation: 657

Post » Sat Jan 14, 2012 5:06 pm

You can store the UID of the enemy as a variable in the bullet, then aim the bullet at the enemy with the right UID.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Sat Jan 14, 2012 5:13 pm

Thank you ! You are fast and great ! ^^
So i put the UID in the bullet. I have to rotate toward position ?

And how i get the position of the target ? (i have his UID in the bullet)
B
7
G
1
Posts: 20
Reputation: 657

Post » Sat Jan 14, 2012 5:20 pm

for each bullet
enemy: is UID equal to bullet('uid')
- set angle of bullet to position: enemy.x, enemy.yArima2012-01-14 17:20:50
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Sat Jan 14, 2012 5:27 pm

It works ! Thank you very much ! You're awesome ! :D

(There is somewhere to put the topic to solved ?)
B
7
G
1
Posts: 20
Reputation: 657

Post » Sat Jan 14, 2012 5:28 pm

Thanks, no prob. :)

As for a place to put the topic, not really - you can just edit the title if you want.Arima2012-01-14 17:29:21
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests