alright I made them all containers and can make them move ... but I think because of the way I do my hit test ... if the walls touch my hero they go right through him cause he isn't moving everythign else is ... hmm should I use a different hit test or is their away to work around it...
I put this on the objects ...
hoping tat when the hero touched map all woudl stop ... but needless to say it didn't workCode:onClipEvent(load){ s = 10; r = 5; b = _root.hero.getBounds(this); function move(x,y){ if(!_root.hit.hitTest(_x+x+b.xmin+1, _y+y+b.ymin+1, true)){ if(!_root.hit.hitTest(_x+x+b.xmax-1, _y+y+b.ymin+1, true)){ if(!_root.hit.hitTest(_x+x+b.xmin+1, _y+y+b.ymax-1, true)){ if(!_root.hit.hitTest(_x+x+b.xmax-1, _y+y+b.ymax-1, true)){ _x += x; _y += y; } } } } } } onClipEvent(enterFrame){ if(Key.isDown(Key.UP)){ move(0,-s); } if(Key.isDown(Key.UP) && Key.isDown(Key.CONTROL)){ move(0,-r); } if(Key.isDown(Key.DOWN)){ move(0,s); } if(Key.isDown(Key.DOWN) && Key.isDown(Key.CONTROL)){ move(0,r); } if(Key.isDown(Key.LEFT)){ move(-s,0); } if(Key.isDown(Key.LEFT) && Key.isDown(Key.CONTROL)){ move(-r,0); } if(Key.isDown(Key.RIGHT)){ move(s,0); } if(Key.isDown(Key.RIGHT) && Key.isDown(Key.CONTROL)){ move(r,0); } }
oh yeah and thanks for the JS thing ... i figured it out as soon as the email got sent ot me that you posted ^_^.




Reply With Quote