PDA

View Full Version : Critique this game...


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.

Flash Gordon
07-13-2005, 10:01 PM
I just played that game last week.....um....
Anyway, I think you did a great job.

SuperApe
07-13-2005, 11:14 PM
Thank you, Flash. :)

I want to also thank (whomever) for putting this thread in the proper subforum for me. It was in ActionScript 2.0, but this makes much more sense. :o

I am hoping for constructive criticism.
(organization, resource usage, coding, etc.)
Anyone is welcome to chime in.

SuperApe
07-14-2005, 01:25 AM
Actually, I'm bumping this because I don't want to loose sight of the fact that I'm trying to fix one last bug (the masking of the bird mcs). Any help is appreciated. :D

SuperApe
07-27-2005, 06:01 PM
I suppose that last bug will remain until
I figure out for myself how to mask those
bird MCs properly.
Thanks for your input FG.

Flash Gordon
07-27-2005, 07:16 PM
Ah....I see you're trying just to have the bird show just upon the "blue screen" area. Here would be a VERY simple fix: link to the .html file instead of the .swf. I'm not of fan of directly linking to swf's because that can cause many problems, especially in resolution. Would that be a possibility?

SuperApe
07-27-2005, 10:39 PM
While I want to go over that and know how to do that too,
I feel I'm not learning an important piece of the puzzle if I
go that route. Surely, there should be a way of addressing
the MC and / or organizing the project so that I can fix the
bug using the available mask.

I'm looking down the road at a game I want to develop in
the future. Let's says it's a game with animated bunnies in it
and the bunnies are dynamically created duplicate mc's.
They pop out of holes in a fallen log. So, I'll want to know
how to mask them so they appear to crawl out of the holes.

So, figuring out this particular solution would be in my best
interest. At least so I know what I did in this project that
made things so difficult.

That said, I'm usually all for simple solutions and that would
(will) work well in this situation. :) Thanks, FG.

JackCrack99
07-29-2005, 10:23 AM
Looks good for a 1st flash game. I don't know how to fix your bug, but the game is too easy. But I guess any game like this just seems to have that flaw, since you dont see many light-gun games released for the PC. Maybe you could have the birds zig zag, and go diagonaly, like the old Duck-Hunt game?

SuperApe
07-29-2005, 07:11 PM
I don't know how to fix your bug, but the game is too easy.Yes, I agree as a matter of game design, it's not a really challenging game. But, it's supposed to be very easy in order for the payoff gag when you finish using all 12 bullets. Believe me, future games will have a challenging balance in line with true game design. Thanks for you comments. :D

Dylan Marvin
07-29-2005, 08:49 PM
Fun concept for the end.
Is your bug problem that the birds outside of the stage are visible?
This always seems to work for me: On the top layer of your _root, put an exact fitting rectangle around the borders. Copy & paste-in-place this border and scale the copy to 200%. Fill in with whatever color (and maybe delete the lines). Make it a movie clip. Add this
onClipEvent(load){
this.swapDepths(1000);
}
Change the "*100" in your "spawn" duplicate code to "+100". (With a dozen birds or so, you'll have ample levels.) It works and attached is a copy.

Also. you may have noticed how the crosshairs may become choppy over the trees. Very heavy in the graphics department there. Maybe use less trees (make them graphics and duplicate) and run them through the optimizer a bit.

Keep it up.

SuperApe
07-30-2005, 11:21 PM
Is your bug problem that the birds outside of the stage are visible?
This always seems to work for me: On the top layer of your _root, put an exact fitting rectangle around the borders. Copy & paste-in-place this border and scale the copy to 200%. Fill in with whatever color (and maybe delete the lines). Make it a movie clip. Add this
onClipEvent(load){
this.swapDepths(1000);
}
Change the "*100" in your "spawn" duplicate code to "+100". (With a dozen birds or so, you'll have ample levels.) It works and attached is a copy.Thank you for the reply.
I see what you're saying; essentially make a new piece to fit over the border, like the frame of a painting. That is another solution besides duplicating new masks and apply those to each bird. That's a great idea, FG. About the "*100", you'll notice that my bird scale "bscale" is a multiplier. I use "*100" so that larger birds that appear closer will always be on top of smaller birds that appear more distant. A "+100" instead will not necessarily do that. But, it seems I should be able to set the border piece to a depth of 9999 or just something large enough to go over the duplicate birds. Nice workaround. :D

I think next game I develop will be organized a bit better so I won't have this problem. (but it will have duplicate mc's that will be in a masked layer)

Also. you may have noticed how the crosshairs may become choppy over the trees. Very heavy in the graphics department there. Maybe use less trees (make them graphics and duplicate) and run them through the optimizer a bit.I haven't noticed that, no. I know the background image is the heaviest thing in the project. It was originally made with several layers and I just sandwiched them together. I could probably get away with a low quality image. Exporting it as an image (.jpg) and re-importing it for use as a bitmap won't help, will it? (probably no)

Thanks for your help. :D

Dylan Marvin
07-31-2005, 12:50 AM
I could probably get away with a low quality image. Exporting it as an image (.jpg) and re-importing it for use as a bitmap won't help, will it? (probably no)

Sometimes it actually does help. (One can create a vector image so complicated it uses more of a computer's resources than an imported picture. Some people swear by using imported jpegs or pngs.)
It takes a bit of experimenting finding the correct quality and publish settings I'm sure you can find a bit about that subject with a search.

SuperApe
08-01-2005, 05:10 PM
Wow. Without worrying too much about the jpg quality, the movie is now 25% the filesize it used to be. I'm assuming the visual target site problems you were seeing before are probably cleared up as well. The border frame works great (I set the swapDepth level to 99999 just to be sure) so I'm happy with it.

Next project will have to deal with duplicating MCs (or using attachmovie and swapdepth) get them to live in a preset masked layer. But, for now, I'm happy with this. Thanks for your help, FG. :D

Dylan Marvin
08-01-2005, 07:45 PM
Not only does it play smoothly, but the jpeg background's less-than-crisp quality works great to simulate depth --like the birds are more in focus now. Good luck:)