Be a Supporter!
Response to: Checking if Array is too large?? Posted October 24th, 2008 in Game Development

I believe what you're looking for can be handled by checking the array's length property, ie:

if (someArray.length > someNumber) {
  // do stuff...
}
Response to: Platformer ActionScripter wanted! Posted October 23rd, 2008 in Game Development

Meh, some of the better stuff has an almost Katamari or Parappa the Rapper feel to it. I'm not convinced you're ready for game animating, though. I'd reccomend you refine your work a little more. Plus, have some game-related stuff out there for people to see, walk cycles and the like, before you start looking for a coder.

Response to: Lack of AS3 support Posted October 23rd, 2008 in Game Development

Bah; make your own examples! Start thinking like this: "Wouldn't it be cool/nice/handy if Flash had..." then get crackin. If you get stuck, ask someone for help. Here's a few to get you started:

Wouldn't it be handy if Flash had a linked-list implementation? Or a tree implementation? Or a graph (the data structure, that is)?

Wouldn't it be cool if Flash had a way to centralize control over loaded/library sounds that aren't set to Stream sync?

If you've got the basics, what you need now is experience. You can't get experience by reading a book or tutorial; you just gotta get out there, do it, make your own mistakes and find your own way. Trust me, you'll get a much firmer grasp on the "hows" and the nuts 'n bolts if you strike out on your own; try something, break it, then fix it. If you can't fix it, look for another way to do it.

Have some confidence in your own abilities! If you've gotten this far, you don't need anyone to spoon-feed you anything now. You just need pointers when you get stuck. ^^

Response to: Flash CS3 Trouble Posted October 23rd, 2008 in Game Development

Sounds like you either have a small gap in your lines, or your lines are so close together its fooling Flash. Tinker with the 'close gaps' setting on the paint bucket and see if that helps. If it doesn't, take the paintbrush tool and add a little spot of fill to the area you're trying to fill, then try again.

Response to: The Flash 'Reg' Lounge Posted October 22nd, 2008 in Game Development

Root canals don't hurt so long as someone competent is doing them. They gave me a 500mg or 1g (I forget which, it was something like 10-12 years ago) Motrin before they even numbed me up, and by the time they actually started the procedure, the only thing I was feeling was At One With the Universe. The whole process took, like, an hour, which included the time spent waiting for the local to kick in.

I was a little sore afterward, but it was nothing compared to the pain I was in before I had it done. Definitely get it done, by an oral surgeon if you can swing it. That stuff can get out of hand in a hurry if you don't take action; you don't really want gangrene in your jaw...

Response to: The Flash 'Reg' Lounge Posted October 22nd, 2008 in Game Development

At 10/22/08 05:44 PM, Kirk-Cocaine wrote:
At 10/22/08 04:42 PM, Cojones893 wrote: I'm up for shunning the "GIVE ME THE CODE" kiddies.
Shunning them only makes them bump their thread every 10 mins, with an increasingly angry icon and and increased number of caps. Rather than just dumping code on them, you should link them to tutorials and/or give them a near finished code, that they have to tweak themselves. That way they'll (hopefully) learn a little, at least.

I find myself honestly coming to the conclusion that a great many people posting "OMG PLZ HELP" threads have no interest whatsoever in learning anything. They're working with a copy-paste script that they don't understand a line of, and they want you to fix it so they can take credit for your work. If you call them out on it, the answer is always the same: "I know the basics." Apparently, somewhere along the way "the basics" became "knowing how to pirate Flash, open it, and copy and paste a script onto an instance." And I hate viewing forum posts through such cynical lenses; I want to help people who genuinely want to learn.

I just think that those people are greatly outweighed by 14 year-old script kiddies who think that being able to work BitTorrent qualifies them to write the next Halo without learning anything at all, and sometimes the ones who genuinely want to learn slip through the cracks.


Also, speaking of tutorials you people need to write more stuff for AS3: Main. It's been out for two versions of Flash now and AS3 Main is still tiny compared to AS: Main. Jeez =P

