Boo's Mansion
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Boo's Mansion

Step inside...
 
HomeHome  SearchSearch  Latest imagesLatest images  RegisterRegister  Log inLog in  
Welcome to my mansion! I am King Boo and I will be your forum administrator today. I am looking for forum moderators, so be on your best behavior. Link to my Newgrounds profile at www.bigboo2315.newgrounds.com!
Latest topics
» Hello there
RPG Tutorial Icon_minitimeSat Oct 02, 2010 8:55 am by King Boo

» NEWGROUNDS
RPG Tutorial Icon_minitimeMon Apr 12, 2010 10:41 am by King Boo

» Zelda II: Return of Link
RPG Tutorial Icon_minitimeMon Apr 12, 2010 5:10 am by King Boo

» Oh god, not this again...
RPG Tutorial Icon_minitimeMon Apr 12, 2010 3:32 am by King Boo

» Art Battle 2010
RPG Tutorial Icon_minitimeSun Apr 11, 2010 12:18 pm by King Boo

» RPG Tutorial
RPG Tutorial Icon_minitimeTue Apr 06, 2010 12:56 pm by King Boo

» RPGMaker, XP or VX?
RPG Tutorial Icon_minitimeWed Mar 10, 2010 8:30 am by King Boo

» I need some suggestions here.
RPG Tutorial Icon_minitimeFri Mar 05, 2010 10:14 am by King Boo

» What this board is all about.
RPG Tutorial Icon_minitimeFri Mar 05, 2010 8:38 am by King Boo

Top posters
King Boo
RPG Tutorial Vote_lcapRPG Tutorial Voting_barRPG Tutorial Vote_rcap 
Completedouche
RPG Tutorial Vote_lcapRPG Tutorial Voting_barRPG Tutorial Vote_rcap 
ThePsyduckKing
RPG Tutorial Vote_lcapRPG Tutorial Voting_barRPG Tutorial Vote_rcap 
00314
RPG Tutorial Vote_lcapRPG Tutorial Voting_barRPG Tutorial Vote_rcap 
HDXmike
RPG Tutorial Vote_lcapRPG Tutorial Voting_barRPG Tutorial Vote_rcap 
Affiliates
Photo of a big bunny rabbit!
Runes Of Magic
 
Social bookmarking
Social bookmarking reddit      

Bookmark and share the address of Boo's Mansion on your social bookmarking website

Bookmark and share the address of Boo's Mansion on your social bookmarking website

 

 RPG Tutorial

Go down 
3 posters

Did this tutorial help you?
Yes
RPG Tutorial Vote_lcap50%RPG Tutorial Vote_rcap
 50% [ 1 ]
No
RPG Tutorial Vote_lcap50%RPG Tutorial Vote_rcap
 50% [ 1 ]
Total Votes : 2
 

AuthorMessage
King Boo
Administrator
Administrator
King Boo


Posts : 33
Reputation : 11
Join date : 2010-02-28
Age : 29
Location : Wisconsin

RPG Tutorial Empty
PostSubject: RPG Tutorial   RPG Tutorial Icon_minitimeTue Mar 02, 2010 9:54 am

Hey, Big Boo here. I'm putting together an RPG game, so I figured I
might as well put together a tutorial too! Lets get started then.

First,
make a movie clip of a character standing, and a movie clip of a character moving, like this:

RPG Tutorial Charac12

I'm using Circle Man here. You just got a spoiler
for my RPG game!

Next, make a movie clip and name it whatever
you want. On the first frame, add the movie clip of the character
standing. Then add 3 key frames. Make a blank key frame and on it put
the movie clip of the character walking, then make 3 more key frames. On
the first and fifth frames, make the character face up. On the second
and sixth frames, make the character face down. On the third and seventh
frames, make the character face right. And on the fourth and eigth
frames, make the character face left. Go back to the main stage and put
the movie clip with those 8 frames on it and give it the instance name
"player" without the quotation marks. Then click the player, open the
actions panel (or press F9 if you're using Flash 8 like I am), and paste
the following frames into the actions panel.

onClipEvent(load){
speed=8;//sets a variable named
speed
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y-=speed;
this.gotoAndStop(5);//tells
flash to change frame when the up key is pressed
}
if(Key.isDown(Key.DOWN)){
this._y+=speed;
this.gotoAndStop(6);//tells
flash to change frame when the down key is pressed
}
if(Key.isDown(Key.RIGHT)){
this._x+=speed;
this.gotoAndStop(7);//tells
flash to change frame when the right key is pressed
}
if(Key.isDown(Key.LEFT)){
this._x-=speed;
this.gotoAndStop("8");//tells
flash to change frame when the left key is pressed
}
}
onClipEvent(enterFrame){
if(this._x>550){//assuming
your stage is 550 width
this._x=550;
}
if(this._x<0){
this._x=0;
}
if(this._y>400){//assuming
your stage is 400 height
this._y=400;
}
if(this._y<0){
this._y=0;
}
}


This
code allows the player to be moved with the arrow keys, and also stops
the character from moving at the edges of the screen. If you're stage's
size is not 550 x 400, change the numbers 550 and 400 in the code.
That's all for the character for now! On to the other stuff...

Next,
I'll explain score (coins).

If you want any kind of score in
your game, you'll need to follow these instructions.

First, make a
movie clip for your coin. There are no limitations to this movie clip,
so have fun with it and make it look cool. Next, put the following code
on the frame of the game you are playing on:

score=0;

