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?

Did you know?Explore Trending and Topic pages for more stories like this.
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

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

Email Script does not reach destination
Hey Guys look at this code snippet :
Code:
//read a line from the file

$myFile = "

How to form a xml form table with a single sql statement..?
Hi everyone,
I don't know if this is going to be a duplicate thread but i couldn't

Adding meta tags under Zend FW
Hello there, recently has come to my hands the FTP of a website which is running under Zend, I would

CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

Code Help.. If txt input box empty search X instead..
I am having a problem with my search script. At current it will simply search by a selected date whi

PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) a

Not connecting to DB using ruby, error:env.c:257:in oci8lib.so: ORA-12154:
Hi All,

I am trying to connect to the database server from the client server using ruby and f

Character Set Setup
Whats the best character set to use if you want every character to work, and also how do you make yo

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

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