Jump to content


Photo
* * * * * 3 votes

Tower Defense Game Tutorial


  • Please log in to reply
111 replies to this topic

#51 JaJoentertainment

JaJoentertainment

    GMC Member

  • New Member
  • 2 posts

Posted 06 September 2009 - 07:26 PM

Hey i was wonderin how to make it so the towers aim at the enemies like they do in your amazing interceptor game? any help?
  • 0

#52 JaJoentertainment

JaJoentertainment

    GMC Member

  • New Member
  • 2 posts

Posted 07 September 2009 - 06:06 PM

This is an excellent tower defense engine! :) I just wish that there was a button you could press to release the next wave, and if possible also a code that makes the new wave's enemies have the next enemy subimage so that all the waves wouldnt look the same. But other than that, great job!
EDIT: How do I make the small explosions get created when the laser hits the enemy? :GM6:

This is a great tutorial! I was wondering if you could throw in a pro one where the turrets aim towards the enemies.


That could be easily done in unregistered too...

how do you make the towers aim towards the enemies then?
  • 0

#53 Davidramsey03

Davidramsey03

    GMC Member

  • New Member
  • 8 posts

Posted 29 September 2009 - 11:25 PM

Hi. This is a wonderful tutorial....
I've been following and making the changes I'm looking for to my game.
I've got a couple questions for a couple of my modifications.

1. Some of the newer tower defense games are "free-style", where there is a start point and an end point, and the enemies find their own way to the end point based on the way you place the towers in their path...
So, I'm looking for some method of pathfinding, while avoiding the objects I place... BUT, in my tests, the "Step Towards Point while avoiding" pre-made function gets confused pretty easy. Any ideas?

2. Along with the first issue, I want to stop you from placing a tower in a position that would block the only path to the end, i.e. a check to make sure there is still a valid path before allowing you to place the tower there.

ANY HELP WOULD BE MUCH APPRECIATED!

Thanks
  • 0

#54 12warr12

12warr12

    GMC Member

  • GMC Member
  • 696 posts
  • Version:Unknown

Posted 30 October 2009 - 03:41 PM

10/10

I just don't know how to make new towers and add them to the menu
  • 0

#55 Sonicdog999

Sonicdog999

    GMC Member

  • New Member
  • 3 posts

Posted 18 December 2009 - 09:16 PM

is there any way to remove the time system and transfer it to a START button so you have plenty of time to buy/upgrade weapons and start the round whenever you want?
just wondering. :)

Edited by Sonicdog999, 18 December 2009 - 09:18 PM.

  • 0

#56 1Sunkist64

1Sunkist64

    GMC Member

  • New Member
  • 24 posts

Posted 29 December 2009 - 07:38 PM

How do you make the tower rotate at what it is aiming at because I have cannons. :whistle:

Edited by 1Sunkist64, 29 December 2009 - 11:12 PM.

  • 0

#57 Ocliptis

Ocliptis

    GMC Member

  • New Member
  • 55 posts

Posted 29 March 2010 - 04:29 AM

Your tutorial is VERY COOL!
This is really good, and I will give you credit for the game, but i need some help.

How do you make enemy waves different,
for example 12 bombs come on wave 1 and wave 2 30 bombs and 15 blue bombs come and on wave 100, about 1000 rainbow bombs, 500 yellow bombs, and so on.
How do you have multi-enemy waves?

How do you make flame tower fire like using the particle function. It shoots out fire rapidly.
How do you make a ice blower tower. I make a single ice particle sprite and make it into a blower which blows lots of ice particles. It is still but targets bombs.

How do you make a tower rotate in the enemies direction?
How do you make a tower shoot; not one enemy but lots. When i put different types like red, blue, yellow, rainbow, white bombs, they only get the red bomb?? I want them to target every single type.

