ginob
06-25-2008, 11:34 PM
Hi,
I am working on a simple game. There is a movie clip that follows the mouse around. When the timeline moves to the "game over" screen, I want the movie clip to stop following the mouse and disappear completely. I'm still a newbie and I can't seem to make this work right. Any advice? Thanks.
The mc that follows the mouse is called "Text" in linkage properties and this movie clip has the following code in it:
On frame 1:
if(_root.xPos < (_root._xmouse - 10))
{
_root.xPos += 10;
}
else if(_root.xPos > (_root._xmouse + 10))
{
_root.xPos -= 10;
}
if(_root.yPos < (_root._ymouse - 10))
{
_root.yPos += 10;
}
else if(_root.yPos > (_root._ymouse + 10))
{
_root.yPos -= 10;
}
this._x = _root.xPos;
this._y = _root.yPos;
_root.newAngle += 10;
this._rotation = _root.newAngle;
_root.count++;
if (hitTest(_root.chippy)==true) {
_root.chippy.play();
}
On frame 2:
_root.attachMovie("Text", "Text" + _root.count, 1000 + _root.count);
On the last frame:
this.removeMovieClip();
The first frame of the actual game has the following code:
stop();
Mouse.hide();
var newAngle = 0;
var count = 0;
attachMovie("Text", "Text" + count, 1000 + count);
var xPos = Text0._x;
var yPos = Text0._y;
I am working on a simple game. There is a movie clip that follows the mouse around. When the timeline moves to the "game over" screen, I want the movie clip to stop following the mouse and disappear completely. I'm still a newbie and I can't seem to make this work right. Any advice? Thanks.
The mc that follows the mouse is called "Text" in linkage properties and this movie clip has the following code in it:
On frame 1:
if(_root.xPos < (_root._xmouse - 10))
{
_root.xPos += 10;
}
else if(_root.xPos > (_root._xmouse + 10))
{
_root.xPos -= 10;
}
if(_root.yPos < (_root._ymouse - 10))
{
_root.yPos += 10;
}
else if(_root.yPos > (_root._ymouse + 10))
{
_root.yPos -= 10;
}
this._x = _root.xPos;
this._y = _root.yPos;
_root.newAngle += 10;
this._rotation = _root.newAngle;
_root.count++;
if (hitTest(_root.chippy)==true) {
_root.chippy.play();
}
On frame 2:
_root.attachMovie("Text", "Text" + _root.count, 1000 + _root.count);
On the last frame:
this.removeMovieClip();
The first frame of the actual game has the following code:
stop();
Mouse.hide();
var newAngle = 0;
var count = 0;
attachMovie("Text", "Text" + count, 1000 + count);
var xPos = Text0._x;
var yPos = Text0._y;