Jump to content


Photo
* * * * * 1 votes

Tower Defense Game Tutorial


  • Please log in to reply
109 replies to this topic

#21 athanatos

athanatos

    GMC Member

  • New Member
  • 25 posts

Posted 20 May 2008 - 03:00 PM

very nice one :) i also edited the game but gonna give credit, i added these things
rocket tower
freeze tower
sound tower
light tower
two player towers
music

thats it so far


Ok very good! Tell me when it's finished, I'm surely going to play it :GM072: .
  • 0

#22 athanatos

athanatos

    GMC Member

  • New Member
  • 25 posts

Posted 09 October 2008 - 06:50 PM

OK people: this is a new version with an upgrade system. Hope you like it!
  • 0

#23 KymcoCobran

KymcoCobran

    GMC Member

  • New Member
  • 329 posts

Posted 09 October 2008 - 08:04 PM

were is the link ?

Edited by KymcoCobran, 09 October 2008 - 08:04 PM.

  • 0

#24 Chronic

Chronic

    Administrator

  • Global Moderators
  • 2713 posts
  • Version:GM:Studio

Posted 09 October 2008 - 08:15 PM

The link is there but host-a.net is down or something so the image link isn't showing up.
  • 0

#25 athanatos

athanatos

    GMC Member

  • New Member
  • 25 posts

Posted 10 October 2008 - 07:26 AM

Yes, I guess that was the problem. But now it works again.
  • 0

#26 ArchDD

ArchDD

    GMC Member

  • New Member
  • 11 posts

Posted 20 November 2008 - 07:33 PM

rly nice 10/10
that helped alot dude!
i never had so much fun playing a example before lol
got up to wave 170 with all red lasers at lvl5
  • 0

#27 the sivart

the sivart

    GMC Member

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

Posted 21 November 2008 - 03:00 AM

sweet ;)
  • 0

#28 Slickdc

Slickdc

    GMC Member

  • New Member
  • 176 posts
  • Version:GM:HTML5

Posted 03 December 2008 - 01:44 AM

Is it O.K if I use some of these codes (Altered a bit) in a game that I might sell if I put you (athanatos) in the credits?
  • 0

#29 Potado

Potado

    GMC Member

  • New Member
  • 401 posts

Posted 03 December 2008 - 03:26 AM

there is no gm6 version!
  • 0

#30 ninootju

ninootju

    GMC Member

  • Validating
  • 81 posts

Posted 26 December 2008 - 12:22 PM

Thanks for this wonderful tutorial!

I have one question; I just made some more towers, but whenever I try to click on the placed tower (to open the little menu, to upgrade / sell them), the menu doesn't show up, but the circle around the tower does.

What's the problem with this?

Edited by ninootju, 26 December 2008 - 12:22 PM.


#31 joffysloffy

joffysloffy

    GMC Member

  • GMC Member
  • 21 posts

Posted 03 January 2009 - 01:39 PM

Great tutorial!

In some posts before, I saw that a few people tried to reach the highest, reachable wave. Now with the new up-grade system, I tried that too and I reached wave 220 ^_^!
Max_level_TD_tutorial.bmp (1.2 MB)

I actually found some flaws in the tutorial with the depth. The bullets should have a lower depth, because they are underneath the towers, which looks really weird. And sometimes the laser of the lasertower gets underneath another lasertower, so that also looks really weird, but I think I have found a way you can solve that. Just check the distance to its target and multiply that by -1. So if a tower is next to the path and a tower is behind that one. Then the tower behind the tower that is next to the path will have a lower depth than that tower, so its laser will be on top of the tower that is next to the path.
I hope you hear what I am saying ^_^.

Joffysloffy.

Edited by joffysloffy, 03 January 2009 - 04:14 PM.

  • 0

#32 athanatos

athanatos

    GMC Member

  • New Member
  • 25 posts

Posted 17 February 2009 - 10:42 PM

Hello everyone, I'm sorry I haven't answered the replies earlier, but I'm no longer making games. That also means I'm not checking this forum anymore. I can, however, still answer questions about GM that have to do with TD games, but in that case you better PM me. I'm not sure if I'll visit the forum another time, unless I get a PM.
I'll answer the questions posted above.

Is it O.K if I use some of these codes (Altered a bit) in a game that I might sell if I put you (athanatos) in the credits?

Sure.

I have one question; I just made some more towers, but whenever I try to click on the placed tower (to open the little menu, to upgrade / sell them), the menu doesn't show up, but the circle around the tower does.

What's the problem with this?

The circle is drawn by the tower itself. But the menu stats are drawn by the controller. It might be possible that the 'ii_select' variable isn't set when you select the tower, since the tower stats, and the other buttons are only drawn if this variable is set correctly.

