free hit counters
The Process Forum - View Single Post - TF Flash Game the Second
View Single Post
Unread 06-03-2009   #64
monomonkey
it's monkey twice!
 
Join Date: Dec 2007
Posts: 175
Re: TF Flash Game the Second

Quote:
Originally Posted by cpt soban View Post
theres a simple intuitive thing called _visible? I've always been using _alpha (or set alpha) for transparencies in programs.
Yep. All I do in these flash projects is create movie clips of the animation, name them, and then set _visible to false and stop() playing until the trigger. So when you make a pair, it checks to see which pair you made (this alone took me forever since the base tutorial game I borrowed some of the code from did not do this) and then I have it make that object visible and begin to play it.

Within that movie clip is even more code that determines which dialogue line to display in addition to switching out the eyes for "up" or "down" versions of the ones already displayed and (until the next version) choosing which smile to display (if any).

So yeah. Flash has _visible = true/false for that. For these, since they're dynamic I guess, I was forced to use _alpha = 0 / 100. I just didn't know that this was required since it wasn't in the livedocs from apple's Flash API site (or anyone else's site for that matter). Initially I was having problems with just loading them in since they'd flash once they were loaded in, but in trying to fix that I generated even more problems. In the end, the solution was to set their alpha to 0 BEFORE I loaded the image into the placeholder movie clip.

I try to be as concise with my code as possible, refusing to use methods or function calls or setting up classes or things like that, which is part of the problem. I just don't like that style of coding, personally. This is probably why I have so many problems, but I'd rather be able to understand my own code when something is broken.

Edit: Super-secret progress update: 75% done re-making the Cat stage. I guarantee I will run into my stack-of-ten problem and I have yet to brainstorm a solution to this problem. In case you haven't read all my posts, this is an inherent flaw in Flash that prevents you from stacking more than ten objects on top of one another. If you do this, each new object past the tenth will cause the first one to disappear. Think of it like a line of people. When the line gets to 10 and this is the maximum capacity (despite no warnings suggesting this maximum capacity), normally the last person will just not be able to get into the line. But what Flash does is say "hey first person in line, get out of the line. We know you've been waiting there all this time, but this new person wants to get in the line, so we're forcing you out."

Isn't Flash great!

Edit 2: Realized I was being stupid(ish) with regards to the stacking problem. After the animation ended, I would put the original image in the last frame of the animation so it would display like that, because I was having problems with proper spacing in the previous Flash game (that I now understand the causes of). So, I would have these same-size images all stacked on top of one another rather than individual small parts scattered around. Every image is a PNG with the same size, so it's just the part and then a bunch of blank space. It's the stacking blank space that Flash has an issue with, so removing it removed the problem with stacking.

Still working on re-animating the cat stage (since I made the same mistake I did with the other game until I realized what I was doing wrong (you have to add one pixel of blank space all around every image as you make it or Flash freaks out)), but it won't be long now. Mind you, I still intend on re-doing all four stages I've released so far with this addendum and then finishing up the 5th super secret one before I upload anything.

Edit 3: Cat stage finished! With the extra time I had that I didn't want to spend copying and pasting endless code into the 4 other stages, I decided to make the code-generator, which is now also finished! It didn't really turn out exactly the way I described, but it does give you the four digit number that corresponds to the facial expression you want for the scene. I originally intended for there to be an automatic code generator that would actually output the text file, but that's a lot more work and I think I'll stick with this simple interface for now until people actually tell me they want an automatic code generator (hint: don't tell me you want an automatic code generator).

I also added some elements to the cat stage since I was no longer limited by the stack-of-10 rule. I rushed it, but it's pretty basic in its functionality and it does add a sense of realism to the whole thing kinda, or at least a proper "story"-driven idea. You'll understand what I mean when you see it. If it doesn't look right (as with anything), let me know and I'll fix it (or at least think about it). For the billionth time, I'm not an artist and I really don't have an eye for these things, which is why I'm using tiny sprites in the first place =x

Last edited by monomonkey; 06-09-2009 at 05:47 AM.
monomonkey is offline   Reply With Quote