Question

Edit: Is there any way to adjust the stage size and position from inside flash?

Hey Im making a flashgame right now, its a 2D game with 2charakters. You can move them right now trought the level as you want to, but my problem is, its only one fourth of the whole level displayed, so I thought about making a camera that moves along with the player.

Ussualy I would put all the level content into a container and move the container, but my problem is, that I have 2charakters which can move and the camera has to focus on both of them otherwise the second player cant see what he is doing. So I thought about scaling the background and the characters up at the same time to create a zoom in zoom out effect depending on the distance between the players, but scaling the charakters up is pretty complicated because the charakter does not only consists out of one movieclip.

Was it helpful?

Solution

Put the level content along with the players in a container. Continue doing all the usual logic needed for the game, but instead of moving the level content; move the characters.

Then for each frame, adjust the scale and position of the new outer container based on the position of the two players.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top