How do I create a 2D game "camera" to follow player?


Posted on 16th Feb 2014 07:03 pm by admin

In J2ME programming I'm targeting MIDP 2.0 devices.

I'm using gamecanvas and I was thinking that I could create my full world (640 x 480) using a TiledLayer and then set the refpixel of the TilerLayer to the bottom right (thats where the player is going to start) and then draw it on the game canvas which I was thinking would be the full width/height of the phone screen. I can do this right?

Now my real question is... (yes I googled it but couldn't find it!) how do I get a camera like effect? Basically I want the psychical display to follow the player around in a world that is larger than the psychical display. Could I set the game canvas ref pixel to be center with my player?

No comments posted yet

Your Answer:

Login to answer
234 Like 17 Dislike
Previous forums Next forums
Other forums

array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_ma

There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from

IIS on 2003 anon access disabled issue
I have an IIS server that belongs to a domain, and anonymous access is turned off for all my sites.

form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for

Filtering an Array Based on Value
I have a very simple script set up that pulls data from a database and is output using this code:

PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot rede

PHP Captcha Error help - replace the "die" command
Hi All,

I am after a bit of help with a Captcha spam protection box.

The site gave me

Need understanding of this bit of code
Code: <?php
// WHERE clause filters
$arrSQLFilters = array();

//

Custom array sort? asc then desc
Any ideas how I could sort this array? I've been trying for a while. Maybe with usort, but I have no

Match stored value with the current value in a loop
Hello,

I have a MySQL db were I store articles in.

I have a form to fill these article

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash