first you need to create a new object, a circle for example
select it and push F8. make it a movieclip. then go to its properties and give it the instance name of circle.
go into its actionscript and add this text (to make it move)
onClipEvent(load){
moveSpeed = 5;
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y -= moveSpeed;
}
if(Key.isDown(Key.DOWN)){
this._y += moveSpeed;
}
if(Key.isDown(Key.RIGHT)){
this._x += moveSpeed;
}
if(Key.isDown(Key.LEFT)){
this._x -= moveSpeed;
}
}
next you will create a new object, a square for instance. make it a movieclip aswell, and give it the instance name square.
now put this in the circle:
onClipEvent(enterFrame){
if(this.hitTest(_root.square)){
_root.gotoAndStop(2);
}
}
this will make it so that when this(the circle) hits the square, the movie will go to the next frame (if you wanted you could put this in the sqaure and change the _root.square to _root.circle)
on each frame, one and two, put:
stop();
on the second frame you can put something like "well done" if you want.
you can replace the "gotoAndStop(2);" with whatever you want
for example, if you wanted a wall, draw a line along the right handside of the frame, and make it a movieclip, call it rightWall in instance name.
then you'd replace the _root.square with _root.rightWall and replace the "gotoAndStop(2);" with:
this._x -= moveSpeed;
this will make it so when the circle hits the wall it will be stopped from moving anyfurther, as when you move right at movespeed you will also be moved left. making no movement
hope this helped all you budding young game makers... probably not, but hey...