Hello World

Practical programming... and stuff...

Nooo I missed!

,

Ever play Scorched Earth?

How about Worms?


Fun games, yes.

I'm working on a similar game widget, namely TankWar. It's quite intresting how much you can do with just HTML and JavaScript these days.



Now, here comes the best part: Online play. The latest development version of TankWar has working online play for up to 8 players. And I can say it's fun bigsmile


There are still some things that I need to add to it though... Only the Cannon weapon works online as weapon changes aren't sent over the server to others, but that should be easy to add. Other things are minor UI tweaks, like adding a chat inside the game and "Leave" button for games.



There are few other issues with the game too... it seems that Opera 9.10 causes the game freeze at the main menu, which can be fixed by zooming in or out once.

Also, the tanks sometimes hover in the air. This is, however, caused by the checkCollision function which is built-in in Opera. Sure, I could possibly look into the issue of detecting whether something is inside a convex polygon with circles etc. but it would be very slow if implemented in JavaScript in a widget.

Let's just hope Opera will fix the checkCollision function sometime so the tanks will stop hovering.


Well, to be completely honest I do have an idea which might fix the issue... but implementing it would require more code in the game, a lot. Also, it would probably slow down the hit checks too, as it would require more checkCollision calls.

The way it is now, the terrain is drawn like this: The code creates a path on the canvas of the "clear" area, the sky and fills it with light blue. It draws the whole sky like this at once.

Now, when the shape is complicated, this apparently causes some issues with the checkCollision method. The way I was thinking of fixing this would be to split the sky path into smaller paths. This way no path would contain very complicated shapes and hopefully the checkCollision method would work properly.

Multiple paths would, however, cause some more issues: when you shoot, it would have to check if the shot has gone outside MANY paths instead of just ONE. This might increase the load and slow down the framerate. It would also require more than one "hole" in a case where a shot would land close to the borders of two paths.


And added to all of that, it might not even fix the original issue. So I would rather wait for Opera to fix the bug in checkCollision.

It's out!TankWar Online technical stuff - part 1

Comments

Janizomg Friday, January 5, 2007 3:28:50 AM

I wonder if I should continue my blog at blogspot (or start writing more here)... I didn't intend to write that much o

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies