SuperApe
07-13-2005, 09:08 PM
(please) :D
I am not new to programming or OOP, but I am new to ActionScript.
I am pretty good at picking pieces of code from other places and making it work for what I want to do. The problem with that method is I will sometimes misunderstand what is going on exactly. Also, my lack of experience will sometimes allow me to make bad choices in terms or organization or structure.
I have made this (http://home.netcom.com/~ghstorm/greatout.swf) simple shooting gallery style flash game.
It's based on the structure I found on this (http://www.layoutgalaxy.com/html/htmnewletter47-page1.htm) balloon shooting game.
(It's been expanded upon and added to, but it's structure remains the same.)
Now that I've gotten to this point, I've run into one last bug fix I can't get over:
I want to apply a mask to the bird mcs that are dynamically created. The birds will now "pop" on over the white border, outside the background image, while I'd like to see them masked as they move on/off stage. (Note: to see the bug, stretch the window wide or just maximize your browser.)
I've already found one solution: create a new mask at the same time and setMask() to the new bird dynamically. I'm sure that will work, I just think it's somehow less efficient than using the same mask I currently have over the background image.
The other solution I found on these forums is this: place your bird mc inside a holder mc and mask the holder. Duplicates of the bird made from within the holder should also be masked. That is the solution I'd like to use in this instance. (Mainly because I'm having a problem understanding what's wrong and I want to learn.)
I've already made a simple test file to figure it out, and CyanBlue helped get that to work. Here's that thread (http://www.actionscript.org/forums/showthread.php3?t=26238).
Now on that thread, it made sense, but in this game (and the way it's currently organized) it's not working. I already had my bird mc nested within another mc. (that's the original structure I borrowed) When I try to duplicate the bird, it fails, although I have tried several ways to access the bird mc during duplication. So, as of now, I duplicate the holder, which puts that duplicate on a level above all others so it can't be masked. I am starting to think the way the whole thing is organized is what's keeping me from duplicating the bird. (as suggested on another thread, it may be because in the holder, the bird mc isn't there until frame 2.)
This is why I've decided to show the whole mess of an .fla (http://home.netcom.com/~ghstorm/greatout.zip) (<-- .zip file) and have the nice folks here critique it. I'm sure it's full or organizational no-no's, like putting some code on levels that also have clips, etc on them. While I'd love to know how to mask my birds, I'm sure getting input on everything else about it will be very valuable as well.
Please critique it in full. Tear it apart. In the process, I know I'm going to learn a lot and I hope others can too. That appears to be in line with the spirit of this forum. I hope I'm right about that. :o
Many thanks in advance.
I am not new to programming or OOP, but I am new to ActionScript.
I am pretty good at picking pieces of code from other places and making it work for what I want to do. The problem with that method is I will sometimes misunderstand what is going on exactly. Also, my lack of experience will sometimes allow me to make bad choices in terms or organization or structure.
I have made this (http://home.netcom.com/~ghstorm/greatout.swf) simple shooting gallery style flash game.
It's based on the structure I found on this (http://www.layoutgalaxy.com/html/htmnewletter47-page1.htm) balloon shooting game.
(It's been expanded upon and added to, but it's structure remains the same.)
Now that I've gotten to this point, I've run into one last bug fix I can't get over:
I want to apply a mask to the bird mcs that are dynamically created. The birds will now "pop" on over the white border, outside the background image, while I'd like to see them masked as they move on/off stage. (Note: to see the bug, stretch the window wide or just maximize your browser.)
I've already found one solution: create a new mask at the same time and setMask() to the new bird dynamically. I'm sure that will work, I just think it's somehow less efficient than using the same mask I currently have over the background image.
The other solution I found on these forums is this: place your bird mc inside a holder mc and mask the holder. Duplicates of the bird made from within the holder should also be masked. That is the solution I'd like to use in this instance. (Mainly because I'm having a problem understanding what's wrong and I want to learn.)
I've already made a simple test file to figure it out, and CyanBlue helped get that to work. Here's that thread (http://www.actionscript.org/forums/showthread.php3?t=26238).
Now on that thread, it made sense, but in this game (and the way it's currently organized) it's not working. I already had my bird mc nested within another mc. (that's the original structure I borrowed) When I try to duplicate the bird, it fails, although I have tried several ways to access the bird mc during duplication. So, as of now, I duplicate the holder, which puts that duplicate on a level above all others so it can't be masked. I am starting to think the way the whole thing is organized is what's keeping me from duplicating the bird. (as suggested on another thread, it may be because in the holder, the bird mc isn't there until frame 2.)
This is why I've decided to show the whole mess of an .fla (http://home.netcom.com/~ghstorm/greatout.zip) (<-- .zip file) and have the nice folks here critique it. I'm sure it's full or organizational no-no's, like putting some code on levels that also have clips, etc on them. While I'd love to know how to mask my birds, I'm sure getting input on everything else about it will be very valuable as well.
Please critique it in full. Tear it apart. In the process, I know I'm going to learn a lot and I hope others can too. That appears to be in line with the spirit of this forum. I hope I'm right about that. :o
Many thanks in advance.