View Full Version : Flash Mx2004 game questions and help Pleae respond
The gamemaster
June 3rd, 2004, 02:32 PM
Hey I was just wondering about two things. Maby a flash expert could point me in the right direction. My first question Is:
I am experinced in making maps for tile base games in flash 5 but my problem is that I don't know how to do it in flashMx 2004. I was wondering if anyone could help ne with this.:cool:
My second question is:
Is there any way to change an action if you are a certain distance away from something. an example would be this. would it be possible that at a certan distance a character would shoot but if you got closer he would punch or kick or swing a sword. Just wondering if there is any method of doing this.:ne:
signifer123
June 3rd, 2004, 05:17 PM
with different keys or if yuo had an invisible object ot do hitttest on for the kicking shooting question
The gamemaster
June 3rd, 2004, 06:18 PM
I guess I could do that Though I have never used a hittest befor could you explain how to do it srry I have always relied on other keys to change the type of action.
signifer123
June 3rd, 2004, 06:44 PM
i'm noyt sure how to make an invisible box that still works but you need to search around kirupa its in the tutroials as you first start up www.kirupa.com (http://www.kirupa.com/) and i think you could use _makevisible = 0 *think i did wrong* to make it invisible
The gamemaster
June 3rd, 2004, 07:05 PM
Right well I will look again into kirupas tutorials could you give me a clue where to start this search of mine.
The gamemaster
June 3rd, 2004, 07:07 PM
or maby it does not have to be invisible maby it could like be a sign of when you can attack the enamy with a melle attack. another question is how do you make the colision test follow the enemies
signifer123
June 3rd, 2004, 07:09 PM
put the movie clip/picture in the enemy movie clip
The gamemaster
June 3rd, 2004, 07:43 PM
hey let me ask another question: this has probibly been asked befor but wjere the hell do you find action script tutorials for flashMx2004. This is so friggin anoying. You see the perfect tutorial for you you read it get all exited because you have just answered your problem with your game then you relize that that tutorial was for flash 5 and not for flashmx2004 or flashmx
lucas92
June 3rd, 2004, 08:27 PM
Check out Marz's AI tutorial/post dude. It rox
tommythewolfboy
June 4th, 2004, 05:27 AM
"... Is there any way to change an action if you are a certain distance away from something. an example would be this. would it be possible that at a certan distance a character would shoot but if you got closer he would punch or kick or swing a sword. Just wondering if there is any method of doing this."
OK - pseudo code for now, but this is always a better way to start than just jumping into scripting - think about how you want the code to work first ...
A simple if statement within the button keypress (assuming you are using the same button) should do the trick. First, you need to calculate the distance between the player clip and the target clip (e.g. [I'm assuming player moves left to right] distX = target._x - player._x) - and if this is less than a certain value, you set a boolean variable to be false (i.e. shootYN = false). On the button press, the if statement checks to see the value of shootYN - IF it is true, the player will shoot, ELSE the player punches.
Does this make sense?
tofu
June 5th, 2004, 09:40 AM
Tommy's solution works, if its a sidescroller. If its top down, youre probably gonna need to find not just length along the x axis, it y aswell. Use pythagorus's theorem for this.
function findHyp (run, rise) {
return Math.sqrt(run * run + rise * rise);
}
then simply enter your xlengths and ylengths (as in distance from each other) as arguments.
I think everyone should be aware that AS1 and AS2 are pretty much the same. Nothing has been taken out, stuf has been added (such as data typing and supported and unsimulated OOP). So any AS1 will still work MX2004. Let alone all that, you can specify AS version in publish settings. :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.