Central Games Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Tower Defense Script

Go down

Tower Defense Script Empty Tower Defense Script

Post by Gamerz Thu Nov 06, 2008 1:04 am

*Note* Before you copy and paste the script, please understand that this is for the traditional 'one enemy type per level' type of Tower Defense.


When I attempted my first tower defense, I used the 'unprofessional' way of using instance_nearest() for everything. I've come up with a script for the more 'professional' way of locking onto a target until it is either destroyed or is out of range. You don't even have to understand how it works! I've set it up to be easy to use by only setting 4 arguments:

-Range
-Enemy being targetted (there can only be one, but remember that 'if' statements are your friend)
-Bullet being created
-Interval at which the bullets are created

This is also stated in the script, along with exactly how everything is working.




Since the code BB function is a bit messed up, I've put all codes within a .gmk file along with an example. This file can be found here. And yes, the CheatEngine icon was used as an enemy.
Gamerz
Gamerz
Newbie
Newbie

Number of posts : 38
Warning :
Tower Defense Script Left_bar_bleue0 / 1000 / 100Tower Defense Script Right_bar_bleue

Reputation :
Tower Defense Script Left_bar_bleue20 / 10020 / 100Tower Defense Script Right_bar_bleue

Registration date : 2008-11-05

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum