Next Waypoint

specialist_3specialist_3 Member Posts: 121
edited November -1 in Working with GS (Mac)
Hi,

I am currently working on a tower defense game. Its come out well so far. But as always, I have hit the next road block. Basically, I have a particular creep type say XY. Now XY can only be killed completely using an XY-type weapon. If I use an X-type weapon, the creep will break down to Y and continue moving till its shot down by a Y-type weapon. And if I use a Y-type weapon, XY will break down to an X and will still continue its run till shot down by X-type weapon. As mentioned if I use XY-weapon, the creep dies completely without breaking down.

The challenge here is with the waypoint. So far in my maps, I have manually keyed the next navigation point the creeps must head towards before moving to the next. Example,

If, creep reaches (10,20), then move to (20,30)
If, creep reaches (20,30), then move to (30,40) and so on.

The problem is what if XY is broken down to either X or Y (they are spawned from the dead body of XY) in between any of these navigation points. They will remain where they are spawned without knowing where to go next. How can I tackle this challenge?

Thanks!!

Comments

  • HachikoHachiko Member Posts: 330
    Can't you check the XY position of the news spawned monster? Like, if self positionX, self position are greater than 0 and less than 20, move to 20. If they are greater than 20 and less than 30, move to 30. And so on.
  • HachikoHachiko Member Posts: 330
    Sure, but from what I have understood, it's possible that monster X e Y spawn together. I mean, there can be Z bullet :). Would be cool if when hit by a third type of bullet for mistake, you have to deal with two instead of one. Not really into tower defense though, so can't really say if that's a fun thing or not xD. Then, I can't understand the problem he's having. If he is using coordinates to start the new move to, checking the self XY doesn't even use constrain. So, if X is between 0,20, move to 20. if between 20 and 30, move to 30. And so on. Don't know how he did it, though, so maybe he didn't did it like I think. :)
  • specialist_3specialist_3 Member Posts: 121
    tshirtbooth, thanks for the post. Lemme try your solution. Will update once done.

    Hachiko, thanks mate. I considered your suggestion but that can be an extremely tedious process. Imagine I am having a rectangular maze that spirals inwards in 3-4 layers. It will be tougher with a circular one.
Sign In or Register to comment.