PDA

View Full Version : Tower defense game


Lordcorvin
07-04-2011, 06:10 PM
Ok guys I made a tower defense game
Please review it's my first game

Instructions: Kill 10 heli and 10 tanks
click on target and choose a tower you want

Its easy to beat but you can increase their health in helicopter and tank properties

Please review my code and tell me if I could have shrank it down


5145

Lordcorvin
07-09-2011, 04:32 PM
Really no one to review?:(

InsertName
07-09-2011, 04:52 PM
I'll check it out later.

Lordcorvin
07-12-2011, 10:40 PM
Thanks

DensetsuNoKaboom
07-13-2011, 08:18 AM
It was quite hard. The only major problem I noticed was, how do the turrets decide what to target?

Dexor
07-14-2011, 02:30 PM
Hi! I really like tower defense games, so this intrigued me.

A few things that I noticed right away that I hope might help you.
Of course, with all opinions on the internet, take this with a grain of salt. ;)

1. Do not code in the event editor!
What I mean by this is, create methods that go into events so that it is cleaner to read and debug.

2. For World.monitorHealthandMoney, you call it again at the end, creating an infinite recursive loop. While this may accomplish what you are aiming for, it's a bad practice. Instead, you should use a while loop that is always updating that information while the game is running. That gives you more control over it as well.

3. You have a lot of interesting programming practices that can probably be slimmed down by taking a look at your code and seeing what actions you are repeating over and over. For example, in world.kill you, in a Do Together, check if health > 0 for multiple items, which would be the same thing as if you moved that check out of the Do Together and put it before it, removing a level of nesting.
Reason I mention this is because you asked for ways to slim it down.

4. Finally, the game crashes, due to an out of bounds exception. I'm not exactly sure where it could be happening because there is a lot of code to look through. It would be great if the code was commented.
Even if you know what the code is doing, when asking others to review your code, it's INCREDIBLY helpful to have comments stating what each part and method is doing. It's just a good practice to get into. :)

Hope that helps out a bit, I was looking for a good place to do my first post here, so I hope that works.
-Dx

atrane365
05-03-2012, 10:51 AM
3. You have a lot of interesting programming practices that can probably be slimmed down by taking a look at your code and seeing what actions you are repeating over and over. For example, in world.kill you, in a Do Together, check if health > 0 for multiple items, which would be the same thing as if you moved that check out of the Do Together and put it before it, removing a level of nesting.
Reason I mention this is because you asked for ways to slim it down.
-Dx

Or, if you place (or have placed) the items in the world.kill Do Together in a list, you can do a For All Together, thereby reducing it to between 5 and 10 lines of code, instead of however long it actually is:rolleyes:

atrane365
05-17-2012, 11:32 AM
i know this might not get answered, but how do you get it to where the tanks and copters still move even when they get shot?

zomdie
05-27-2012, 01:15 PM
Ok guys I made a tower defense game
Please review it's my first game

Instructions: Kill 10 heli and 10 tanks
click on target and choose a tower you want

Its easy to beat but you can increase their health in helicopter and tank properties

Please review my code and tell me if I could have shrank it down


5145 wt doesent work reatard

x2495iiii
05-27-2012, 01:19 PM
wt doesent work reatard

I'm guessing you mean "It doesn't work."

Except it does.

And how do you spell "retard" wrong? Seriously?

zomdie
05-27-2012, 01:20 PM
:eek: