#1 (permalink)  
Old 09-17-06, 08:37 AM
e8newallm's Avatar
e8newallm e8newallm is offline
Newbie Coder
 
Join Date: Jul 2006
Location: in a tiny box of the cost of jupiter
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
RPG help.

Code:
if(allow_move = 1)
{
moving = 0;
on(keyPress "<Left>")
{
	moving = 1;
	_root._root._x += 5
	this._x -= 5;
	_root.energy._x -= 5;
}
on(keyPress "<Right>")
{
	moving = 1;
	_root._root._x -= 5
	this._x += 5;
	_root.energy._x += 5;
}
on(keyPress "<Up>")
{
	moving = 1;
	_root._root._y += 5
	this._y -= 5;
	_root.energy._y -= 5;
	
}


on(keyPress "<Down>")
{
	moving = 1;
	_root._root._y -= 5
	this._y += 5;
	_root.energy._y += 5;
}

if(moving = 1)
{
_root.energy.stanima.play();
}
if(moving = 0)
{
_root.energy.stanima.prevFrame();
}

}
I am working on a RPG stup, an load of stuff in a .FLA that will be able to be set up into a RPG. I put this on the main character, trying to get it to affect a stanima bar. as he stands still, it goes up, while going down as he walks. if its at the bottom, the main can't walk.

_root.energy.stanima refers to the stanima of the guy. This is presented in a bar.

allow_move becomes 0 when stanima's at the bottom, and becomes 1 half way, so if it goes to the bottom, you have to wait for half the stanima.

but it moans about this:

**Error** Scene=Scene 1, layer=top pieces, frame=1:Line 2: Statement must appear within on/onClipEvent handler
if(allow_move = 1)

help?
__________________
>>>\/
/\....\/
/\<<< follow the arrows with your cursor to win a special prize
Reply With Quote
  #2 (permalink)  
Old 09-17-06, 08:41 PM
stormshadow's Avatar
stormshadow stormshadow is offline
Coding Addict
 
Join Date: Mar 2005
Posts: 355
Thanks: 0
Thanked 0 Times in 0 Posts
im not too good in actionscript but i belive

if(variable = value){

means that is is setting the variable... you need double equalsigns (==) in comparison...
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need someone to install/setup an RPG code into my phpbb forum VanessaMRAnet Job Offers & Assistance 2 04-10-06 07:02 AM
EAST COAST GAME PROGRAMMER SEARCH – Action RPG DigitalMedia Job Offers & Assistance 0 11-29-05 01:29 PM
Massive RPG needs php programmer ObliviatorKK Job Offers & Assistance 0 11-17-05 04:40 PM
RPG Script for sale kardon General Advertisements 2 02-06-05 12:55 AM
New RPG, Need Coders :-D ObliviatorKK PHP 7 11-29-04 02:30 AM


All times are GMT -5. The time now is 06:28 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.