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

How do I use a global footer..?
If my index.php has a bole bunch of if functions and exit's in them

Is it possible to view php source code??
Hi All

I was just wondering if it's possible to view a websites php source code?
I know

Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s

generating random codes
Hi guys n gals,

I have a requirement to generate 250,000 unique codes...

These codes a

pspell
using pspell, is it possible to get words that would be best in the current phrase?

For examp

rename the file
File.txt

Code: ***DOCUMENT***
..DN:
000044255
..CB:
..SN:
..PY:
2009
..E

Executing an exe
Hi. I have some bizarre problem with exec (other any other method) to launch exe's. I am making a ga

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


print_r($array);

Prints:
Code: [Select]Array

need help in update query
hi
i have a dynamic form. i need help in how can i use update query when values from dynamic for

multipart emiail forms
Hi All,

I am new to the boards and I've been working on a form (which is rather massive, imo

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