wow i am glad i only skimmed through it
Offline
theshapeshifterage wrote:
wow i am glad i only skimmed through it
Why? It is actually quite simple. Though I'm still a noob at Flash XD hopefully I will post a link to my first game soon, where you can see it's effectiveness (the this._X= random(500)+!
Offline
It is just better to code more neatly. If your code gets sloppy it will become unmanageable.
Also, check out this site that has fla files of game templates.
http://www.freewebs.com/pyro111/flafiles.htm
Offline
I have a question: I'm trying to detect the ground (I call it ground) by using these:
}
if (this.hitTest(_root.ground)){
_y-= 2;
}
if (this.hitTest(_root.ground) == false){
_y+=2;
}
above it is just movement. How come it isn't working?
Offline
Bluestribute wrote:
I have a question: I'm trying to detect the ground (I call it ground) by using these:
}
if (this.hitTest(_root.ground)){
_y-= 2;
}
if (this.hitTest(_root.ground) == false){
_y+=2;
}
above it is just movement. How come it isn't working?
I know exactly what the problem is. A basic hitTest will only hitTest the bounding boxes of the 2 MCs. For a more precise hitTest use the shape flag hitTest which hitTest coordinates.
like this
if (_root.ground.hitTest(_x,_y+(_height/2),true)
This will check for the ground MC at the bottom of the MC that has this script on it.
Also, if you are trying to raise your MC above ground a while loop will do the best job.
while (_root.ground.hitTest(_x,_y+(_height/2),true){
_y--;
}
And check that site with the flas I posted. It has a fla for platformer games.
Last edited by archmage (2008-08-06 14:47:33)
Offline
archmage wrote:
Bluestribute wrote:
I have a question: I'm trying to detect the ground (I call it ground) by using these:
}
if (this.hitTest(_root.ground)){
_y-= 2;
}
if (this.hitTest(_root.ground) == false){
_y+=2;
}
above it is just movement. How come it isn't working?I know exactly what the problem is. A basic hitTest will only hitTest the bounding boxes of the 2 MCs. For a more precise hitTest use the shape flag hitTest which hitTest coordinates.
like this
if (_root.ground.hitTest(_x,_y+(_height/2),true)
This will check for the ground MC at the bottom of the MC that has this script on it.
Also, if you are trying to raise your MC above ground a while loop will do the best job.
while (_root.ground.hitTest(_x,_y+(_height/2),true){
_y--;
}
I feel so stupid for not remembering that XD and I put in EXACTlY what you wrote, but couldn't move. So than I made it it's own little thing and got Syntax error?
And check that site with the flas I posted. It has a fla for platformer games. Woops. Forgot to put it outside the quote box
Last edited by Bluestribute (2008-08-06 14:53:16)
Offline
It is kinda working now. And i bookamrked that site. probably would be a good idea to find a platformer
Offline
Ah, silly me. I forgot a close bracket.
(_root.ground.hitTest(_x,_y+(_height/2),true))
It is important to carefully read the errors the debugger gives you. I make mistakes all the time but the debugger is really helpful in fixing them.
Offline
archmage wrote:
Ah, silly me. I forgot a close bracket.
(_root.ground.hitTest(_x,_y+(_height/2),true))
It is important to carefully read the errors the debugger gives you. I make mistakes all the time but the debugger is really helpful in fixing them.
I kinda figured you missed those. So I added them XD now the terrain is basically a bumpy hill, where the might not work…
Offline
Cool. This is really helpful! Does Flash 8 have AS3 or AS2? I think it has AC2 though. I've noticed that lots of tutorials just show you the script and it tells you what it makes. Maybe you could make a tutorial that tells you what each thing does. Just the basics though. Like, when to use a certain word in the script, like root. or what order do some words need to be in. That would really help!
Offline
Hobbs1100 wrote:
Cool. This is really helpful! Does Flash 8 have AS3 or AS2? I think it has AC2 though. I've noticed that lots of tutorials just show you the script and it tells you what it makes. Maybe you could make a tutorial that tells you what each thing does. Just the basics though. Like, when to use a certain word in the script, like root. or what order do some words need to be in. That would really help!
Only flash CS3 has AS3. And in this mini tutorial I did explain _root and all the code I used.
Offline
How come most flash games have better graphics and smother animation cycles than scratch does?
Offline
Because Flash is a professional program used by, well, pros. Lots of cartoons on T.V. these days are made in Flash. You know Foster's Home For Imaginary Friends? That was made in flash. If not, something like Flash.
Offline
Wow! Diddent no that!
Offline
Bobby500 wrote:
How come most flash games have better graphics and smother animation cycles than scratch does?
Scratch has a very poor drawing tool. Flash has a very good drawing tool with loads of features. For the price of flash the drawing tool better be good.
Offline
Hobbs1100 wrote:
Hey, Archmage, when did you start learning Flash?
Ummm, 3 or so years ago.
Offline
Hobbs1100 wrote:
I meant around what age? I'm 12, so would that be a good time to start?
I'm13. After 1 day, I'm making Bomb Squad. In fact, all I need is to know how to make the buttons (which are movie clips) change like in my Scratch version
Offline
archmage wrote:
Cyclone103 wrote:
Awesome tutorial archmage! This is especially useful for me since I am getting flash some time this week or next week. Thanks!
Remember that this is just for AS2. The newest version of flash features AS3 which is way more efficient. I reccomend trying out both languages though.
That would explain why stuff was not there u described. I was trying 3. Brb, after I try two....
Offline
Bluestribute wrote:
Hobbs1100 wrote:
I meant around what age? I'm 12, so would that be a good time to start?
I'm13. After 1 day, I'm making Bomb Squad. In fact, all I need is to know how to make the buttons (which are movie clips) change like in my Scratch version
14 lol! Sorry to be off topic
Offline
I got a GREAT bundle, it has dreamweaver, fireworks, and contributor, and cost me less then flash with a student discount. Final tab: $218.36. It was worth it. Now, I am a bit confused. Where exactly do you code in Actionscript? I am in 2.0, but it looks to be the exact same as 3.0. Oh. Jeez. I feel dumb now lol! I just found the button. Um. Nevermind. Lemme test it out!
Offline
Ok, problem. The text box is not displaying any text. What do I do? I set it to dynamic, and it is supposed to display the variable.
Offline
Cyclone103 wrote:
Ok, problem. The text box is not displaying any text. What do I do? I set it to dynamic, and it is supposed to display the variable.
Did you do
_root.var (replace with your variable)
Offline