;

PDA

Click to See Complete Forum and Search --> : One problem (of many to come)


rangast
10-30-2006, 05:28 PM
Alright, here's the deal:

I'm making a 2d side-scroller type game on flash 8 so I needed to impliment some form of moving camera. It works like this:

___________________
|111111111111111111|
|11111_______11111|
|1111|1111111|11111|
|1111|1110111|11111|
|1111 ---------11111|
----------------------

The 0 represent the player.

1 is blank space

The big square represents the background movieclip (its huge so i can pan it) and the small square is what can be seen when you preview the program (Where the white square is when you being a blank project).

The small square is bordered on each side by black rectangel movieclips which, when in contact with the player when its moving (aka, hitTest and a variable condition), will launch a function.

This function moves the background in the opposite dierection of the player at the same speed as the player so that it appears to be panning.

THe panning works perfectly, but if the background and the player move then, when I change game levels, the focus is lost.

basically this is what happens (using the previous example):

___________________
|111111111111111111|
|11111_______11111|
|1111|1111111|11111|
|1111|1110111|11111|
|1111 ---------11111|
----------------------
before

___________________
|111111111111111111|
|11111111________1|
|11111111|1111111|1|
|11111110|1111111|1|
|11111111----------1|
----------------------
after

So how do I get the camera to snap back to the middle (Where the white square is when you being a blank project)?

P.S: sorry for the complicated model, but it's a complicated problem. Ask me for further clarification if needed.

rangast
10-30-2006, 09:45 PM
No takers? Come on people, help would really be appriciated (and so would some spelling lessons -_-)

cancerinform
10-31-2006, 08:21 AM
You better clarify further. It's not understandable. May be you can show the movie online to see the problem.

rangast
10-31-2006, 10:37 AM
was afraid that this would happen -_-

i'll start a new post with the game file being played on youtube or something later.