You can't effectively copy-paste AS3 scripts without having at least a passing knowledge of the language, hence no demand? That and a lot of the stuff in AS3 isn't all that different from, and is effectively covered by, AS:Main tutorials?

Also, I'm a lazy bastard. I dunno about anyone else, but that's my story and I'm sticking to it. ^^

Response to: The Flash 'Reg' Lounge Posted October 21st, 2008 in Game Development

Halloween Hijinx
I'm not sure what my plan for this year is, but a few years ago I hit upon a pretty good idea. I showed up at a buddy's Halloween party absolutely dressed to the nines; full pinstriped, 3-piece suit, black tie, hair slicked back, the whole thing. I would slip in and out of groups mingling about the party, and eventually someone would inevitably ask me what I was.

"Well," I would start, then in one smooth motion draw a cap gun from my suit and level it between their eyes, "I'm a hitman." Then I'd pull the trigger.

I ruined a couple of costumes that night...it was great.

Response to: Lack of AS3 support Posted October 21st, 2008 in Game Development

The fact that instance-level scripting has been consigned to the inglorious, unmarked ditch of a grave it so richly deserves seems to be the single biggest hangup most people have with migrating from AS2 to AS3.

Response to: Lack of AS3 support Posted October 21st, 2008 in Game Development

We're out there but, as you've mentioned, the vast majority of NG forumites are still on AS2, either because they're still using Flash 8 or earlier (can't afford CS3/4, which is perfectly understandable), they feel more comfortable with AS2/don't want to learn AS3, or they can't actually code and rely on copy-pasting to phail their way through a project, which is simply not an applicable strategy in AS3.

So, if you need some help or wanna get something going, throw a post out there. You won't get as many responses as you would if you were using AS2, but you will get some.

Response to: Advanced AS3 learning Posted October 21st, 2008 in Game Development

If you have the syntax down, you're more than halfway home. What's left now is learning how to think; by that I mean specifically how to approach solving a problem using ActionScript.

So, start small, with simple things that you can easily examine and hold in your head the details you need. Even then, don't be shy about keeping a notebook on your desk; jotting down notes and ideas (or do it in Notepad, or whatever floats your boat) as you work.

Most of all, don't be afraid to make mistakes. You'll learn tons simply by making a mistake, breaking your code, and figuring out how to repair it. You are not alone when you compile a new class for the first time and find yourself staring at a list of errors 30 lines long. You also aren't alone when you're coding along and suddenly find yourself at a dead end. These are normal parts of the learning process. Don't get down on yourself, just take a step back, look at your code, and think about another way around the roadblock you've hit. Sometimes there isn't one, and that's okay too; that means you've learned that a certain way of doing something doesn't work (or does work, but not particularly well), which is, in itself, valuable knowledge.

The important thing is to not give up and stay at it. You've got your kernel of knowledge, which is essential. Now you need to get some experience to expand that kernel of knowledge, and that's something you can't garner from a book or a tutorial.

Response to: Multiple registration points? Posted October 20th, 2008 in Game Development

Shouldn't you be adding the width or (width/2) to the top-left registration point to get the bottom-right or center registration point?

Response to: AS3 Tower Defence Posted October 20th, 2008 in Game Development

Any TD tutorial will serve as a base point; the things you have to do in a TD game don't change from AS version to AS version, what changes is how you go about performing them.

You probably aren't going to find many (if any!) line-by-line tutorials for this in AS3, so start out by looking at AS2 tutorials then start thinking about what you're going to need to do to migrate them to AS3. For a great many things, the answer is "not much," maybe strip some underscores from property names. The horrendous practice of instance-level coding will be replaced by the vastly superior practice of writing classes; this is probably where you'll start to hit snags. Look at the instance-level scripts and think about how they relate to a proper class; onClipEvent(load) is the (rough!) equivalent of a constructor in a class, and of course onClipEvent(enterFrame) is replaced by an event handler for Event.ENTER_FRAME, just to name a few examples.