How do you make spikes. You can only place them on the path and they do not fire. They stay there and destroys upto 10 bombs and then it's gone.
A different upgrade system; like instead of upgrading to lvl 1 and all that, you could upgrade to example: "FROST TOWER" upgrade to PERMA FROST or FAST FIRING or FROST BOMBS?
Instead of a wave counter, could you have no, just a start round button? When a whole wave is finished, the start round button appears.
When your mouse hovers a button like THE FROST TOWER, a description appears like FROST TOWER, includes power and rate of fire.
A booster. If you place them near towers, they increase the surronding towers (in it's radius) power.
Bombs multiplying. If a black bomb is destroyed, if a blue bomb is destroyed, a black bomb appears just like in bloons tower defense how a blue bloon pops into a red bloon.
Screen clear function: If you click on like blackhole, a blackhole will appear in the center of the screen and suck up lots of bombs for 10 seconds.
Or if you activate "Atom BOMB" it clears the whole screen.

Grenade thrower. If bombs come, it starts spinning really fast shooting out 1 grenade every 2 millisecond at the enemy. But the grenades are very weak.

Immunities, like if you place an ICE BLOWER, it doesn't effect an ice bomb or if you place a FLAME TOWER it doesn't effect Fire bombs.

4 direction shooters. If you place one of these, it will shoot in all 4 directions at the enemy. good in corners.

How do you do all that? I tried, it didn't work.

I have been studying this tutorial for about 3 months while making my game 'Paper Mario Tower Defence' and probably know almost as much as the creator about this tutorial so I'll help on the things that I know about.

'How do you make enemy waves different,
for example 12 bombs come on wave 1 and wave 2 30 bombs and 15 blue bombs come and on wave 100, about 1000 rainbow bombs, 500 yellow bombs, and so on.'
You have to use something like this(this is what you replace in the tutorial script starting at //Creates enemies if needed for every array):

//Creates enemies if needed for every array
if wave_time < 600 wave_time += 1; //the 600 is the amount of seconds in the wave before the next wave comes.
if wave_enemies > 0 //this asks if there are any enemies left.
{
if(wave_time = (ee-wave_enemies)*15+15) //I recently found out that the 15's are the spaces between the enemies when they are created.
{
switch(floor(wave/1)) //this will switch the enemy every wave. Change the 1 to another number to have it switch for more waves. ex:if set to 2 then ob_enemy1 will be the enemy fought for 2 waves. Once you run out of 'cases' no more enemies will come.
{
case 1:instance_create(-32,0,ob_enemy1); break;
case 2:instance_create(-32,0,ob_enemy2); break;
case 3:instance_create(-32,0,ob_enemy3); break;

'How do you have multi-enemy waves?'
Again start replacing at the creates enemy for every array:

//Create enemies if needed for every array
if wave_time < 600 wave_time += 1;
if wave_enemies > 0
{
if wave_time = (ee-wave_enemies)*15+15
{
instance_create(-32,0,choose(ob_enemy1,ob_enemy2,ob_enemy3));//this will make a random enemy from the 3 enemies there. You can have up to 16 enemies.
wave_enemies -= 1;
}
}

Can't help you with the particle questions unfortunately.
I can't remember how make the tower rotate in the enemy's direction will try to figure that out because I want to know how to too.

'How do you make a tower shoot; not one enemy but lots. When i put different types like red, blue, yellow, rainbow, white bombs, they only get the red bomb?? I want them to target every single type.'
Have an 'ob_parent_enemy' and make it the parent of all enemies. Go into all of your towers and change the codes that say 'ob_enemy' to ob_parent_enemy.'

'How do you make spikes. You can only place them on the path and they do not fire. They stay there and destroys upto 10 bombs and then it's gone.'
This would be complicated becuase it would be a mix between tower and bullet and I haven't tried it so I can't help there. I couldn't help with the different upgrade idea yet either but I might get back to you if I figure it out in my next td game becuase I'm having that in it.

'Instead of a wave counter, could you have no, just a start round button? When a whole wave is finished, the start round button appears.'
Get rid of everything that mentions 'wave_time.'

'When your mouse hovers a button like THE FROST TOWER, a description appears like FROST TOWER, includes power and rate of fire.'
This is also very complicated and I couldn't tell you how. The booster idea is interesting, I'll try it and get back to you.

'Bombs multiplying. If a black bomb is destroyed, if a blue bomb is destroyed, a black bomb appears just like in bloons tower defense how a blue bloon pops into a red bloon.'
I noticed that many of your ideas are from bloons. You confused me so I'll use bloons as the example. Make it so that in the blue bloon's destroy event it changes into a red bloon(or two or three etc.).

'Screen clear function: If you click on like blackhole, a blackhole will appear in the center of the screen and suck up lots of bombs for 10 seconds.
Or if you activate "Atom BOMB" it clears the whole screen.'

Create a sprite that gets bigger in an animation. If you are using gm8 then seperate the collision masks. Then make it an object with these events.
CREATE
(not code)set alarm 0 to 300

ALARM 0
(not code)destroy instance, applied to 'self'

COLLISION WITH ENEMY/ENEMY PARENT
(not code)destroy instance, applied to 'other'

END OF ANIMATION
(code)
image_speed=0

'Grenade thrower. If bombs come, it starts spinning really fast shooting out 1 grenade every 2 millisecond at the enemy. But the grenades are very weak.'
duplicate a bullet tower(any one that fires a bullet not a laser) then go into the create event and set 'rate' to 0.2 and 'damage' to 1.

Can't help with immunities and will get back to you for the four direction shooter.

Wow you have alot of questions, It took me an hour to write this reply. :D :)
If you have anymore questions then ask, though if you pm me I'll reply to you then put it on the thread.
  • 0

#58 EchoJerichoX

EchoJerichoX

    www.MetroidCoven.com

  • GMC Member
  • 506 posts
  • Version:GM8.1

Posted 29 March 2010 - 06:48 AM

Damn, awesome tutorial man!
  • 0

Metroid%20Coven%20Title.png


Metroid: Coven is my main project. It is based on the Metroid series and is in the top-down perspective. You can get more information in the following places...

The official website: http://www.metroidco...com/en/news.php.

The GMC forums post: http://gmc.yoyogames...howtopic=510903.

The Trello board: https://trello.com/b...m/metroid-coven.

The YouTube channel: http://www.youtube.c...er/EchoJerichoX.

My Twitter: https://twitter.com/EchoJerichoX.
You can also find information on joining the development team here: http://gmc.yoyogames...howtopic=468874.


#59 Jarquafelmu

Jarquafelmu

    GMC Member

  • New Member
  • 4 posts

Posted 19 April 2010 - 02:36 AM

I was having trouble on the selling button of this tutorial. I've tried to follow your instructions exactly and yet when I use my sell button it sells the selected tower, but then tries to place a laser tower. I am not sure what is going wrong. I was hoping you could help me figure out what is going on here.

What should I include to help you know where my problem is? Also in my step event. The program doesn't find ii.price anywhere, calls it an unexpected variable.
  • 0

#60 Nubcake

Nubcake

    Nubcake

  • GMC Member
  • 1320 posts
  • Version:Unknown

Posted 20 April 2010 - 03:36 PM

6/5! very good!
  • 0
Nubcake ~ Former GM'er '10 ~

#61 cristiander

cristiander

    GMC Member

  • GMC Member
  • 784 posts
  • Version:GM8

Posted 30 April 2010 - 07:24 PM

I've worked a lot with this program and I actually made a lot of progres in my programing.

I managed to create 2 more bullet tipe of towers

I have 6 tipes of enemyes (3 normal enemyes, 1 fast, 1 minibos, 1 boss)

But now I got stuck!
I was tring to make 2 more tipes of towers(this time lasers) And I dosn't work!
One of them ... if you click the buy button is put's the tower where the button is.
The other one can't be selected. If I clck on it nothing hapenes. No circle arund him, no upgrades, nothing.
And they were nothing more than direct clones of the laser tower(and yes, I replace every "ob_tower_laser" with my tower but it still dosn't work)
  • 0
The real gamers are the ones that are hardcore. And you know your hardcore when you have finished any of my games

- Tofuman
- Pac war 2
- Gravitron

#62 njp

njp

    Panda

  • GMC Member
  • 2342 posts
  • Version:GM8

Posted 01 May 2010 - 01:29 AM

cant TD (tower defense) be confused with TD (top-down)... just putting it out there, or am i wrong? :D
  • 0

[--NJP--]


#63 12warr12

12warr12

    GMC Member

  • GMC Member
  • 696 posts
  • Version:Unknown

Posted 01 May 2010 - 08:12 AM

cant TD (tower defense) be confused with TD (top-down)... just putting it out there, or am i wrong? :D


well, when someone makes a Top-Down, they put infront of the name, if its a shooter or w/e. TDS... I have never seen anyone saying TD for a Top down game. Only TDS
  • 0

#64 aaabbbccc

aaabbbccc

    GMC Member

  • GMC Member
  • 525 posts

Posted 09 May 2010 - 01:50 AM

Hi, for some reason, my laser towers won't shoot (Yes im using GM 8) But the cannon tower shoot's just fine. and your tutorial opened and works in GM 8 (pro) so it's not that.

What codes do you need to see to help?

Also, the waves don't work, they just constantly send, and i don't get money from killing.
  • 0
Posted Image Escape The Dark - 5%
WORK IN PROGRESS !

#65 Devilfromhost12

Devilfromhost12

    GMC Member

  • GMC Member
  • 735 posts

Posted 09 May 2010 - 02:26 AM

I played this awhile back (Like in 09) and it is pretty good. Very good job.
  • 0

#66 captain_bakaneko

captain_bakaneko

    GMC Member

  • New Member
  • 7 posts

Posted 16 May 2010 - 11:58 PM

Great tut, worked over it and made my own TD, got rid of your Path system, it wasn't to my liking, and made my own the only thing i'm stuck with is unselecting the towers, with right click I tried a few things but they failed. How can you turn off selecting? is it the Activate thing or is that to ... wait don't tell me it's activate.. nope that was a fail too.. i tried to change activate to 2, thinking it will be off, but nope.
here's what i got so far
  • 0

#67 12warr12

12warr12

    GMC Member

  • GMC Member
  • 696 posts
  • Version:Unknown

Posted 20 May 2010 - 12:35 PM

why upload to megaupload, if you can upload to mediafire, wich is much easyer and it doesn't require an account?
  • 0

#68 Kyox

Kyox

    GMC Member

  • New Member
  • 2 posts

Posted 09 July 2010 - 09:30 PM

How do you animate the tower to 'follow' the monster it's targeting? Kinda like it got it's target locked?

I'm new with game maker and I'm making my first game. I used this tutorial to set the basics and it helped me a lot, thx! :)
  • 0

#69 Hygo25

Hygo25

    GMC Member

  • New Member
  • 52 posts

Posted 10 July 2010 - 12:37 AM

I did the math, and the Laser Tower is more effective than the Cannon Tower, and cheaper too.
  • 0
GENERATION 27: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

#70 PlatformGames

PlatformGames

    GMC Member

  • New Member
  • 49 posts

Posted 30 July 2010 - 04:16 AM

i would use this but if you buy the 1st tower you can buy the second tower but you go negative cash..
  • 0

#71 pie_man

pie_man

    GMC Member

  • New Member
  • 1 posts

Posted 05 August 2010 - 02:46 PM

How do you animate the tower to 'follow' the monster it's targeting? Kinda like it got it's target locked?

I'm new with game maker and I'm making my first game. I used this tutorial to set the basics and it helped me a lot, thx! :)

This is the code to make the object point to a specific point:
direction=point_direction(x,y,object?.x,object?.y)
If you want the object's angle to change, create an end step event and put in the transform sprite action (pro) and set the angle to the direction. Otherwise, if you use lite and your sprite has equal height and width, just make a sprite with 360 images (using the animate menu and then choose "Rotation seguence > Clockwise" and choose 360 frames+degrees) and then set the image index (image_index) to the direction.
  • 0

#72 _168004

_168004

    GMC Member

  • New Member
  • 1 posts

Posted 22 August 2010 - 05:28 PM

I am trying to make canyon defense on game maker and would like a few tips on how to make a set number of levels, three difficulty settings, all the different enemies from canyon defense and their health amounts as well as special abilities like autorepair, shielded, different level enemies, fast, etc.etc.etc. Someone please help me on this one.
  • 0

#73 Chazzmundo

Chazzmundo

    GMC Member

  • New Member
  • 275 posts
  • Version:GM8

Posted 23 August 2010 - 12:00 AM

actually love this tut, gave me a basic framework i can work on. So far have changed the layout, have got 6 new towers types, 4 VERY different enemy types, and a nice menu with abilities and an overview of the current selected tower :)
  • 0
Chazz

#74 jourdan

jourdan

    GMC Member

  • GMC Member
  • 2 posts

Posted 26 August 2010 - 08:14 PM

Great tut

Posted Image
  • 0

#75 ToiLeT

ToiLeT

    GMC Member

  • New Member
  • 3 posts

Posted 12 September 2010 - 11:17 AM

How would i make the turret angle change so it always follows the target? (i am a GML noob :( )
  • 0

#76 Hiddenaces

Hiddenaces

    GMC Member

  • New Member
  • 418 posts

Posted 12 September 2010 - 11:32 AM

How would i make the turret angle change so it always follows the target? (i am a GML noob :( )

look 4 posts up ... some times it really pays to read the posts and not just ask straight away :)
  • 0
Try it out
Code Snippets
What you got to lose :):)
My thread link to code snippets in the Tutorials and Examples forum
pop by and leave a comment.

#77 ToiLeT

ToiLeT

    GMC Member

  • New Member
  • 3 posts

Posted 12 September 2010 - 12:24 PM


How would i make the turret angle change so it always follows the target? (i am a GML noob :( )

look 4 posts up ... some times it really pays to read the posts and not just ask straight away :)

I tried that but when i play the game it comes up with an error which says:

Error in code at line 1:
direction=point_direction(x,y,obj_enemy.x,obj_enemy.y)
^
at position 41: Unknown variable x

please help :(
  • 0

#78 Snopel

Snopel

    GMC Member

  • New Member
  • 61 posts

Posted 21 September 2010 - 10:21 PM

to make the turret face the enemy put this in the step code

if instance_number(Name Of Enemy) > 0
{
nearest = instance_nearest(x,y,Name of Enemy);
image_angle = point_direction(x,y,nearest.x,nearest.y);
}

and this into the draw code

draw_sprite_ext(sprite_index,image_index,x,y,1,1,image_angle,c_white,1)

this should make your turrets face your enemie when shooting(tip you dont need to edit sprite just make sure its facing right
  • 0

#79 Turok

Turok

    GMC Member

  • New Member
  • 3 posts

Posted 11 October 2010 - 01:27 AM

How do i make it so that when a different enemy comes the towers shoot at it.

its seems the towers ignore it completely -_-...

Good tutorial btw, it helped alot.
  • 0

#80 Turok

Turok

    GMC Member

  • New Member
  • 3 posts

Posted 11 October 2010 - 01:32 AM

How do i make it so that when a different enemy comes the towers shoot at it.

its seems the towers ignore it completely -_-...

Good tutorial btw, it helped alot.


Oh btw i tried to use this:

{
var ii, dist, xx, yy;
if firing > 0 firing += 1;
if firing >= 30/rate firing = 0;
if not instance_exists(target) target = noone;
if instance_exists(ob_enemy)
if instance_exists(ob_enemy2)
{
if target = noone target = instance_nearest(x,y,ob_enemy);
if target = noone target = instance_nearest(x,y,ob_enemy2);
if point_distance(x,y,target.x,target.y) > range
target = noone;
...

The towers dont seem to know the second enemy(type) is there... :(
  • 0

#81 jhf97

jhf97

    GMC Member

  • New Member
  • 2 posts

Posted 11 October 2010 - 11:07 PM

How about some thing like this

//Check if enemies are in range and activate firing if needed

{
if firing > 0 firing += 1;
if firing >= 30/rate firing = 0;
if not instance_exists(target) target = noone;
if instance_exists(ob_enemy)
{
if target = noone target = instance_nearest(x,y,ob_enemy);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}


if instance_exists(ob_enemy2)
{
if target = noone target = instance_nearest(x,y,ob_enemy2);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}

if instance_exists(ob_enemy3)
{
if target = noone target = instance_nearest(x,y,ob_enemy3);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}

if instance_exists(ob_enemy4)
{
if target = noone target = instance_nearest(x,y,ob_enemy4);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}

if instance_exists(ob_enemy5)
{
if target = noone target = instance_nearest(x,y,ob_enemy5);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}


if firing = 1 depth = -3;
else depth = -2;
}

Edited by jhf97, 11 October 2010 - 11:08 PM.

  • 0

#82 Turok

Turok

    GMC Member

  • New Member
  • 3 posts

Posted 13 October 2010 - 08:10 PM

How about some thing like this

//Check if enemies are in range and activate firing if needed

{
if firing > 0 firing += 1;
if firing >= 30/rate firing = 0;
if not instance_exists(target) target = noone;
if instance_exists(ob_enemy)
{
if target = noone target = instance_nearest(x,y,ob_enemy);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}


if instance_exists(ob_enemy2)
{
if target = noone target = instance_nearest(x,y,ob_enemy2);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}

if instance_exists(ob_enemy3)
{
if target = noone target = instance_nearest(x,y,ob_enemy3);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}

if instance_exists(ob_enemy4)
{
if target = noone target = instance_nearest(x,y,ob_enemy4);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}

if instance_exists(ob_enemy5)
{
if target = noone target = instance_nearest(x,y,ob_enemy5);
if point_distance(x,y,target.x,target.y) > range
target = noone;
else if firing = 0
firing = 1;
}


if firing = 1 depth = -3;
else depth = -2;
}


i figured it out.

I just needed to make the other enemies the child of the original enemy :)
  • 0

#83 flamses1000

flamses1000

    GMC Member

  • New Member
  • 27 posts

Posted 05 December 2010 - 12:36 PM

i need help so the tower will point at the enemy and shoot when an enemy comes by i looked back,but it didnt work for me
  • 0

#84 TDsDomain

TDsDomain

    GMC Member

  • New Member
  • 1 posts

Posted 05 December 2010 - 11:46 PM

how do you make it so the wave ends when all the enemies are dead instead of a time limit?
  • 0

#85 guowei

guowei

    GMC Member

  • New Member
  • 5 posts

Posted 06 December 2010 - 07:56 AM

Awesome tower defend tutorial :D just some of the code bug me to no end, but that is just me:P

Thanks to your tutorial I'm able to complete my tower defense much faster then if i'm doing it alone :D Thanks alot!

Edited by guowei, 06 December 2010 - 07:56 AM.

  • 0

#86 the_recruiting

the_recruiting

    GMC Member

  • New Member
  • 800 posts

Posted 09 December 2010 - 09:55 AM

Sorry to bring this topic back up but does anyone have a working link to the file? Really important as this was a great tut!

Thanks ;)
  • 0

#87 flamses1000

flamses1000

    GMC Member

  • New Member
  • 27 posts

Posted 12 December 2010 - 01:05 PM

Please someone help me with my with rotating the towers
  • 0

#88 OrangeDragonOrigami

OrangeDragonOrigami

    GMC Member

  • New Member
  • 1 posts

Posted 30 December 2010 - 04:57 AM

This is the best td tutorial i have found so far.
But i seem to be having problems with understanding how to add more towers.
I'm not that familiar with GM code.
This tutorial helped me understand more about GM code.
But can someone help me with adding more types of towers?
Also does anybody now how to make a bomb weapon that has a target in the middle and can blow up an enemy like in 'interceptor' "the swc" but this is followed by the mouse and after used once is not used again until ypu buy another one.
Like the bomb used in 'warzone tower defence' (for a better explanation).
By the way im using Game Maker 8pro.
  • 0

#89 flamses1000

flamses1000

    GMC Member

  • New Member
  • 27 posts

Posted 02 January 2011 - 11:16 PM

how do you make it so the wave ends when all the enemies are dead instead of a time limit?


you would have to change the wave system to do this:
{
globalvar ee;
if wave_time = 600
{
wave += 1;
wave_time = 0;
wave_enemies = min(5+floor(wave*0.4),25);
ee = wave_enemies;
}
//Creates enemies
if wave_time < 600 wave_time += 1;
if wave_enemies > 0
{
if(wave_time = (ee-wave_enemies)*30+30)
{
switch(floor(wave/1))
{
case 1:instance_create(-32,0,ob_alien); break;--change ob_alien and other stuff to what ur enemies are if u want only one change all to same
case 2:instance_create(-32,0,ob_alien); break;
case 3:instance_create(-32,0,ob_alien); break;
case 4:instance_create(-32,0,ob_huge_spaceship); break;
case 5:instance_create(-32,0,ob_enemy); break;
case 6:instance_create(-32,0,ob_enemy); break;
case 7:instance_create(-32,0,ob_alien); break;
case 8:instance_create(-32,0,ob_enemy); break;
case 9:instance_create(-32,0,ob_huge_spaceship); break;
case 10:instance_create(-32,0,ob_alien); break;
case 11:instance_create(-32,0,ob_alien); break;
case 12:instance_create(-32,0,ob_tank); break;
case 13:instance_create(-32,0,ob_alien); break;
case 14:instance_create(-32,0,ob_huge_spaceship); break;
case 15:instance_create(-32,0,ob_enemy); break;
case 16:instance_create(-32,0,ob_tank); break;
case 17:instance_create(-32,0,ob_alien); break;
case 18:instance_create(-32,0,ob_enemy); break;
case 19:instance_create(-32,0,ob_huge_spaceship); break;
case 20:instance_create(-32,0,ob_alien); break;
case 21:instance_create(-32,0,ob_alien); break;
case 22:instance_create(-32,0,ob_tank); break;
case 23:instance_create(-32,0,ob_alien); break;
case 24:instance_create(-32,0,ob_huge_spaceship); break;
case 25:instance_create(-32,0,ob_enemy); break;
case 26:instance_create(-32,0,ob_tank); break;
case 27:instance_create(-32,0,ob_alien); break;
case 28:instance_create(-32,0,ob_enemy); break;
case 29:instance_create(-32,0,ob_huge_spaceship); break;
case 30:instance_create(-32,0,ob_alien); break;
case 31:instance_create(-32,0,ob_tank); break;
case 32:instance_create(-32,0,ob_alien); break;
case 33:instance_create(-32,0,ob_alien); break;
case 34:instance_create(-32,0,ob_huge_spaceship); break;
case 35:instance_create(-32,0,ob_boss); break;
if wave>= 35
room_goto(rm_menu)--change this to what u want like game_end()

}
wave_enemies -= 1;
}
}
}
  • 0

#90 _181743

_181743

    GMC Member

  • New Member
  • 1 posts

Posted 08 January 2011 - 04:30 PM

This is the best td tutorial i have found so far.
But i seem to be having problems with understanding how to add more towers.
I'm not that familiar with GM code.
This tutorial helped me understand more about GM code.
But can someone help me with adding more types of towers?
Also does anybody now how to make a bomb weapon that has a target in the middle and can blow up an enemy like in 'interceptor' "the swc" but this is followed by the mouse and after used once is not used again until ypu buy another one.
Like the bomb used in 'warzone tower defence' (for a better explanation).
By the way im using Game Maker 8pro.


this should do there is new kind of tower save(if needed), and nuke(like warzone)hope you like it :D
download link:Download td game.gmk

EDIT* : These files are now friendly with lite users

Edited by _181743, 24 January 2011 - 11:03 AM.

  • 0

#91 jak2027

jak2027

    GMC Member

  • New Member
  • 16 posts
  • Version:Unknown

Posted 08 February 2011 - 06:57 AM

Quick question, how would one going about to change the Wave system so it spawns a number of enemies you choose instead of using the equation in the curent wave system?
  • 0

#92 The Rock Abdo

The Rock Abdo

    GMC Member

  • GMC Member
  • 77 posts
  • Version:GM:Studio

Posted 06 March 2011 - 06:51 PM

Great Tutorial Thanks VERY MUCH :) :wub:
  • 0

banner10.png


#93 DioFlare

DioFlare

    GMC Member

  • New Member
  • 56 posts
  • Version:GM8

Posted 06 March 2011 - 08:40 PM

Thanks! Nice tutorial!
  • 0
URL to image-- don't use images that are over 100KB in your sig/avatar:
http://fc05.devianta...y_PAGANI_F1.gif

#94 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 17266 posts
  • Version:GM:Studio

Posted 07 July 2011 - 02:34 AM

Std Msg: Please use the tutorial template header (The Tutorial Clean Up Crew).
Std Msg: Please add a summary/explanation or basic outline of what your tutorial is for or teaches (The Tutorial Clean Up Crew).
Std Msg: Please remove the Local Moderator Said quote (The Tutorial Clean Up Crew).

Not Rejected;

Moved to Staff Choice for all the effort in the .doc and incremental gmks
  • 0

#95 Terrified Virus

Terrified Virus

    Moderators Plaything

  • GMC Member
  • 753 posts
  • Version:GM:Studio

Posted 11 July 2011 - 04:11 AM

Wow, this is awesome, I might just use some codes in my game! This definitely deserves to be in the staff choice section.
  • 0

1357275755.png


#96 _223916

_223916

    GMC Member

  • New Member
  • 1 posts

Posted 20 August 2011 - 12:05 PM

How do you add different levels (maps/rooms)?
  • 0

#97 skibbi

skibbi

    GMC Member

  • New Member
  • 7 posts

Posted 05 September 2011 - 08:35 AM

I'm a noob :laugh: and I haven't a clue how to make this!
Please give permission to mod it if we give you lots of credit and don't enter it in anything!

  • 0

#98 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 24896 posts
  • Version:GM:Studio

Posted 05 September 2011 - 08:39 AM

I'm a noob :laugh: and I haven't a clue how to make this!
Please give permission to mod it if we give you lots of credit and don't enter it in anything!


Everything submitted to the turorials forums is for using! The idea is that you take it apart, learn from it then put it back together again in your own games, or create your own version based on this... so go ahead, but remember that CREDIT is an important part of the tutorials forum and so thank the member in your game for their help/engine/whatever... Posted Image
  • 0

lz6lxdC.pngd7ZQQ3F.gifFlvJzyf.png

40799.png


#99 NestoFlo

NestoFlo

    GMC Member

  • GMC Member
  • 460 posts

Posted 05 November 2011 - 02:50 AM

Great job! My father wants me to learn GML and coding, so this will definitely help out!
Its way better then hitting the apple haha.
  • 0
Posted Image

Rate this topic: 0 | 1 | 2 | 3 | 4 | 5

#100 LVSF3

LVSF3

    GMC Member

  • New Member
  • 1 posts
  • Version:Unknown

Posted 12 November 2011 - 10:01 PM

I don't know why I'm getting this error:

dist = point_distance(x,y,target.x,target.y)/24;

at position 47: Unknown variable x

(second x variable)
(in step event of bullet tower)

Please help!

Edited by LVSF3, 12 November 2011 - 10:09 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users