I actually found some flaws in the tutorial with the depth. The bullets should have a lower depth, because they are underneath the towers, which looks really weird. And sometimes the laser of the lasertower gets underneath another lasertower, so that also looks really weird, but I think I have found a way you can solve that. Just check the distance to its target and multiply that by -1. So if a tower is next to the path and a tower is behind that one. Then the tower behind the tower that is next to the path will have a lower depth than that tower, so its laser will be on top of the tower that is next to the path.
I hope you hear what I am saying tongue.gif.

You're right. That should do the trick. But the depth of the tower must be reset to its original value afterwards, and objects that might fly over the tower, like bullets or missiles, should have a much higher depth value (like 800 or 1000) or the tower will be drawn above them.
  • 0

#33 DarkLopo

DarkLopo

    GMC Elite

  • New Member
  • 803 posts

Posted 20 February 2009 - 01:43 PM

:lol:
___________________________________________
ERROR in
action number 1
of Step Event
for object btn_upgrade:

Error in code at line 4:
if controller.ii_select = noone

at position 20: Unknown variable ii_select

What to do? I did same things than you, but in the example it works, but in my game it doesnt.

Ps really nice game, 10/10 on tutorial : )) but could you help me? Same happens at btn_sell... : (
  • 0

#34 DarkLopo

DarkLopo

    GMC Elite

  • New Member
  • 803 posts

Posted 20 February 2009 - 01:46 PM

:(
___________________________________________
ERROR in
action number 1
of Step Event
for object btn_upgrade:

Error in code at line 4:
if controller.ii_select = noone

at position 20: Unknown variable ii_select

What to do? I did same things than you, but in the example it works, but in my game it doesnt.

Ps really nice game, 10/10 on tutorial : )) but could you help me? Same happens at btn_sell... : (


Problem fixed, forgot to add controller in room :lol:
  • 0

#35 Hardly

Hardly

    GMC Member

  • New Member
  • 40 posts

Posted 20 February 2009 - 05:23 PM

What do you say about people getting those codes and changing them?

I mean, about using your example as a base for a much higher detailed game.

I would give credit for sure
  • 0

#36 fligamaflogamus

fligamaflogamus

    GMC Member

  • GMC Member
  • 60 posts

Posted 25 February 2009 - 01:37 PM

Great tutorial!

Although I cant seem to understand how the enemy speed is being controlled.
I want to create a tower that fires blobs that slows the enemy it comes into contacts with, how would i do this?

Im using the free version of gamemaker 7
  • 0

#37 athanatos

athanatos

    GMC Member

  • New Member
  • 25 posts

Posted 28 February 2009 - 03:05 PM

What do you say about people getting those codes and changing them?

I mean, about using your example as a base for a much higher detailed game.

I would give credit for sure

If you give me credit, then it's okay to use it, even in a competition game (unless it's just a rip-off from this tutorial, it must be your own game).

Great tutorial!

Although I cant seem to understand how the enemy speed is being controlled.
I want to create a tower that fires blobs that slows the enemy it comes into contacts with, how would i do this?

Im using the free version of gamemaker 7

That's got to do with the path speed. The enemies don't have any 'speed'. If you want to change the speed with which they move through the path, you need to change the 'path_speed' variable.
  • 0

#38 fluidic ice

fluidic ice

    GMC Member

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

Posted 01 March 2009 - 12:55 AM

Haha! New Record, Beat this:
Posted Image
Yep i'm addicted too :P

I don't know how i could use this in my TDS, but I could make it into an automatic turret. . . . .

Nice Example though!

Edited by fluidic ice, 01 March 2009 - 12:58 AM.

  • 0

#39 DJ J4KE

DJ J4KE

    GMC Member

  • GMC Member
  • 141 posts

Posted 02 March 2009 - 04:36 PM

I've created a new type of enemy, How do I make it so that only that enemy can spawn in that room? All the enemies are spawning and I only want that particular one!

I have GM7 lite.
  • 0

#40 athanatos

athanatos

    GMC Member

  • New Member
  • 25 posts

Posted 07 March 2009 - 03:33 PM

I've created a new type of enemy, How do I make it so that only that enemy can spawn in that room? All the enemies are spawning and I only want that particular one!

I have GM7 lite.


You mean that you want the new enemy only to be created in a particular room, while the amount of enemies to be created remains the same? Then you could write this (in the script 'get_wave_enemies'):
//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
		{
			if (room == <the new room>)  instance_create(-32,0,<new enemy));
			else instance_create(-32,0,<old enemy));
			wave_enemies -= 1;
		}   
	}
instead of the code that was below "//Create enemies if needed for every array". If all enemies were created instead of this one, you probably forgot to use the 'else'-statement.
  • 0




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users