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

Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious...
i.e. different device

Revoking alter any table from a schema
Hi All,

i am working in Oracle 10g.
my requirement is to revoke all kind of DDL oper

need help to creat database
Hello Team, please guys i am stuck from three days with paypal issue for IPN but no luck yet now i w

Protecting forms
Alright, I want to protect some forms of mine from SQL Injections, because I had someone earlier spa

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

MySQL noob question
hi guys

I have a simple mysql table set up, along the lines of

Col 1 - Col 2 - Date_l

PHP onsubmit in the form not going to the fuction.
I have a form through ‘onsubmit’ calling a function validation(). But not going to the

Open browser page depending on XML results
Hello,

I have some PHP code that sends webbased from data to an external url ( in the form of

Warehouse Management
Hi,

On our system, we have two storage locations ( A and B ) where A is the main factory

urldecode question
How would I format this line of code properly?

<?php echo urldecode($_GET['Title']); ?

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