• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Retro games on Android - Need a steer

badkarma

Newbie
Hi all,

I am looking at making Nightmare Park for Android. Essentially I have already made it for Windows Mobile 5 (please see TheRealEasterBunny) and just need to convert it.

I have no problem with coding in Java for popping graphics on the screen and moving them around but am just trying to get my head around how best to start the approach of dealing with the different screen sizes on the various Android enabled gadgets out there and how to best code the app to prevent grief and and prevent 'fighting against the flow' of the SDK.

Essentially the game runs as if it were on an old "green screen" text screen with 40x25 characters on screen. I have created a "Character set" of 255 GIF files to hold the "Commodore PET character set" and each GIF is 8x8 pixels, so, given the "text screen size" then equates to 320x200 pixels in "old school screen size". However all is different with Android as it deals with screen densities amongst other things and things are not just "pixel straight forward" anymore.

I am happy to let the Andoid OS scale up from this 320x200 pixel formula (and stretch in any direction it sees fit to "fit to screen") so to use the whole screen. I just need to know what config I need in my config files to allow this (if its possible).

I have checked out information about dp, dpi, etc at Supporting Multiple Screens | Android Developers and am thinking if I could let my app think it has a screen of 320x200 pixels and then let the Android know via the config files of the app to "scale up as it sees fit" to the size of the actual screen, then this would be great.

If this can be done, does anyone know the best way of approaching it or configuring the app config files with the correct parameters?

Many thanks and apologies for the long post. Once I have the best method of applying the GIFs to fit full screen (as I say, stretching is not a problem), I can get cracking on porting the app.

Steve.
 
I have been doing some rummaging and I have come across fill_parent. Not sure if this is the easy option?

Also giving thought to putting 40x25 picture containers on screen in a "layout" then simply applying my GIF files to each of these as needed ("stretch to fit" picture container). I could then use a back end 2 dimentional integer array to keep track of what "character" is at what "position" (in which picture container) onscreen. Not sure what game speed-affecting performance would be on this though by using 1000 picture containers (with stretch image functionality).

Perhaps "Grid Layout" is the way?

I would however prefer a "Canvas" of 320x200 pixels, then for me to "paint" the appropriate 8x8 GIF image at a certain 8x8 offset in this "Canvas", and all the while, the Android OS is "stretching-to-fit" the 320x200 pixel canvas to the full size of the screen of the device being played upon.

Any pointers in the right direction for me to take before I start on a coding path would be greatly appreciated.

Thanks again.
 
Back
Top Bottom