It is really hard to get back to the project that was paused just for a few weeks. I was busy with new major update of Apndroid so my game came out of my mind after I finished the prototype that I mentioned in my last post. I did almost nothing yesterday, basically just refreshing the codebase in my head, thinking what's next.
Today I have spent few hours coding and I am leaving off my computer exactly at the time when I was most excited to continue. This is one little advice from Woody Allen that I realized I was doing often. Together with the tip to work only for three to five hours, but every day, it sounds like a good idea. If you are interested in more tips, read the rest at TechCruch.
First problem I had to solve was the screen size and the projection. The game will run on many devices with different screen resolutions and aspect ratios. I never liked the idea of stretching content so I had decided that I will use all the screen size offered to me and world system units will be mapped 1:1 to screen pixels. That means that OrthographicCamera will cover the whole world with its viewport. There is one more reason for that - every shootable target in the game will have attached text to it and I have found that resized or stretched texts don't look good. With pixel perfect projection it looks and moves nicely. To keep the same experience to players on all the different screens I will adjust the speed of targets, so they get to the shooter in the same amount of time.
While I was adjusting the speed of shots, some of them simply didn't destroy the target when the speed was higher. The problem was obvious - I was using bounding rectangle based collision detection and from certain speed the shot simply overshoot the target. One frame ot was before the target and on the next frame it was after. I fixed that quickly by simply comparing the distances from cannon to target and cannon to shot. This is quick dirty fix and I have to read more about how this should be solved properly, whether I should use box2d or something similar or whether it is overkill for this kind of game. There are so many areas of the game development I know nothing about, that it is quite scary sometimes. Throw your ideas on me!
I want to go quickly through the tools I used so far:
- IntelliJ IDEA free Java/Android IDE that is fast and smart. You will never look back at the Eclipse.
- Adobe Fireworks €299(ex VAT) graphics editor for bitmap and vector work that I use for all my work, from icons to promo graphics and now also game objects
- Glyph Designer $29.99 font designer for Mac that just works
- libGDX TexturePacker free texture packer that you can integrate to your project, set the source folder with bitmaps and it will produce the sprite sheet