Forums

ForumsProgramming Forum

mapping problems with flash

Posted Apr 29, '08 at 9:22pm

ZeroUltimax

ZeroUltimax

10 posts

I've recently started creating flash games, and i've encountered my first barrier. I'm currently making an RPG style of game.The battle system was pretty easy and the movement programming too, but let me explain my problem more in details.
I want my character to stay in the middle on the screen while he walks, not having to create a side scrolling game like zelda.i want my maps to be like final fantasy (the first ones)
one of my first idea was to mouse the map aroun the caracter, but it didnt work as well as i planned. can anyone reffer me to someone else or to a tutorial on this subject. please no "go look up rpg flash tutorial on google"
i tried and it was irrevelant. thank you all

 

Posted Apr 29, '08 at 9:38pm

ZeroUltimax

ZeroUltimax

10 posts

yeah, i was pretty much expecting this as a reply, thanks a lot. im going to get in contact with him as soon as possible, but right now, im getting tired of computer, after all, 5 hour/day is tireing. of course, a genius like him must be busy too, bothered by everyone. ill find a way to talk with him, but if anyone else has suggestions, go ahead

 

Posted Apr 29, '08 at 10:02pm

dank

dank

1,043 posts

Knight

There are two ways to accomplish this: One, move the background instead of the map, or two, use the Flash V-Cam and make it follow the player.

 

Posted Apr 30, '08 at 1:08pm

ZeroUltimax

ZeroUltimax

10 posts

care to explain more about flash v cam?

 

Posted Apr 30, '08 at 7:56pm

ZeroUltimax

ZeroUltimax

10 posts

well dank, thanks for you post. i looked up V cam on google and i found it. i was thinking that there might be a way to integrate the code to character itself. after a lot of thinking, trail and error and testing, i came up with this code. (It's v-cam's code modified so it follows the character and leaves the screen the size of the stage.
to use it, you must make a new layer in the movie clip that you want to be followed. you should call it camera.
select the 1rst fram and insert the code bellow into it.

function camControl() {
    _parent._x = cX-(this._x);
    _parent._y = cY-(this._y);
}
// Capture stage parameters
var cX = Stage.width/2;
var cY = Stage.height/2;
// Make the stage move so that the
// v-cam is centered on the
// viewport every frame
this.onEnterFrame = camControl;
// Make an explicit call to the camControl
// function to make sure it also runs on the
// first frame.
camControl();

if something doesnt work out right with it, just ask me and i'll help you
thanks again dank

 
Reply to mapping problems with flash

You must be logged in to post a reply!