Be a Supporter!

Character controlable with mouse

  • 398 Views
  • 7 Replies
New Topic Respond to this Topic
Ghoul-5
Ghoul-5
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Character controlable with mouse 2006-05-17 11:57:19 Reply

Hi everyone, i'm making an RPG like game, and im using a view from the top to navigate in map. Now i'm using an actionscript from Flash MX tutorial where u control a beetle with your mouse. But i don't understand how it works so i have some problems: If i click an Interface button or something the movieclip moves there, and that is annoying, of course i'm blocking it's movement off-screen and stuff, but i still would like to fix this thing.
So could someone post maybe an easier actionscript that would make a Movieclip move to a location where u click with your mouse, also it should rotate to look at the direction. And what script should i add to Interface, and characters you can talk to want to attack, etc.. so that the MC wouldn't move but do other actions ( open a dialog box, attack etc.) ?

Any help appreciated.


THE CAKE IS A LIE

Ghoul-5
Ghoul-5
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Character controlable with mouse 2006-05-18 07:26:25 Reply

Can't anyone actionscript that? :(


THE CAKE IS A LIE

GustTheASGuy
GustTheASGuy
  • Member since: Nov. 2, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Character controlable with mouse 2006-05-18 07:32:55 Reply

It took me like a month to understand that beetle thingy script. Now I am the master of trigonometry.

*mwhahahahaa*

Like, 3d and stuff. :P


BBS Signature
GustTheASGuy
GustTheASGuy
  • Member since: Nov. 2, 2005
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Character controlable with mouse 2006-05-18 07:34:05 Reply

Ohyea.
http://www.newground..d=229808&page=44

Trust me, just take the time to understand all that stuff, don't ask anyone to give you the right thing.


BBS Signature
Cybex
Cybex
  • Member since: Mar. 4, 2005
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to Character controlable with mouse 2006-05-18 07:40:18 Reply

I've never tried something lioke that, but i would suggest making an invisible movieclip that is initially set to the same coordinates as the thing you want to move. Use trigonometry to make it so that the moving thing always faces the invisible movieclip and triginometry again to make it move towards the invisible movieclip. Also make it so that when you click, the coordinates of the invisible mc change to the coordinates of the mouse.

If you don't know how to do that, start with something more basic.

Also, this will probably come in useful.

I'm going to make a game like that now actually.

Trunks
Trunks
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 22
Musician
Response to Character controlable with mouse 2006-05-18 07:43:07 Reply

Some things you could try (from AS: Main) to learn are:

AS: Bars for Health and stuff;
AS: A.I. for enemies;
AS: Clip Events because it is essential;
AS: Moving and AS: Scrolling Backgrounds for the basic movement;

And a lot of other things. I hope these pointed you in teh overall right direction.


Web developer, software engineer, musician, all-around nerd.

Ghoul-5
Ghoul-5
  • Member since: Jul. 31, 2005
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to Character controlable with mouse 2006-05-18 08:21:04 Reply

Thanks, i'll see if i can understand something in those tutorials..

But maybe u have any ideas, on how to make the MC do different commands on mouse click.
(as i said; if clicked on enemy-attack, if on neutral- talk, if none of the previuos- go to the location where u clicked)


THE CAKE IS A LIE

caseyo
caseyo
  • Member since: May. 14, 2005
  • Offline.
Forum Stats
Member
Level 23
Blank Slate
Response to Character controlable with mouse 2006-05-18 08:28:10 Reply

At 5/18/06 08:21 AM, Ermacc wrote: on how to make the MC do different commands on mouse click.

on(press){
if(neutral){
// talk
} else if(none){
// go to location
}}

Sorta maybe?