Im an old coder who came back so to speak, learning Java I know what I want but I cannot find anyone asking it anywhere so here goes...
Im writing a basic tank game to code for practice but as is always the case my personal ambitions out pace my abilities.
Ive been reading up on the various methods used for collision detection using rectangles and point testing around the sprite for collisions but it all seems a little hap hazard and processor heavy to me.
I was thinking maybe a method would work by which I could logically compare two sprites -
So maybe I have a tank(me) and I come to a tile which is meant to be wall. OK so I can compare the square from an array and look up what type of tile is there and prevent movement in that direction, but again Im not happy with this because its not accurate enough. I mean what happens if I want that wall shootable, where it goes through several stages of destruction before its turned into a fully traversable square, it may have a few bits un-destroyed and I want to be able to detect even this.
So how about if I created a tank mask, black and white and grab the square the tank is entering and logically AND it with the tank sprite, creating zero unless a pixel appears in both locations, in which case it hit something.
Is this clear enough?
Do you think this would work and which coding direction do you recommend, Im still new to the syntax but as you can see I know what I want....I think!