Next,
bring the coin movie clip to the stage and put as many of them as you
like. Then, add the following code to each of them:

onClipEvent (load) {
this.swapDepths(_root.getNextHighestDepth());
}
onClipEvent
(enterFrame) {
if (_root.player.hitTest(this)) {
_root.score++;
this.removeMovieClip();
}
}

Now
put a dynamic text box with the variable "score" without the quotation
marks somewhere on the stage. That's all for coins, but theres more
coming!

Every good game has a dynamic camera, also called a
v-cam, right? Right.

First, make a rectangle the size of your
stage (it doesn't matter if it's a little bigger, but it will make a
difference if it's too small). Convert the rectangle to a movie clip and
set the alpha to 0. Also, give it the instance name "vcam" without the
quotation marks. Now put the following code on the first frame INSIDE
THE VCAM MOVIE CLIP!


parentColor.setTransform(camColor.getTransform());
function
camControl() {
parentColor.setTransform(camColor.getTransform());
var
scaleX = sX/this._width;
var scaleY = sY/this._height;
_parent._x
= cX-(this._x*scaleX);
_parent._y = cY-(this._y*scaleY);
_parent._xscale
= 100*scaleX;
_parent._yscale = 100*scaleY;
}
function
resetStage() {
var resetTrans = {ra:100, rb:0, ga:100, gb:0, ba:100,
bb:0, aa:100, ab:0};
parentColor.setTransform(resetTrans);
_parent._xscale
= 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
//
make frame invisible
this._visible = false;
// Capture stage
parameters
var oldMode = Stage.scaleMode;
Stage.scaleMode =
"exactFit";
var cX = Stage.width/2;
var cY = Stage.height/2;
var
sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode =
oldMode;
// create color instances for color
// transforms (if
any).
var camColor = new Color(this);
var parentColor = new
Color(_parent);
// Make the stage move so that the
// v-cam is
centered on the
// viewport every frame
this.onEnterFrame =
camControl;
// Make an explicit call to the camControl
// function
to make sure it also runs on the
// first frame.
camControl();
//
If the v-cam is ever removed (unloaded)
// the stage, return the
stage to the default
// settings.
this.onUnload = resetStage;


Now,
go back to the main stage and add the following script to the vcam
movie clip:

onClipEvent (enterFrame) {
_y
+= (_root.player._y-_y)/4;
_x += (_root.player._x-_x)/4;
}


And
that's how you make the dynamic camera!

I'm sorry to say this,
but that's all I have so far in my RPG, so that's all I can put on this
tutorial. When I get farther along, I'll update this tutorial and add
whatever I did that was new. Thanks for reading! If this helped you, please press the "Thanks" button.

Your forum
admin,

RPG Tutorial Affraid Big Boo RPG Tutorial Affraid


Last edited by Big Boo on Wed Mar 03, 2010 7:10 am; edited 5 times in total
Back to top Go down
https://boosmansion.darkbb.com
Completedouche
Administrator
Administrator
Completedouche


Posts : 9
Reputation : 4
Join date : 2010-03-03
Age : 33
Location : Ohio

RPG Tutorial Empty
PostSubject: Re: RPG Tutorial   RPG Tutorial Icon_minitimeWed Mar 03, 2010 10:56 am

Thats Nice, but coding on Movieclips is bad practice because it lags the game. However switching from a MC coding and Timeline coding is extremely easy to keep track of code.

MC Code start:
onClipEvent(load/enterFrame) {

Timeline Code:
onEnterFrame = function(){

So no code will go on the MC except an instance name which is located on the properties inspector, and things like _root will disapeer.
However You may find out that in a larger game you will have a lot of code on a single frame, and that is where Object Oriented Programing comes in with .as files and classes. But that should be in a whole different topic.
RPG Tutorial Icon_surprised
Back to top Go down
http://www.theflashseed.0fees.net/
King Boo
Administrator
Administrator
King Boo


Posts : 33
Reputation : 11
Join date : 2010-02-28
Age : 29
Location : Wisconsin

RPG Tutorial Empty
PostSubject: Re: RPG Tutorial   RPG Tutorial Icon_minitimeWed Mar 03, 2010 11:03 am

I've been wondering why some of my games have had mega lag... I didn't think of that. I THANKS'd you, lol. Funny, I'm the founder and I have less reputation that everyone.
Back to top Go down
https://boosmansion.darkbb.com
HDXmike
Thug Boo
Thug Boo
HDXmike


Posts : 2
Reputation : 1
Join date : 2010-04-06
Age : 29

RPG Tutorial Empty
PostSubject: Re: RPG Tutorial   RPG Tutorial Icon_minitimeTue Apr 06, 2010 8:52 am

You sir need to learn actionscript Wink
Back to top Go down
http://hdxmike.co.cc
King Boo
Administrator
Administrator
King Boo


Posts : 33
Reputation : 11
Join date : 2010-02-28
Age : 29
Location : Wisconsin

RPG Tutorial Empty
PostSubject: Re: RPG Tutorial   RPG Tutorial Icon_minitimeTue Apr 06, 2010 12:56 pm

HDXmike wrote:
You sir need to learn actionscript Wink

Well I know I'm not great at it... what do you think is wrong?
Back to top Go down
https://boosmansion.darkbb.com
Sponsored content





RPG Tutorial Empty
PostSubject: Re: RPG Tutorial   RPG Tutorial Icon_minitime

Back to top Go down
 
RPG Tutorial
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Boo's Mansion :: Boo's Mansion: Forums :: Tutorials-
Jump to: