Monster Racer Rush
Select between 5 monster racers, upgrade your monster skill and win the competition!
4.18 / 5.00 3,534 ViewsBuild and Base
Build most powerful forces, unleash hordes of monster and control your soldiers!
3.80 / 5.00 4,200 ViewsHello.
I am making a interactive map that zooms in when you click the stage and you can navigate around the map by moving your mouse in any direction and the map would follow.
How can I achieve this? I haven't actually started on this project but anything to help get me started on would be much appreciated.
Cheers
Use a v-cam. Here's a link. That should help you get started, if you need to know the actionscript for the movement just ask.
If you are reading this then you must be really bored.
You can use a vcam to do something like that... basically, it's a virtual camera that shows what is displayed under it. Link to Download. It's what Adam Phillips uses.
Then, you can make some sort of boolean on it that resizes the vcam with _xscale and _yscale or something like that.
on (mouseDown) {
if (boolean == true) {
boolean = false;
}else if (boolean == false) {
boolean = true;
}
}
onClipEvent (enterFrame) {
if (boolean) {
_xscale+=5;
_yscale+=5;
}else if (!boolean) {
_xscale -=5;
_yscale-=5;
}
}
Then, of course, you set limits to it to prevent it from going past a certain _yscale or _xscale.
if (_yscale < 100) {
_yscale = 100;
}
and such.
For the moving with the mouse, you can have something like:
onClipEvent (enterFrame) {
_x = _root._xmouse;
_y = _root._ymouse;
}
Note that all of this is untested, and if it does work, you can easily simplify and compact it. It's just an example.
postcount +=1;
Newgrounds Photoshop Headquarters || Don't use MS Paint! Use Aviary!
SING US A SING YOU'RE THE PIANO MAN
I can't find the Vcam .fla download on that site. Where is it?
You don't have to download anything, just copy the code from the site and put it in a movie clip. It's that simple!
If you are reading this then you must be really bored.
Could someone help me again?
I can't get this thing to work so that the cursor moves in the direction of it's movement. If you get me?
I also need a zoom code, when you click and hold the image zooms in closer.
Thanks in advance :)
At 10/7/07 04:21 PM, Blordow wrote: Could someone help me again?
I can't get this thing to work so that the cursor moves in the direction of it's movement. If you get me?
I also need a zoom code, when you click and hold the image zooms in closer.
Thanks in advance :)
Thats just:
onClipEvent (mouseDown) {
_root.thing._xscale -= 5;
_root.thing._yscale -= 5;
}
Something like that? :P
=3
I was making an interactive map too just like the one your talking bout
heres mine:
Interactive Map (Alpha)
Shift zooms in and Control zooms out, ill let the scroll wheel do that too sometime.
Anyways, back to the question.
Put this code on the first frame of your flash document
_root.onEnterFrame = function(){
positionX = _root._xmouse;
positionY = _root._ymouse;
stage._x = stage._x + (positionX - stage._x)/4
stage._y = stage._y + (positionY - stage._y)/4
}
Change the "stage" to whatever you named your vcam, you can change the 4 to adjust how fast the camera moves.
For zooming I forget what I did. The file is on my other comp and im too lazy to transfer. Just do something like
if (Key.isDown(Key.SHIFT) {
stage._xscale =* 1.1
stage._yscale =* 1.1
}
I think that should work, I cant guarentee, Ill check as soon as I can get on my other computer.
At 10/7/07 04:41 PM, Blordow wrote: That didn't work :(
What he said does work. I know for a fact....
how inexperienced are you with AS?