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 element exists
Code: [Select]<?xml version="1.0"?>
<Addresses>
<

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

parsing error
can anyone explain this syntax error:

Parse error: syntax error, unexpected T_IF

The e

this code is not working????
it says this error.. Warning: Division by zero in ..

the variables are correct, so why is th

Simple Variable Question
Hi everyone.... again,

I am really getting into php still. Learning more every day. I love it

how do i make new line after *
First check this page here. and you see my report. Im pulling form a mysql db. I want to beable to m

Error in write byte array into document in SM58
Hi Gurus,

Getting the following error status in Transactional RFC (SM58) ..... *Error i

PHP Session Issue
I'm having an issue with one section on my website dealing with sessions. Now I know that myself and

upload control not working with update panel
Hi,

I am working with Asp.Net FileUpload control with ajax update panel,

if i use the

PHP & Java
Hello,

can PHP code be used inside java code?

Code: [Select]<SCRIPT LANGUAGE=&q

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