Take it step by step, abusing the Flash help files, possibly keep an OOP tutorial open alongside the TD tutorial while you're working.

Doing a full-fledged AS2->AS3 migration will probably do more to help you learn AS3 than just following an AS3 tutorial by itself. That's just my thoughts on it, though.

And don't worry if you don't wind up with a kickass TD game at the end of it; the important thing in this case is the journey, not the destination.

Response to: AS question Posted October 20th, 2008 in Game Development

The easiest way to do this is to do define a variable for maximum HP and then use Math.min.

Ie: currentHP = Math.min(currentHP + healingAmount, maxHP);

The min method of the Math class, in case you didn't know, returns the smaller of the two numbers passed to it.

Response to: The Flash 'Reg' Lounge Posted October 20th, 2008 in Game Development

I guess better manbird than manbearpig, right?

Interestingly, the exact meaning of the name is in dispute among the more esoteric circles of biblical etymology; with son of the south (another literal translation), a corrupted version of Benoni (son of my pain, a reference to Rachel's death during childbirth) and Benjamim (son of days, a reference to Jacob's age) all being put forth as possible roots for the name.

Who knew my name was so mysterious? I mean, besides Wikipedia.

Response to: The Flash 'Reg' Lounge Posted October 20th, 2008 in Game Development

Benjamin = "Son of my right hand/Son of the right hand."

...yeah. I'm sure you can take it from here.

Response to: big problem, need help Posted October 19th, 2008 in Game Development

Nah, you can write a class for it in AS2. Probably easier to handle in AS3 (OOP support is better in AS3), but you know how it goes. Just make sure any MC you want to have the specified behavior is linked to that class.

Response to: can you help me figure this out? Posted October 18th, 2008 in Game Development

This is a primo example of why mastering copy and paste makes you admiral of the PHAILBOAT ARMADA.

Press F1 in Flash, read the help files, learn some syntax. Google some actionscript basics, whatever...ahem...floats your boat (or flotilla, as the case may be) for learning. This is a question that shouldn't even have to be asked--even a mostly firm grasp of the basics would be enough to let you puzzle out from the code's context the answer to your question.

Feel free to believe I'm being a jerk; I'm actually trying to do you a favor. How do you repair a car if you think a screwdriver is a mixed drink? How do you debug or tune platform and enemy collisions if you can't even tell what frame is what in your player's script? You gotta crawl before you can walk; likewise, you gotta learn the language before you can develop a game.

Put forth the effort and reap the rewards, it's as simple as that.

Response to: Are you using Actionscript 2 or 3 ? Posted October 17th, 2008 in Game Development

int and uint are practically worth the price of admission for AS3 by themselves. ^^

Response to: Are you using Actionscript 2 or 3 ? Posted October 17th, 2008 in Game Development

