Home  | Login  | Register  | Help  | Play 

RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession

 
Logged in as: Guest
  Printable Version
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession
Page 17 of 18«<1415161718>»
Forum Login
Message << Older Topic   Newer Topic >>
5/20/2009 6:42:49   
iEnd
Member

I am making a point and click movement system...
All I got this fa ris this code:
onClipEvent (load) {
	_x = 0;
	_y = 0;
	speed = 5;
}
onClipEvent (mouseDown) {
	endX = _root._xmouse;
    endY = _root._ymouse;
}
onClipEvent (enterFrame) {
	_x += (endX-_x)/speed;
	_y += (endY-_y)/speed;
}


The code is on the MC.
Now I want my guy to rotate facing the point I click, like on DF or any other AE games...
Can ya help me?
Post #: 401
5/20/2009 14:57:29   
somebody621
Member

First of all, it's a good coding habit to put all the code on one frame =).
To solve your problem, if the endX is greater than the _x, make it face right (gotoandplay or scaleX = -100 or something like that). if endX < _x, make him face left.
Post #: 402
5/20/2009 15:37:38   
MegaPoster404
Member

How can I make a movieclip rotate to face the mouse? I want to make a tower defense, and I'd like the tower to face the mouse.
DF MQ  Post #: 403
5/20/2009 17:08:20   
biG frend
Member

If your talking about 360 degree rotation I know its fairly complicated and involves some pretty pretty hard math functions.
Sorry I couldnt help anymore. I'd show you my own one but uhh new hard-drive sucks.
AQ DF MQ  Post #: 404
5/20/2009 20:45:24   
somebody621
Member

Actually, Math.Atan2(y, x) returns the angle in radians.
Post #: 405
5/27/2009 16:22:08   
flsg
Member

I always miss the chance to answer to the questions x.x...
need to get on here more often lol

_____________________________

My flash gallery
my game thread

flsg, proud old member of AQ(still playing :O)
AQ  Post #: 406
5/29/2009 13:30:57   
darksideofthefarm
Member

Hey, im trying to code an inventory for an rpg, I can't seem to figure out the code (I need help on a DF like Inventory, I know how to make the other kind) Like you get a weapon from a quest then add it to your inventory and shop etc. But I can't seem to edit this into a more DF like inventory script. Also how do I make the inventory pop up, then hide when I click an X button, so like its hiding then appears?

Code Im trying to edit and build upon. Maybe I need a new code

currentslotnum = 1; 
stop (); 
function addToslot (item) { 
if (!item.found) { 
item._x = eval ("itemSlot" + currentslotnum)._x; 
item._y = eval ("itemSlot" + currentslotnum)._y; 
item.found = true; 
currentslotnum++; 
} 
} 

onClipEvent (enterFrame) { 
if (_root.character.hitTest (this)) { 
_root.addToslot (this); 
} 
}
AQ DF MQ  Post #: 407
5/30/2009 15:56:32   
EragonZZZZ
Member

Raycasting Fun!

Woohoo! Drag the white dots and click where ever suits your fancy.

< Message edited by EragonZZZZ -- 5/30/2009 15:57:10 >
AQ  Post #: 408
6/2/2009 7:16:09   
zaffie252
Member

hey im trying to code a game where you control a ship with your mouse and you need to dodge asteroids(much like the mq minigame)
i know how to make the ship follow mouse and i can do hittests. i just need to know how to make the asteroids fly to the left at different speeds.
any help will be appreciated
thanks
AQ DF MQ  Post #: 409
6/2/2009 10:28:53   
~JW~
Member
 

I Am Using Flash 8. I Heard About Tweening. What Is This? How Do I Do It? Because I Only Do Frame By Frame.
Post #: 410
6/2/2009 11:16:56   
//.Shadow.\\
Member

Easy you have your frame by frame still but all you do on the frames is right click and then Create Tween. I suggest layering differnet items incase you make mistakes then you can easly go back.
//.Shadow.\\
AQ DF MQ  Post #: 411
6/2/2009 11:54:18   
biG frend
Member

