Tower Defence Kit [ALL PLATFORMS]
Supports HUGE numbers of towers and enemies. < 30 events!
From an earlier example and now multi-platform thanks to Crusher's fantastic example (used with permission) and as suggested by happygreenfrog!
FLASH DEMO (omg!)
The demo runs on a large grid so updating the weight map takes time and you will notice stutter when placing and removing towers. Using smaller maps will make this much less of a problem. More powerful mobile devices will perform better. Removing the blocked path testing code will boost performance significantly.
- Dynamic pathfinding
- Test for blocked paths
- Adjustable tower range
- Adjustable enemy speed
- Fast area of affect/range checks
- Various optimisations and fixes
- Tidier and more helpful comments
- Slightly prettier graphics
Weight map pros and cons:
- thousands of enemies on small-medium size maps (ie 40x20)
- can be adapted for diagonal movement
- limited to one destination
- blocked path testing sub-optimal compared to extension
- does not use shortest route
Tested with Flash and iOS. Post your results!