|
|
|||||
Topic, Game "Path 4 Mouse (old)" | ||||||
| ||||||
You must register or log in to post a message.In the game, are all the blocks inside one block and you use gotoAndstop to change the block? [edit] Lol you're back :) [edit] Remember to check the PM box :D I hope marc still has the code in his PM box (he should have it). [edit in reply to your edit2] Me 2! this.origX=this._x this.origY=this._y this.onEnterFrame=function(){ if(this.hitTest(_root.circle)){ this._x -= (_root._xmouse-_x)/10; } else { this._x += (this.origX-_x)/10; } if(this.hitTest(_root.circle)){ this._y -= (_root._ymouse-_y)/10; } else { this._y += (this.origY-_y)/10; } } [edit] Didn't see your edit! Thanks! :) [edit2] Hmm, too complex for me (I bet I sound pathetic LOL). I don't know how to apply the code. I don't think it works with the way I make the tiles do stuff. [edit] This is it: //so is the block being pushed //ccl is the circle that follows the mouse [edit gecko] Code removed (Captain's request) I'll try making it my way, then resort to yours if all else fails. this.origX=this._x this.origY=this._y this.onEnterFrame=function() { this.xDist=this._x-this.origX this.yDist=this._y-this.origY this._x-=this.xDist/5 this._y-=this.yDist/5 this.xDist=_root._xmouse-this._x this.yDist=_root._ymouse-this._y this.distance=Math.sqrt((this.xDist*this.xDist)+(this.yDist*this.yDist)) if(this.distance<50) { if(xDist>0) this._x-=(50-this.xDist)/5 else this._x+=(50+this.xDist)/5 if(yDist>0) this._y-=(50-this.yDist)/5 else this._y+=(50+this.yDist)/5 } } If the block is within a certain distance of the mouse, it moves away from the mouse, and if it is not, it moves back towards its place. Pretty simple, but effective (it won't be as realistic as the real push, but will product the same effect). I don't know about the exploding tiles. I'll leave it until later, and try to find my own way of doing it, if I do it at all. [edit] I could work that out while you put my code in :) [re-edit] It's being troubesome O_O A Push-style block. It moves away from the mouse if it is within range, just like Push! :D if(numHold==17) //Might be different number { //stuff to use } [edit] Put this in for exploding tiles: block.xHold = this._x/tileWidth] =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20-40, _y:this.yHold*20}) =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20, _y:this.yHold*20+40}) =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20, _y:this.yHold*20-40}) =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20+20, _y:this.yHold*20+20}) =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20+20, _y:this.yHold*20-20}) =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20-20, _y:this.yHold*20+20}) =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20-20, _y:this.yHold*20-20}) .isBomb) _root["wall"+(this.xHold+2)+":"+(this.yHold+0)].delay() .erasable!=false) _root["wall"+(this.xHold+2)+":"+(this.yHold+0)].vis = false .isBomb) _root["wall"+(this.xHold-2)+":"+(this.yHold+0)].delay() .erasable!=false) _root["wall"+(this.xHold-2)+":"+(this.yHold+0)].vis = false .isBomb) _root["wall"+(this.xHold+0)+":"+(this.yHold+2)].delay() .erasable!=false) _root["wall"+(this.xHold+0)+":"+(this.yHold+2)].vis = false .isBomb) _root["wall"+(this.xHold+0)+":"+(this.yHold-2)].delay() .erasable!=false) _root["wall"+(this.xHold+0)+":"+(this.yHold-2)].vis = false .isBomb) _root["wall"+(this.xHold+1)+":"+(this.yHold+1)].delay() .erasable!=false) _root["wall"+(this.xHold+1)+":"+(this.yHold+1)].vis = false .isBomb) _root["wall"+(this.xHold+1)+":"+(this.yHold-1)].delay() .erasable!=false) _root["wall"+(this.xHold+1)+":"+(this.yHold-1)].vis = false .isBomb) _root["wall"+(this.xHold-1)+":"+(this.yHold+1)].delay() .erasable!=false) _root["wall"+(this.xHold-1)+":"+(this.yHold+1)].vis = false .isBomb) _root["wall"+(this.xHold-1)+":"+(this.yHold-1)].delay() .erasable!=false) _root["wall"+(this.xHold-1)+":"+(this.yHold-1)].vis = false =attachMovie("fire", "wall"+(this.xHold-1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20-20, _y:this.yHold*20}) =attachMovie("fire", "wall"+(this.xHold+1)+":"+(this.yHold+0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20+20, _y:this.yHold*20}) = attachMovie("fire", "wall"+(this.xHold+0)+":"+(this.yHold-1)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20, _y:this.yHold*20-20}) = attachMovie("fire", "wall"+(this.xHold+0)+":"+(this.yHold+1)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20, _y:this.yHold*20+20}) = attachMovie("fire", "wall"+(this.xHold+0)+":"+(this.yHold-0)+"b", _root.getNextHighestDepth(), {_x:this.xHold*20, _y:this.yHold*20}) .isBomb) _root["wall"+(this.xHold-1)+":"+(this.yHold+0)].delay() .erasable!=false) _root["wall"+(this.xHold-1)+":"+(this.yHold+0)].vis = false .isBomb) _root["wall"+(this.xHold+1)+":"+(this.yHold+0)].delay() .erasable!=false)_root["wall"+(this.xHold+1)+":"+(this.yHold+0)].vis = false .isBomb) _root["wall"+(this.xHold+0)+":"+(this.yHold+1)].delay() .erasable!=false)_root["wall"+(this.xHold+0)+":"+(this.yHold+1)].vis = false .isBomb) _root["wall"+(this.xHold+0)+":"+(this.yHold-1)].delay() .erasable!=false)_root["wall"+(this.xHold+0)+":"+(this.yHold-1)].vis = false this._visible = false } } [re-edit] fixed up text vis was used for visibility, just put RemoveMovieClip() instead :) What are you trying to say? Is there a bug in the tile code or something? It helps if I know what I'm trying to fix... :) Gecko, is the exploding tile in yet? You can't play it because you aren't a tester -.- PS: why i can't play it and other people yes?? |