Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Tower defense game
Old
Lordcorvin
Senior Member
 
Lordcorvin's Avatar
 
Status: Offline
Posts: 59
Join Date: Feb 2011
Location: Hogwarts:)
Thumbs up Tower defense game - 07-04-2011, 05: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


Tower_Defence v1.a2w
   
Reply With Quote
Old
Lordcorvin
Senior Member
 
Lordcorvin's Avatar
 
Status: Offline
Posts: 59
Join Date: Feb 2011
Location: Hogwarts:)
Unhappy 07-09-2011, 03:32 PM

Really no one to review?
   
Reply With Quote
Old
InsertName
Senior Member
 
InsertName's Avatar
 
Status: Offline
Posts: 341
Join Date: Jun 2011
Location: In a house
Default 07-09-2011, 03:52 PM

I'll check it out later.


__№_₤⅞__
Handguns: http://www.alice.org/community/showthread.php?p=45349
MINECRAFT IN ALICE: http://alice.org/community/showthread.php?p=48208
My Stupid Animations: http://alice.org/community/album.php?albumid=119
   
Reply With Quote
Old
Lordcorvin
Senior Member
 
Lordcorvin's Avatar
 
Status: Offline
Posts: 59
Join Date: Feb 2011
Location: Hogwarts:)
Default 07-12-2011, 09:40 PM

Thanks
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 07-13-2011, 07:18 AM

It was quite hard. The only major problem I noticed was, how do the turrets decide what to target?


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
Dexor
Junior Member
 
Dexor's Avatar
 
Status: Offline
Posts: 6
Join Date: Jul 2011
Location: LC,NM
Default 07-14-2011, 01: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
   
Reply With Quote
idea
Old
atrane365
Guest
 
Status:
Posts: n/a
Default idea - 05-03-2012, 09:51 AM

Quote:
Originally Posted by Dexor View Post

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
   
Reply With Quote
Old
atrane365
Guest
 
Status:
Posts: n/a
Default 05-17-2012, 10: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?
   
Reply With Quote
Old
zomdie
Junior Member
 
Status: Offline
Posts: 3
Join Date: May 2012
Default 05-27-2012, 12:15 PM

Quote:
Originally Posted by Lordcorvin View Post
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


Attachment 5145
wt doesent work reatard
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 05-27-2012, 12:19 PM

Quote:
Originally Posted by zomdie View Post
wt doesent work reatard
I'm guessing you mean "It doesn't work."

Except it does.

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


(')>
   
Reply With Quote
Reply

Tags
alice 2.2, game, tower defense

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



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.