PDA

View Full Version : Vcam question; should I use one?



coldementia
September 4th, 2008, 02:45 PM
I'm currently designing a sort of RPG adventure game as a Christmas present for my wife. The games stars her as the main character and takes place in Virginia Beach where we had our last vacation. Anyways, I wanted to open the game with a sort of separate "minigame" involving driving in which the player has to find their way to the hotel. This would have an "overhead" view, like the old Grand Theft Auto games, with scrolling terrain and the vehicle staying put in the middle of the frame. Now, my first thought was to create the driving level as one giant movie clip (probably 10x the size of the game screen) and move the clip underneath the vehicle accordingly as the game is played. But I figured this would lag like crazy, and then I stumbled upon the vcam system. Should I use a vcam and just have it pan around the large level clip, rather than try to move the clip around as you play? Also, if I did this, would I then have the vehicle be INSIDE of the vcam clip so that it will remain centered on the screen and the same size throughout? Your thoughts are appreciated.

coldementia
September 4th, 2008, 03:01 PM
Also, I should mention that this game is completely art based. I know when doing a tile based game there is the method of having tiles load/disappear dynamically to avoid bogging down the system but that won't do in this case.

SparK_BR
September 5th, 2008, 08:06 PM
if(Key.isDown(38)){
_root.car.speed += _root.car.acel;
}
if(Key.isDown(40)){
_root.car.speed -= _root.car.acel/1.2;
}

_root.car.speed *= 0.9;
_root.map._x -= _root.car.speed*Math.sin(_root.car._rotation *Math.PI/180);
_root.map._x += _root.car.speed*Math.sin(_root.car._rotation *Math.PI/180);


I would give you the code for making the car cornering proportional to the speed and wheel angle but I must go home now...

later i will give you a .fla

bluemagica
September 5th, 2008, 11:17 PM
Hmm, coldementia, in your situation Vcam will be pretty much useless. If i think of a old gta map, then vcam will work by zooming in on a small picture which will be small enough for memory but large enough to be a city when zoomed in. But vcam works by scaling the image, so there will still be a considerable amount of quality loss! And again, whenever you keep content off screen, that is not needed, it is a problem for memory! I really think you should go for tile based approach! But even if its not possible for you, then better than using vcam, make you city map in parts, and attach them on stage as necessary!

coldementia
September 6th, 2008, 01:13 PM
Thanks for all your help! I got sidetracked and am now working on finishing the custom clothing section but I'll be back to this soon enough.