zaffie252 thats easy, draw your meteor, make it a movieclip and inside the movieclip make a second keyframe say on frame number 30 or w/e and move your asteroid over to the left and make a tween.

Then on your frame use the attachMovie command to put the movieclip on the stage.
If your unsure how to use attachMovie, heres my quick rundown.

_root.attachMovie("LinkageName", "Instancename", Depth)
_root["Instancename"]._x = NumberGoesHere
_root["instancename"]._y = Number goes here

A linkage name can be assigned to a symbol either when you first hit f8 by clicking export for actionscript or you can go to the library right click your symbol and hit rename or something similar. What instance name you give it is up to you, when your coding your hit.test you'll be hit.testing against that instance name. The Depth is a number, it needs to be a unique number it basically works like layers but using actionscript. An object with the Depth of 1 will show over anything, an object with the depth of 5 will show above anything less than 5.
The second part of the code should be pretty self explanatory, no?
AQ DF MQ  Post #: 412
6/4/2009 23:21:55   
~JW~
Member
 

OK, Im Trying To Do My Own Little Minigame WIth Accoutns And Stuff, How Do I Do A HitTest. Im Using AS2. Im trying To Make A Maze You Have To Go Through, What Do I Do.
For the Registration, Im Gonna Do Something So That It Sends The Details To An Email, Whats the Code.
Post #: 413
6/6/2009 14:11:56   
Vampire and Human
Member

Ummm... Here:

ambitions = 9000

if(ambitions >= 9000){
trace("It's over 9000!")
trace("try something simpler")
jw.unexperienced = true
}
if(jw.unexperienced){
jw.shouldtrydifficultylevel = "basic"
}


Gah its contagious....
Anyways, no, thats not the proper code, but try it anyways.

If you can't to hitTest, you most certainly cannot do something with "...Accoutns And Stuff,..." Try for something simpler, like a onetime maze-game. Not everything needs accounts. Simple things amuse simple minds, A.K.A 1/2 of population :3.

Btw, please do NOT copy this code, even though you're probably going to anyways regardless of what I tell you. This is for learning purposes only, and will not really function properly.

if(thingy.hitTest(otherthingy)){
dosomething()
makevariable = "something"
numbervalue = 1337
trace("BLAHBLAHBLAH")
}


What it means is, if thingy one hitTests/touches the otherthingy, it does... something. Pretty much anything you want. Super simple. Nothing to it, really.

Edit: WAIT WAIT WAIt WAit Wait wait wait wait wait wait wait waaaiiittttuh,.... Since when did minigames have accounts? Que? Mah? What? Was? Che? Hva ?

< Message edited by Vampire and Human -- 6/6/2009 14:19:32 >


_____________________________

OM NOM NOM'd by a Charmander!
Limits are 500px wide by 100 px tall.
Filesize at max can be 50kb.

I am a proudly eaten sig. I take pride in my half-digested-ness thank you very much!

The Mods shall not have me beat! Not again! Not this time!
AQ  Post #: 414
6/6/2009 16:05:48   
~JW~
Member
 

Thanx Beef. But Im Not As bad As Everyone Thinks. I Can Do Stuff Like Engines. But...For The Minigame Account Thing, Its Blob Wars...But Ive Made A Minigame For It.

< Message edited by ~JW~ -- 6/6/2009 16:07:08 >
Post #: 415
6/6/2009 18:05:49   
Vampire and Human
Member

Umm.... Engines? Que? Mah? What? Was? Che? Hva?
AQ  Post #: 416
6/7/2009 12:31:50   
~JW~
Member
 

Tiganti! Game Engines. Login Walkaround, Battles.
Post #: 417
6/8/2009 15:05:54   
darksideofthefarm
Member

Beef: Funny coding. That gave me a good laugh.

JW: Battles and walkaround are pretty simple codes. As for hit tests, how could you script battles without knowing how to do hit Tests (atleast I use hit tests for battle systems) But hey don't worry everyone has to start somewhere.

