PDA

View Full Version : Tank Combat 2


warhammerdude20
06-15-2005, 09:56 PM
Hey all,

I figured I would post my newest game Tank Combat 2 for you to
comment on. Its a 2 player tank game where you get to choose you tank
body and tank special weapon. 3 of each. that makes about.... 3*3=9
possible tank combinations!

Read the readme before you play. No one has played tank combat 1 because
its a piece of crap...

so heres the link, and if you play it, please comment.

www.javascript-games.net/games/tankCombat2.zip

And dont worry all you 800x600res people, the game will fit.

Kor
06-16-2005, 10:37 AM
quite nice as a javascript application. What about a variant for Moz?

warhammerdude20
06-16-2005, 06:03 PM
I don't know much about mozilla, but I doubt it. As far as I know only ie supports HTML apps

Kor
06-17-2005, 08:35 AM
I don't know much about mozilla, but I doubt it. As far as I know only ie supports HTML apps
Second time in the last 3 years Mozilla Firefox was The Browser of the Year. I guess that about 20% of the users have now Mozilla, so that you may start thinking about crossbrowser solutions... :thumbsup:

warhammerdude20
06-17-2005, 02:19 PM
....

Does moz support HTML apps? If not, then how can I even consider it?

Kor
06-17-2005, 03:19 PM
It uses it's own.

glenngv
06-24-2005, 02:52 PM
Cool game! :thumbsup: :thumbsup: :thumbsup:

I just noticed that it hangs for a while if the user presses the controls very fast. Then after a while, it highlights the whole page and continues to move again. I noticed also that the weapons and bodies reset to default after every game because you just reload the page. It's better that the last selected weapons and bodies will still remain. To solve it, store the selected weapons and bodies data in window.name property. That property is persistent, it exists until the window is closed.

The only thing I don't like about it is the use of the dreaded eval (http://www.codingforums.com/showthread.php?t=20143) when dynamically accessing images. 99.99% of the time, eval is unnecessary and using square bracket notation is the more efficient solution.

For example, these:

eval("player"+player+".body="+num);
eval("window.document.player"+player+"tankbody.src='sprites/p"+player+"b"+num+"U.gif'");

can be changed to:

window["player"+player].body=num;
window.document.images["player"+player+"tankbody"].src="sprites/p"+player+"b"+num+"U.gif";

This could probably solve or at least minimize the "hanging" bug. Benchmarking (from the dreaded eval link) done by liorean on exactly the same code showed eval is 5 times slower in IE than using the square bracket notation.

See my sig for more info on square bracket notation.

Kor
06-24-2005, 02:57 PM
korekt ... I have the same feeling about the eval() method. But I have appreciated mainly the nice ideea of the game, regardless the code... If time, I'll think of a crossbrowser solution and a shorten of the code...

Single Paradox
06-25-2005, 06:11 AM
Man! I really like your games!! Your website is uh, a little lacking. Can I make your website? Free of charge. I don't really have a project to work on right now and I am a fan of your javascript! If you want me to, hit me up at 2mas@singleparadox.com (don't rate my capabilities by singleparadox.com, I haven't uploaded the new design I've been working on). Please think about it!!! I'd love to help with your site. If you don't want me to know your ftp password, then I will make the code and you can upload it. Like I said, email me or talk to me on AIM, my aim is SingleParadox.

tyranic-moron
08-26-2005, 10:18 AM
Great game! I've made a few maps and some new graphics already. I found out why the screen gets highlighted - if Ctrl+A are pressed at the same time, thats the shortcut for select all! Maybe you could change Ctrl to Space? That should solve the problem.

Canuck WebGeek
09-15-2005, 07:33 PM
if you use AJAX'y stuff instead of the ActiveX filesytem object (or even a hidden iframe) to load your maps, then you don't really need to make an HTA.

also, look into xul apps. it's sort of the "Mozilla" version of hta.