AS2 represents the last iteration in the original Actionscript paradigm; allowing designers to add interactivity to Flash projects with minimal effort and knowledge. You won't find much that truly qualifies as a "tutorial" for AS2, at least not here, you'll find (usually not very well-written) snippets for copy-pasting with a bare-bones explanation (if you're lucky) of what the code allegedly does, assuming the one who posted the snippet didn't just copy and paste it from Flashkit or actionscript.org.

AS2 is not anathema to the "hard-core," think of it like the senior citizen of the two (old, slow and prone to shit itself with no warning). You can write perfectly servicable code in AS2, but that requires you to know what you're doing, and many times the things you want to do require hacks, kludges and similar workarounds to otherwise beat the Flash Player into a submissive state where it will, to the best of its ability, do what you want.

AS3 is the first iteration of the new Actionscript paradigm; a robust, class-based backend that demands from you that you follow the rules in exchange for performance that, quite simply put, makes AS2 look like the oxygen-tank-carting, walker-using fossil it is. If you know what you're doing, you can write efficient code with (comparatively) high performance without requiring a hack everytime you want to do something complex. You won't find a lot of AS3 script reposi...err...tutorials because, as Gust said, the syntax is easy to pick up and if you have basic-level programming knowledge you're three-quarters of the way home already.

The question comes down to the legwork you're willing to do. If you actually want to learn a language and get the fundamentals of programming, you will get more out of AS3 than you ever could out of AS2. If that type of effort doesn't appeal to you and you think wanting to make a game entitles you to do so, yeah, start copy-pasting scripts in AS2.

Just don't be surprised when, should you hit a snag or otherwise break the code, the people who try to help you don't have a single clue what they're talking about and the people who know what they're doing don't have much to say to you.

Response to: Getting The Bg Off Of Sprite Sheets Posted October 16th, 2008 in Game Development

If your spritesheet is in a lossy (read: JPEG) format, there isn't much you can do to avoid "blur." Assuming a lossless format (GIF or PNG), the proper Trace Bitmap settings (tip: try setting your curve fit to "Pixels") will result in vector data that is virtually indistinguishable from the original spritesheet. Then you can just select the background and delete it, just like any other fill.

Response to: The Flash 'Reg' Lounge Posted October 16th, 2008 in Game Development

You shoulda been in Boston in 04. Where else can someone be killed by a beanbag to the eye?

Response to: The Flash 'Reg' Lounge Posted October 16th, 2008 in Game Development

Riot if they win, riot if they lose. Sounds like Philly, alright. ^^

Response to: Enemy script not working Posted October 16th, 2008 in Game Development

If I had a dollar for every 10 minutes I spent pulling my hair out over a misplaced rightbrace I'd be a very rich man. ^^

My AS2 is rusty as hell, but shouldn't it be Math.random()? Add some trace statements to the part of the enemy script where the fireball is being spawned. If you don't see them ever you know that section of the code is not executing and that's where the problem lies. If you do see them, it's back to the fireball code, though I don't see anything else obviously wrong with it offhand.

Response to: Unknown error in AS3 Posted October 16th, 2008 in Game Development

Number 1, why necro a thread?

Number 2, maybe you should read a little more closely. The listeners are still needed; the only thing that changes is that title_mc no longer exists on the 2nd frame; everything else is still there.

Response to: Oh, this has to be possible... Posted October 15th, 2008 in Game Development

Are you trying to call the function from within onEnterFrame or are you trying to assign a function from the array to onEnterFrame?

Response to: locked and unlocked things. Posted October 15th, 2008 in Game Development

At 10/15/08 08:58 PM, toontown1 wrote: i need some help with actionscript. i'm an ok scripter...
...well i don't know how to setup my own codes yet...

...I think my brain just broke.

Response to: locked and unlocked things. Posted October 15th, 2008 in Game Development

_enabled is a boolean property of MCs and buttons. Set the property appropriately (the name is pretty self-explanatory) for the appropriate buttons/MCs to enable or disable them.

If you need me to post code for how to set a property, I'm afraid I'm going to have to decline. ^^

Response to: locked and unlocked things. Posted October 15th, 2008 in Game Development

I'm assuming AS2 here, look into the _enabled property in your docs, that seems to be what you're after.

Response to: Game Tutorials Posted October 15th, 2008 in Game Development

Do you honestly know what any of that does, or did you copy-paste it? Are you looking for true-to-god tutorials (of which Google will turn up bazillions) or are you just fishing for more snippets to blindly paste into your code?

From the looks of things, you don't need tutorials on games yet, you need to learn the basics of the language, and perhaps programming in general first. If you aren't willing to put in the legwork to at least get the fundamentals (like instance naming) down, you really shouldn't waste your time trying to make a game.

Response to: Platformer game problem :< Posted October 15th, 2008 in Game Development

Yup. Keep a reference to onscreen powerups in an array and, when the routine that scrolls the level is called, it also applies the scroll to any powerup references held in the array.