Tower Defense Game Tutorial
#101
Posted 24 January 2012 - 10:23 PM
but I want the enemies not to just go through a pass I want them to start moving from an position and reach to another automaticly using this code:
mp_potential_step_object(x,y,stepsize,obj)
or
mp_grid_path(id,path,xstart,ystart,xgoal,ygoal,allowdiag)
Can you tell me how can I use them correctly?
#102
Posted 31 January 2012 - 02:11 PM
how can i force the player to create the turrets to snap to grids and player can't to place them everywhere?
#103
Posted 07 March 2012 - 11:51 AM
#104
Posted 16 June 2012 - 05:54 AM
#105
Posted 25 November 2012 - 05:18 PM
Hey I'm new here and I'm also using your game as a template and trying to add a new enemy as well however i can't get the towers to shoot at it, what i did was duplicate the ob_enemy you already had and just change the sprite and for some reason the ob_bullet_tower shoots at it however the bullets go through and no damage is dealt. The only other changes i've made is change the path is uses and edited the wave_enemies script to make the enemy spawn every other wave. Also how can i change how many spawn at the start of the game?is it posibble to make an enemy that will randomly spwan with the red enemys but no as much?
i want a enemy that will shoot at the turrets but only 2 or 3 appear in 1 wave
Well you could try to add this to the code of the wave system. Erase the part from the comment:
//Check the wave time and calculate how many enemies should be created
//Create the arrays for the next wave.
until the line
wave_enemies[e] -= 1; }}}}
The brackets are not like that, remember!
But first make a second enemy (that will shoot at the turrets) called ob_enemy2.//Check the wave time and calculate how many enemies should be created //Create the arrays for the next wave globalvar ee,extra; if wave_time[wave] = 600 { wave += 1; wave_time[wave] = 0; wave_enemies[wave] = 5+floor(wave*0.4); ee[wave] = wave_enemies[wave]; extra[wave] = round(random(2))+1; } //Create enemies if needed for every array for (e = 0; e < wave+1; e += 1) { if wave_time[e] < 600 wave_time[e] += 1; if wave_enemies[e] > 0 { if wave_time[e] = (ee[e]-wave_enemies[e])*15+15 { if extra[wave] > 0 { instance_create(-32,0,ob_enemy2); extra[wave] -= 1; } else instance_create(-32,0,ob_enemy); wave_enemies[e] -= 1; } } } }It may not seem very different, but there are a few things different here: there is a new variable extra (which also works with arrays), and this works nearly the same as the variable wave_enemies, but it indicates the amount of ob_enemy2 that has to be created.
If you've added this, the system will randomly create 1,2 or 3 new enemies, using the variable extra, without making the total amount of created enemies different.
I hope this solves your problem. Else, tell me :(/>
#106
Posted 03 January 2013 - 07:14 AM
Hey I'm new here and I'm also using your game as a template and trying to add a new enemy as well however i can't get the towers to shoot at it, what i did was duplicate the ob_enemy you already had and just change the sprite and for some reason the ob_bullet_tower shoots at it however the bullets go through and no damage is dealt. The only other changes i've made is change the path is uses and edited the wave_enemies script to make the enemy spawn every other wave. Also how can i change how many spawn at the start of the game?
is it posibble to make an enemy that will randomly spwan with the red enemys but no as much?
i want a enemy that will shoot at the turrets but only 2 or 3 appear in 1 wave
Well you could try to add this to the code of the wave system. Erase the part from the comment:
//Check the wave time and calculate how many enemies should be created
//Create the arrays for the next wave.
until the line
wave_enemies[e] -= 1; }}}}
The brackets are not like that, remember!
But first make a second enemy (that will shoot at the turrets) called ob_enemy2.//Check the wave time and calculate how many enemies should be created //Create the arrays for the next wave globalvar ee,extra; if wave_time[wave] = 600 { wave += 1; wave_time[wave] = 0; wave_enemies[wave] = 5+floor(wave*0.4); ee[wave] = wave_enemies[wave]; extra[wave] = round(random(2))+1; } //Create enemies if needed for every array for (e = 0; e < wave+1; e += 1) { if wave_time[e] < 600 wave_time[e] += 1; if wave_enemies[e] > 0 { if wave_time[e] = (ee[e]-wave_enemies[e])*15+15 { if extra[wave] > 0 { instance_create(-32,0,ob_enemy2); extra[wave] -= 1; } else instance_create(-32,0,ob_enemy); wave_enemies[e] -= 1; } } } }It may not seem very different, but there are a few things different here: there is a new variable extra (which also works with arrays), and this works nearly the same as the variable wave_enemies, but it indicates the amount of ob_enemy2 that has to be created.
If you've added this, the system will randomly create 1,2 or 3 new enemies, using the variable extra, without making the total amount of created enemies different.
I hope this solves your problem. Else, tell me :(/>
Um, you should copy the shooting code, don't duplicate the action otherwise, the tower's firing speed will be tripled.
just paste it in the same action.
#107
Posted 03 January 2013 - 07:32 AM
credit goes to athanatos.
Edited by After Dark, 03 January 2013 - 07:35 AM.
#108
Posted 13 January 2013 - 06:49 PM
#109
Posted 22 February 2013 - 12:35 PM
I tweaked the wave system a bit and added more towers, but gonna give credit
for some reason, the targeting system of the laser, lightning, and ray of doom malfunctioned because of the multiple enemies
Here's the stuff I added:
enemies (I used the original enemy sprite for the sniper tower)
spider - no special traits.
Skeleton - unaffected by explosions and napalm
robot fish - moves fast and is a bit tougher
Crab - Tougher than the robot fish
explorer - faster than the robot fish
fireball - cannot be detected by ammunition towers except sniper
ghost - cannot be detected by beam towers
towers
laser - I just changed the sprite
bullet - same change as laser
lightning - shoots a single blue energy beam at the target
bomb - can damage multiple enemies in a small space
chrome - shoots short red blasts at the target
missile - leaves burning napalm after exploding
ice - different from other ice towers, shoot a ball of ice that does everything a normal bomb does, except it freezes enemies in place
ray of doom - continuously attacks a single enemy
teleport - shoots purple orbs that send an enemy back to start
pokemon - shoots poison ivy leaves that slow the target
cannon - shoots a fireball(not to be confused with the enemy fireball) that damages all enemies in a straight line
sniper - has very high damage but fires very slowly
thats pretty much it .....
for now
#110
Posted 16 April 2013 - 11:03 PM
i know this is a very old post but i was wondering if you can help me i have 2 enemys and i want the second one to start coming in at round 15 can you help me asap. thank you!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











