Friday, 7 January 2011

miTanks, Part 5

Here's a some pics of what I've got so far for testing.

Support for an arbitrary amount of players. They are actually all human controlled at the moment.

In this one you can see the error with damage. You can see it has broken one line correctly. But hasn't done the others.

 If anyone can help me with code formatting on here let me know. Here's a screen of it. Lol.

ground is a 2d array of size game_width x game_height. All the others should be self explanatory.
When it prints we see:

Destroy: -5, 0
Destroy: -4, 0
Destroy: -3, 0
Destroy: -2, 0
Destroy: -1, 0
Destroy: 0, 0
Destroy: 1, 0
Destroy: 2, 0
Destroy: 3, 0
Destroy: 4, 0
Destroy: 5, 0

So for every x, y = 0. But why! Should be something like. x = -5, y = 0; x = -4, y = 1; ...

[Edit: Found it!!

Not sure why I was scaling y by the bullet location... Removed this.bullet_x and this.bullet_y in the y calculation and it works. Too easy. Doesn't even look that circular... How to fix that?



  1. Sorry I can't help you out with the coding. It looks great so far. keep up the good work.

  2. I had already problems with some simple HTML coding. So i can't really help you.
    But keep it up.