How do I make a menu for a tower defence game?

Get help using Construct 2

Post » Tue Jan 03, 2017 12:50 pm

Hi!
I'm making a Tower Defence game for my homework, and i'm following this (http://tinyurl.com/zv9jnt6) tutorial to learn the basics. However, the difference is that I want to make the enemies use pathfinding instead of just direct movement.

However, the problem is that my enemy sprites don't seem to spawn at the right place and neither do they move when I created a different event command to test out their movements. Can anyone help me? Thanks a lot!!!

Construct File: http://tinyurl.com/hk5b9x9
Last edited by Mord on Fri Jan 06, 2017 11:25 am, edited 1 time in total.
B
9
Posts: 20
Reputation: 379

Post » Tue Jan 03, 2017 4:30 pm

Hello to start off the reason your enemies are not spawning correctly.
Image

It's because you forgot to destroy the initial enemy outside the layout so your map can't start.

As for adding pathfinding. I created an object called waypoint gave it a variable called number and added a variable to your enemy called currentWaypoint, whenever an enemy collides with a waypoint it will check if that waypoint number is equal to currentWaypoint,
if it is it will find path to the next waypoint.

Image

Hope this helps good luck with your project :D


Updated Construct File https://www.dropbox.com/s/s2zorpsocgkrvo0/Tower%20Defence%20updated.capx?dl=0
B
12
S
8
G
3
Posts: 33
Reputation: 3,483

Post » Tue Jan 03, 2017 9:13 pm

Thanks a lot! I'll try it out now and update you as it goes!
B
9
Posts: 20
Reputation: 379

Post » Tue Jan 03, 2017 10:35 pm

Message: Mord can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
@Brandon12hummer

So I figured out what the issue was :P
I forgot to give them an "acquire path" command, and only gave them the "move along path" command. So whenever they spawned, they just never really had somewhere to move... now I feel kinda stupid...

Anyways, the major issue I have now, is that the turrets don't seem to be aiming well and while they do fire at the enemies - they aren't facing the right angle. In addition, they don't seem to be able to acquire the target properly and seem to have issues firing when there's more then just the one target....

Do you have any idea how I can fix this?

Updated File: http://tinyurl.com/hk5b9x9
B
9
Posts: 20
Reputation: 379

Post » Wed Jan 04, 2017 8:23 pm

Graphic of the turret is facing up. Must face to the right = zero angle.

Not

Image

But

Image
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jan 05, 2017 10:41 am

Thanks! I feel really stupid now :P
B
9
Posts: 20
Reputation: 379

Post » Thu Jan 05, 2017 5:13 pm

Pfft, how do you think i know ? Have done those 'stupid' things too.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Jan 06, 2017 11:23 am

@99Instances2Go

Hahaha, thanks a lot! So I wanted to add some extra content and add more towers as well as enemies, is there any way to create a "menue" of sorts that I can then open up with a button and choose which towers to add? or should I just make a sidebar and be done with it?

What about upgrading the towers? is there a way to make them clickable and then they open up a menue with an upgrade menue for say, speed, strength or whatever else?
B
9
Posts: 20
Reputation: 379


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests