Ok. I have a simple movement script within the “ball” movie clip. The coding is all over the place so i dont blame you if it looks confusing.
I have made a boarder around the screen which is named “wall”. Basicly i don’t want the ball to pass this wall and when it touches the wall i want it to stop. Nothing fancy like bouncing off it, just stop it moving.
when you go to the post reply screen scroll down a little and you can click the big “manage attachments” button.
From there you can browse for the file, then “upload” using the button. Just close the window (using the button) and submit reply using the bottom button.
BTW here’s a zip file incase it makes a difference.
It sort of works exept the movie is 200 x 200 so the ball can only move around the bottom corner. I tried chaning the _root.mright values but im not sure how they work.
Its a nice idea and it definitly works but im hoping to create a small town in which a character can walk around. Thats why i have the different images on each key press (so the character apears to be walking in the direction moving). Im still drawing so i just used a basic ball with arrows.
I was wondering if i could insert the hittest into each keypress code.
The current code (movement to the right):
if (Key.isDown(39)) {
this._x += 5;
gotoAndPlay(4);
}
i want to combine 2 “if” conditions. In writting it would sound like. IF Key is pressed move in direction (using the x or y adding or subracting) and go to frame “?” (where the image of the ball is. 1 to 5). Then add the hit test. so IF “ball” touches “wall” stop by adding or subtracting 5 from x or y value.
In the case of moving right this value would be this._x -=5;
I think…
Im getting confused just trying to explain it. :puzzle:
I have decided to scrap my coding because it was usless and use the code in the ball and wall .fla which seemed to work quite well. Thanks for your help guys. Have a look at this .fla
Try going throught the gaps at the top and bottom. Confused? So am I.