Eh, I'm bored so I'm gonna do some flash, but hey can anyone help me with an inventory system like DF? I would love you long time if you can help me.
AQ DF MQ  Post #: 418
6/11/2009 16:06:39   
golden rod
Member

i'm using flash 8 pro

does anyone know how to make a real time battle system in flash? similar to WoW or AQW. a little simpler then WoW, but a bit more complicated then AQW.
DF MQ  Post #: 419
6/12/2009 11:35:42   
biG frend
Member

If you wanted a real 'real time battle system' like an action game etc I'd just have keys assigned that when pressed does the moves action and checks if the weapon your carrying hit.tests the enemy and then have some formulae for damage.
AQ DF MQ  Post #: 420
6/15/2009 5:11:21   
jiggibidy
Member

I'm working on some formulae for a quick something I'm working on.
I've got one of the formulae here, and there's supposedly some errors with it.
Here's my code:
on(press){
	if(FireLevel > 1){
		if(PlayerMP >= 10){
			EnemyHP = ((random(5) + 5) * (1 + (Power / 20)))
			if(FireLevel = 2){
				FireExperience = FireExperience + 2
			}else{
				FireExperience = FireExperience + 1
			}
		}else{
			trace (You have insufficient MP)
		}
	}else{
		trace (Your Fire Level is too low.)
	}
}

And here's the error report I'm given:
Error Report

I understand what it's trying to tell me, but I'm at a loss as to how to fix it.
If you could give me the correct format of code, that would be much appreciated, and after that, hopefully I won't be seeing these errors again any time soon.

~Toodles.
AQ DF MQ  Post #: 421
6/15/2009 10:27:45   
~JW~
Member
 

on(press){
if(FireLevel > 1){
if(PlayerMP >= 10){
EnemyHP = ((random(5) + 5) * (1 + (Power / 20)))
if(FireLevel = 2){
FireExperience = FireExperience + 2
}else{
FireExperience = FireExperience + 1
}
}else{
trace "You have insufficient MP"
}
if }else{
trace 'Your Fire Level is too low.'
}

That Might Work, But Make Sure To Format It. How Do YOu Guys Make The Code Seem Like Its Real?

< Message edited by ~JW~ -- 6/15/2009 10:28:27 >
Post #: 422
6/15/2009 10:38:05   
jiggibidy
Member

Never mind, I found out that I used the trace command wrong.
/facepalm.

Also, ~JW~, use the [code][/code] tags, and put your code inbetween them.

~Toodles.
AQ DF MQ  Post #: 423
6/15/2009 16:03:51   
golden rod
Member

@biG friend what if i'm not using keys and i'm using buttons. would it still work? also how would i make it so the user can move around the buttons, from a kind of skill book to the .... action bar/ where active skills go.
DF MQ  Post #: 424
6/18/2009 10:42:28   
~JW~
Member
 

Im guessing that you need a button battle like AQWorlds?
Well make the buttons, have little pictures on them.
Then make the different frames of him attacking. On
the end of each attack on the frame have this code:
stop();

Once youve done that, make the blade hitTest the enemy. (Thanx for the code beefstew)
if(thingy.hitTest(otherthingy)){
dosomething()
makevariable = "something"
numbervalue = 1337
trace("BLAHBLAHBLAH")
}

Finally, get the number for the frames of attacking, and add this code to the buttons:
on (press) {
	gotoandplay(framenumber)
}


< Message edited by ~JW~ -- 6/18/2009 10:43:28 >
Post #: 425
Page:   <<   < prev  14 15 16 [17] 18   next >   >>
All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy >> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession
Page 17 of 18«<1415161718>»
Jump to:



Advertisement




Icon Legend
New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Content Copyright © 2018 Artix Entertainment, LLC.

"AdventureQuest", "DragonFable", "MechQuest", "EpicDuel", "BattleOn.com", "AdventureQuest Worlds", "Artix Entertainment"
and all game character names are either trademarks or registered trademarks of Artix Entertainment, LLC. All rights are reserved.
PRIVACY POLICY


Forum Software © ASPPlayground.NET Advanced Edition