fredag 18 maj 2007

How to make a simple rpg game

Hello and welcome to "How to make a complete Rpg game Part 1".

Well lets not botter time at chatting....

Lets BEGIN!

Step 1:

First of make the "Character" and make it a symbol [F8]. Give him an instance name of; char.

Step 2:

Now to the script:
onClipEvent (load) {
speed = 4
}
onClipEvent (enterFrame) {
if (Key.isDown(65)) {
this._x -= speed; }
else if (Key.isDown(68)) {
this._x += speed; }
else if (Key.isDown(87)) {
this._y -= speed; }
else if (Key.isDown(83)) {
this._y += speed; }
else { this.gotoAndStop(1);
}
}

Step 3:

Now we want the guy to be able to pick up money. Ok, first up. Make a Dynamic text with the "Var"; totalmoney. Hit the first frame and paste this script on the frame;

totalmoney = 20;

now if u press Ctrl+Enter the dynamic text should say 20.

Now you have to make your coins or any kind of money, and make it into a symbol. And give the coin a instance name of coin. Now give the coin this sript;

onClipEvent (enterFrame) { ;
if (this.hitTest(_root.char)) ;
_x = -100;
_root.totalmoney += 1
}

Well thats all for this tutorial.