ok this is my first tutorial so here it goes
Tutorial:
this tutorial with cover the basics of an rpg and a little more.
ok first make a circle and convert it to a movieclip or highlight thewhole circle and press F8 and make sure its a movieclip....now click the circle and go to the top of your screen and go to Windows/Properties/ then a window should come up...now change the instance name to "hero" without the " "...now open up your actions window and put this code in:
onClipEvent(load){
ms=10;
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
_y-=ms;
gotoAndPlay(21);
}
if(Key.isDown(Key.DOWN)){
_y+=ms;
gotoAndPlay(23);
}
if(Key.isDown(Key.LEFT)){
_x-=ms;
gotoAndPlay(24);
}
if(Key.isDown(Key.RIGHT)){
_x+=ms;
gotoAndPlay(22);
}
if(Key.isDown(Key.SPACE)){
gotoAndPlay(2);
}
if(_y>400){
_y=400;
}
if(_y<0){
_y=0;
}
if(_x>550){
_x=550;
}
if(_x<0){
_x=0;
}
}
now if you test it it should move up down right left with the arrow keys..
now make a long rectangle and convert it into a movieclip.....when you done with that open up the action panel and put in this code
onClipEvent(enterFrame){
if(this.hitTest(_root.hero)&&_root.hero._y
<_y){
_root.hero._y-=_root.hero.ms;
}
if(this.hitTest(_root.hero)&&_root.hero._y
>_y){
_root.hero._y+=_root.hero.ms;
}
if(this.hitTest(_root.hero)&&_root.hero._x
<_x){
_root.hero._x-=_root.hero.ms;
}
if(this.hitTest(_root.hero)&&_root.hero._x
>_x){
_root.hero._x+=_root.hero.ms;
}
}
now....try it and see if it works....it should stop you...like a boundry...
ok now we will make something used alot in rpg's
ok find your font tool and click in the frame... now go to your properties panel and if you look you will see "static text" and change that to "dynamic text" when your done with that try and find your variable text its next to what its called var. and type in "money" in it......now go to your time line and click your frame and it should highlight everything in the frame and then go to you action panel and put this in it:
money=0;
(change the zero to any number you want if you like)
ok now make a square and make that into a movieclip now open up your action panel for the square and put this in it:
onClipEvent(enterFrame){
if(this.hitTest(_root.hero)){
_root.money=100;
_visible=false;
}
}
now! you should have something like this
http://img471.images..torialsamples4rh.swf