I’m abit confused, why are you adding the transparency once the image is loaded?
What is wrong with having the transparency defined in the palette for the image itself?
Why are you trying to set the transparent colour AFTER rotating the image? Shouldn’t you do that to the car image once after loading it, then make rotated copies of the image that has the transparency already set?
Also note that when you make an image on Mac that you get a TRANSLUCENT image not a BITMASK image, if you don’t specify, simply specifying the type of transparency that you expect may fix it.
I think somehow the check you have for the transparent colour using “==” fails near the edges because of this.
For some reason i am getting a black/grey bar at the top of the rotated images if i set the transparency before rotating… I know it is stupid but if i change the transparency after the rotatiing this bar is not present.
however since i now create an image from embedded data instead of loading an external gif this problem of the bar appearing on the rotated images may no longer occur.
Hmm… img1 returned from the ImageIO.read() will be 32 bit probably. The way the Mac graphics pipeline does the rotated blit it will likely get anti-aliasing. I did test on Mac with Sun’s graphics pipeline (only possible with recent developer previews) and the halo went away.
Now using both embedded graphics and embedded maps for tracks
I am now able to use pre-generated transparency making the code foot print for the car graphic generation smaller. This should also get rid of the haloing for Mac users… i hope.
The embedded tracks are stored in a stream format rather than as a bit map. This was done for two reasons:
it is likely that track tiles which are connected to each other will be identical and so it helps compression to keep them together.
the tile stream is stored in order of the track should be completed when racing. This will help keep the AI opponents going the correct direction.
However I am currently running low on bytes with the current version when kzipped gives 3924 bytes giving only 172 bytes to code in AI opponents and some crappy physic model for sliding around corners… It is going to be interesting :-\ I may have to remove some graphics.
I have uploaded the new JARs and source code. Can some one suggest an area or a trick where i might be able to save some bytes for the AI code?
I’m very interested to see where both our games end up.
As your’ve mentioned, your current control setup is only for development. You’ll find when the physics are in, using one hand to accelerate, brake and turn is a little too hard.
Now i’m cursing myself I didn’t pull my finger out early and actually post something before you.
What you see posted on my wiki is very out of date now, since that version i’ve been completely redoing to graphics. My screen now pans and zooms in and out a little depending on the speed of the car.
Good luck on trying to get opponents implemented. I gave up early on that.
Anyway, now I’ve got some extremely close competition to bet. Goodluck!
My game is tile based so panning and zooming is out of the question (tho would be nice!)
I think i will no longer go with a “proper” physics for the car and instead go with a heuristic psuedo-realistic physics model for the car so you version will probably be better in that aspect
My game will definetly have opponnents (I have a very simple AI semi-working at the moment) tho whether they will be a challenge is to be seen.
The car graphic takes quite a bit of room, but I think it really adds to the game so I am trying desperately to keep it in.
I cannot access your game at work so I will fire it up at home.
I look forward to your completed racing game, you are correct: it will be interesting to see where both games end up.
I thought i recognised the name moogie. When you said your still at work, I though oh ok similar timezones to me. Peter posted his buggy game not 4 or so days ago. He sits like across from me at work. I remembered someone answer south australia to his anyone from australia question.
Ok this is officially freaky now.
Shit!!! I’m competing with a similar game to someone else in australia on a little know international java games comp.
In the nature of friendly competition I say let the best man win!
Mind due, I really am not entering the competition for the sake of winning, i just want to see what i could program into 4k and be of reasonable quality in both graphics and gameplay.
Yep, thanks to no collision detection yet, they get very close I am hoping with the addition of collision detection and the resultant elastic collision will cause the AI cars to sort them selves out. If there is room i will attempt to introduce some randomness to the skills of seperate cars, but i dont think that will occur
Well i have the AI sort of done… but no physics implemented… i am not sure how i am going to shave the bytes to get it all to fit in 4k…
I would love to see how your project has progressed.
Don’t laugh. In my mind it will all make sense in the end.
Oh yeah and the way in which that wiki returns the jnlp, it doesn’t report an updated codebase. So either clear your webstart cache or just run the jar from the download link.
The panning does defintely add to the game. Pity my tile-based game means that I cannot easily perform zooming…
hmm… i wonder if i might be able to make a pseudo-panning mechanisme by generating discrete levels of zoom for all the graphics… It will probably blow out the byte cost imeplementing it…
If i am going to go own that road i would pre-generate all the graphics… sure it may increase the memory use… but there was no limit on that was there?