00:00
00:00
Newgrounds Background Image Theme

SpeakyDooman just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

VCAM HELP! (AS3) 2015-01-18 17:35:43


Hi, I've got a working Vcam that follows the player and everything. There is also a bunch of info and text boxes that appear on the screen as well, that I want to keep in place while running the SWF.
However, then I run the SWF, the Vcam works, but it moves every single thing on the stage with it.
How can I make it keep certain things in place, and other things moving?

This is the code I have for the Vcam right now:

import flash.events.Event;
import flash.geom.Rectangle;

//----------------------------------------------------------------
//CAMERA EVENT LISTENERS

stage.addEventListener(Event.ENTER_FRAME, cameraFollowcharacter);

//----------------------------------------------------------------
//CAMERA FUNCTION(S)

function cameraFollowcharacter(evt:Event)
{
x -= (x-(((char.x+(char.width/1.7))-(stage.stageWidth/1.7))*-1))/10;
y -= (y-(((char.y+(char.height/1.2))-(stage.stageHeight/1.2))*-1))/10;
}


I'm not that good at signatures.

Response to VCAM HELP! (AS3) 2015-01-18 18:55:47


Don't use a vcam. Instead, put everything that moves together in its own container and move the container.


Programming stuffs (tutorials and extras)

PM me (instead of MintPaw) if you're confuzzled.

thank Skaren for the sig :P

BBS Signature