Monday, 22 October 2007

Idea

got the basic code to work, needs some tweeking but ill have a look at that





4 comments:

Lucy said...

fucking ACE mate. weldone. how the bleedin friggin eck did u manage to do tht then.

jump_leads said...

works well. can you paste the code here please m8?

phil said...

did a tutorial online, "borrowed the code" but would like the get the mouse to be less sensative

leftMouse = mask_mc._x;
rightMouse = mask_mc._x + mask_mc._width;
topMouse = mask_mc._y;
bottomMouse = mask_mc._y + mask_mc._height;

leftClip = mask_mc._x;
topClip = mask_mc._y;
rightClip = mask_mc._x + mask_mc._width - mc._width;
bottomClip = mask_mc._y + mask_mc._height - mc._height;

mc.onEnterFrame = function()
{
var rx = (_root._xmouse - leftMouse)/(rightMouse - leftMouse);
var ry = (_root._ymouse - topMouse)/(bottomMouse - topMouse);
rx = Math.max(0, Math.min(1, rx));
ry = Math.max(0, Math.min(1, ry));
var dx = leftClip + (rightClip - leftClip)*rx;
var dy = topClip + (bottomClip - topClip)*ry;
this._x += (dx - this._x)*.2;
this._y += (dy - this._y)*.2;
}

jump_leads said...

Do you mean like... more friction with the movement? Like... It takes longer to catch up with the cursor? It does do it a little already so it must be in there but I can't see which part either right now haha... I'm going to bed tho anyways hehe.