TowerDefence.net Forums
Home
Forum
Contact
Search
Go Back   Tower Defence Forums > Tower Defence > Code Forge

Code Forge Share your coding problems with the rest of the community, and help other people overcome the same problem's you have.

Reply
 
Thread Tools Display Modes
Old January 17th, 2009, 11:54 AM   #1
lepape
Cannon Tower
 
Join Date: Jan 2009
Posts: 10
lepape is a normal user
Default Game maker Tower Defense - HELP!

Hi,
I'm currently trying to make a TD game using Game maker, and well, I'm a total newb. There's tons of things I'm trying to figure out how to do, but there's mainly two questions I have, so I thought I might get some good help here.

First, about enemies. From what I understand, most TD games only have one object being used for every wave, it's just the sprite of the object that's being changed. That way, towers can always target "obj_enemy", for example. What I'd like to do would be to have many enemies with different behaviors. For example, one enemy would deflect all projectiles, another would spawn smaller enemies upon dying, etc. Should I use multiple enemy objects in this case, or should I add tons of variables on the same "obj_enemy" for all possible behaviors?

Also, I'm trying to use some grid system when building towers, so the tower would only move one square at a time when placing it. I tried to find info on how to do that, but I'm wondering if that's even possible in GM.

Thanks,

Last edited by lepape; January 17th, 2009 at 12:00 PM.
lepape is offline   Reply With Quote
Old January 17th, 2009, 01:34 PM   #2
The Noid
TowerDefence.net Game Project Developer
Points: 6,439, Level: 36
Points: 6,439, Level: 36 Points: 6,439, Level: 36 Points: 6,439, Level: 36
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
The Noid's Avatar
 
Join Date: Feb 2008
Posts: 901
The Noid is a normal user
Default

I'm not sure how GM goes about interfaces and inheritance, but in "normal" object oriented programming languages you would make an interface "Enemy" that list the properties that every enemy type has, like hp, location, speed.
For each different enemy type you would make a class "SpecificEnemyX" that implements the interface "Enemy".
That way your targeting routine would know that SpecificEnemy1 and SpecificEnemy2 both have the features listed in Enemy.
The Noid is offline   Reply With Quote
Old January 17th, 2009, 09:46 PM   #3
Slogsweep
Cannon Tower
Points: 795, Level: 13
Points: 795, Level: 13 Points: 795, Level: 13 Points: 795, Level: 13
Activity: 23%
Activity: 23% Activity: 23% Activity: 23%
 
Join Date: Jan 2009
Posts: 11
Slogsweep is a normal user
Default

And possibly an Abstract class inbetween where you'd write the generic enemy code
Slogsweep is offline   Reply With Quote
Old January 17th, 2009, 10:12 PM   #4
Fireblade
Red Tower
Points: 4,668, Level: 31
Points: 4,668, Level: 31 Points: 4,668, Level: 31 Points: 4,668, Level: 31
Activity: 15%
Activity: 15% Activity: 15% Activity: 15%
 
Fireblade's Avatar
 
Join Date: Aug 2007
Posts: 442
Fireblade is a bad user
Default

yes, u can use grid with the towers, read 1 of the tutorials about that mazish game on yoyogames.com , i cant help u personaly right now because i havnt gotten gm after i got my new 500gb
__________________
Fireblade is offline   Reply With Quote
Old February 3rd, 2009, 07:25 PM   #5
Sammual
Tower
 
Join Date: Sep 2007
Posts: 3
Sammual is a normal user
Default

I was working on a GM TD game a while back. Now that I have time I'm planning on getting back into it. If you want any help just let me know.

Sammual
Sammual at juno and then dot com
Sammual is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New Game Yet Another Tower Defense Game aguydude General 2 March 6th, 2009 09:34 PM
Tower Defense Game Maker Sim Code Forge 11 August 12th, 2008 07:47 PM
Game Maker Tower Defence tut Fireblade Code Forge 13 June 15th, 2008 10:17 PM
Getting a Tower Defense game listed JoshuaJewell Questions Assistance/Feedback 7 February 13th, 2008 03:04 AM



All times are GMT. The time now is 11:19 PM.
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.