Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Tower of Defence

Author
Message
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 24th Sep 2010 21:32
Is it possible to make my own tower of defence game in darkbasic pro?

Hey im Jon
T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 25th Sep 2010 00:43
sure, your imagination is the limit

*happy coding on his 3D Construx Editor*
CocaCola
14
Years of Service
User Offline
Joined: 23rd Mar 2010
Location: CocaCola.x CocaCola.y CocaCola.z
Posted: 25th Sep 2010 05:33
Quote: "sure, your imagination is the limit"

Well, yes, if you learn how to program/script it you can do anything.

I want coke, not Pepsi!
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 25th Sep 2010 11:54
But i thought it was just flash that you could make it in? But ill look into this

Hey im Jon
T4r4ntul4
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: close to my pc
Posted: 25th Sep 2010 23:19
you can make 2D and 3D games in dbpro

*happy coding on his 3D Construx Editor*
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 25th Sep 2010 23:53
Ahh yes true, im pretty sure the enemies (AI) will probably be the same as the AI in my pong game, but i would need them to follow a path... and make them come in a few each time a round starts, and maybe a boss every so often, going to be tricky

Hey im Jon
Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 26th Sep 2010 06:12
Quote: "But i thought it was just flash that you could make it in? But ill look into this"


...
wha?

Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 26th Sep 2010 13:31
I know what you mean, Jon. I'm a huge tower defense fan myself, and have been thinking of writing my own. It is a bit different than the flash design method, but I may put together a little microtutorial using UDTs for the towers if time permits. Unfortunately, I've been working 7 days a week so I'll be busy at least for the next few days.
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 27th Sep 2010 00:07
I have always wanted to make my own Tower of Defense game, I thought it was easy when i first started playing them , Few years later i find out its not...
I could probably do the basics, as in, make the path that the enemies are going to follow, the ground where the towers can sit and something at the end that you pretect, just i wouldnt know on how to make the enemies follow the path correctly.

Hey im Jon
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 27th Sep 2010 03:34
Well, aside from a 10 hour drive to Detroit and back, I actually squeezed in some time to start an engine which I hope to comment and use as a tutorial. Not quite ready to show it yet, but I'd have to say in the hour that I have worked on it so far, I'm already half way there (aside from any media).

It's set up so you can define your own towers (ie; health,attack, images, and so forth. So aside from setting variables that you'll need, all you gotta do is pretty much give it some images to display. Give me a couple days and it should be ready.

Usually I only program theories and graphics demos... It's kinda a refreshing change to actually do a "game", lol.
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 27th Sep 2010 13:07
Aww awesome, ill wait =). lol, i made a game of pong the other day, confused me aloot, but i got it working and i have a unbeatable AI so far =)

Hey im Jon
Maxell Will
14
Years of Service
User Offline
Joined: 28th Sep 2010
Location: United States
Posted: 28th Sep 2010 12:21
i like TD.. and also dota. so you will build a new TD? thats great for you.
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 29th Sep 2010 15:09
Trying to build a new TD is the word atm

Hey im Jon
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 30th Sep 2010 14:29
Well, i have good news, and I have bad news... I got everything finished except moving the minions and I am being sent up to work at a steel mill for the next week or two. But unfortunately since ill be runnin anywhere from 12-16 hours days, seven days a week, this will have to be put on hold till I get back. I apologize again and I'll let you know when I get back. Work IRL isn't quite as fun lol.
apolo
13
Years of Service
User Offline
Joined: 30th Sep 2010
Location:
Posted: 1st Oct 2010 03:31
you can make 3D games in dbpro

http://www.gamecheatseeker.com/
Cheat Codes, XBOX cheat codes, Playstaion cheat codes
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 1st Oct 2010 17:59
Awesome thats good and no worries, i can wait, im actually working on a game in java atm, after searching 2 days for java i realised i can use Adobe flash cs5. Just give me a message when your back, im in no rush

Hey im Jon
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Oct 2010 23:35
Quote: "just i wouldnt know on how to make the enemies follow the path correctly."


You could place waypoints at each turn and constantly move the enemies in the direction of their next waypoint. Then, whenever an enemy reached a waypoint you would just tell him to go to the next one.


Guns, cinematics, stealth, items and more!
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 4th Oct 2010 11:33
So really all i would need is the x and y co-ordinates?

Hey im Jon
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 5th Oct 2010 08:39 Edited at: 5th Oct 2010 15:37
Well, I'm about done with this for now. Here is a screenshot attached. I haven't commented it out too well yet but I figured it would show you how to do a few different thing. It started getting a little unorganized toward the end but I think it is still fairly readable.



Attachments

Login to view attachments
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 5th Oct 2010 08:49
...And here is a ZIP with the source code and exe. My little demo isn't well balanced, but you can choose a wave by pressing the number keys 1 through 0 to activate different difficulties in waves. After completing a wave, you can choose a new wave or replay old ones to earn more money/towers. To make things more interesting, the price for towers inflates everytime you buy one. If a single Floating Eyeball minion makes it past the path the game exits and you lose. Have fun!

Attachments

Login to view attachments
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 5th Oct 2010 10:39
If not using a pathfinding method, the Waypoint idea is a good way to go, though you could make it more interesting by making for example three differently placed points at each stage, and the units would choose one from the three randomly, so they don't go in a single line, and the game becomes harder to beat.
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 6th Oct 2010 18:54
Wow, thank you, im going to look through the code and try make a similar gamne

Hey im Jon
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 6th Oct 2010 19:52
No problems I actually kept rewriting it about 20 times because I started making it too feature heavy, and i did take a couple shortcuts here and there but it shows you the basics. The final write took about 20 minutes, lol. I was even pleasantly surprised with my programmer art, lol.

I decided to start a 3d Tower Defense next. This one will actually use lua scripting to add minions and tower types tho, so it will allow for more options, as well as creating your own Tower Defense game without touching DBP.

If you run into anything you need explained, just lemme know.
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 6th Oct 2010 20:24
lol, your art looks quite good on the screenshot you provided, just too bad i couldnt see it on my pc.

Just had a look through the source, i understand pretty much 3 quarters of it, but this bit confuses me..
if timer()>mData(minion).delay and sprite exist(minion+100)
XD#=sprite x(minion+100)-pData(mData(minion).dest).x
YD#=sprite y(minion+100)-pData(mData(minion).dest).y
Ang#=0.0-ATANFULL(xd#,yd#)
rotate sprite minion+100,int(ang#)
move sprite minion+100,1

I havent done any coding in DB Pro in about 2 weeks now, think i need to start doing some little programs to refresh my memory

Hey im Jon
Coldfire
15
Years of Service
User Offline
Joined: 22nd Oct 2008
Location: Indiana
Posted: 6th Oct 2010 23:30 Edited at: 6th Oct 2010 23:33
Well, the minions are created all at once. Then, I add a delay value that is timer()+(minion number * delay, than when timer() is > then that, they are free to move. This was just an easy way to determine how far apart they are spread. Of course this could cause unknown side-effects if played through midnight, lol. I suggest looking into a real timing solution. That would be one of the shortcuts I mentioned lol.
Jon4433
14
Years of Service
User Offline
Joined: 22nd Sep 2010
Location:
Posted: 7th Oct 2010 21:29
Ahhh, thanks

Hey im Jon

Login to post a reply

Server time is: 2024-09-28 22:28:10
Your offset time is: 2024-09-28 22:28:10