Hi,
I am creating a simple game in flash 8.[URL=“http://force10x.freehostia.com/flash/game_v2.zip”]
I dont have much skills in programming hence help required.
I have a game where users can drag and drop elements to build something.
when the user drags a part, on hitTest, that part becomes invisible while the other one becomes visible.
I tried removing the movie clip but that wont work.
here is my code
stop();
this.onEnterFrame = function():Void{
makeFinalPipeInvisible();
checkPipePlacement();
}
//start dragging pipe peice 01
this.pipe01_mc.onPress = function():Void {
trace("it");
startDrag(this);
}
this.pipe01_mc.onRelease = function():Void {
this.stopDrag();
}
//start dragging pipe piece 01
this.pipe01_mc.onPress = function():Void {
trace("it");
startDrag(this);
}
this.pipe01_mc.onRelease = function():Void {
this.stopDrag();
}
//start dragging pipe peice 01
this.pipe02_mc.onPress = function():Void {
trace("2");
startDrag(this);
}
this.pipe02_mc.onRelease = function():Void {
this.stopDrag();
}
//Functions start here ***
//This one sets the initial final pipe to invisible
function makeFinalPipeInvisible():Void{
this.finpipe01_mc._visible = false;
this.finpipe02_mc._visible = false;
this.finpipe03_mc._visible = false;
this.finpipe04_mc._visible = false;
this.finpipe05_mc._visible = false;
this.finpipe06_mc._visible = false;
this.finpipe07_mc._visible = false;
this.finpipe08_mc._visible = false;
this.finpipe09_mc._visible = false;
}
//Checks for hit test and makes final piece visible
function checkPipePlacement():Void {
if (this.pipe01_mc.hitTest(this.finpipe01_mc)){
this.finpipe01_mc._visible = true;
this.pipe01_mc._visible = false;
}else if (this.pipe02_mc.hitTest(this.finpipe02_mc)){
this.finpipe02_mc._visible = true;
this.pipe02_mc._visible = false;
}else if (this.pipe09_mc.hitTest(this.finpipe09_mc)){
this.finpipe09_mc._visible = true;
this.pipe09_mc._visible = false;
trace("game over");
}
}
A shove in the right direction would do a lot good.
thank you.
here is the fla