View Full Version : "Gopher" type game
professor chimpo
02-21-2009, 01:37 PM
Okay guys, I'm not new to flash but new to making flash games (read, I've never really done it).
I work with a friend of mine that does a web comic to do random flash animations for him and now he is looking into making a simple gopher type game (his characters pop up and you bop them on the head with a hammer) and I'm at a loss. I know how to do action buttons and such for a cartoon, but not an actual game.
Any help putting this together would be great, and I'm working in Macromedia Flash 8 but have access to CS4 Master (so Adobe Flash CS4 pro).
Again, any help is welcome and thanks in advance!!
kkbbcute
02-21-2009, 02:42 PM
If you don't need anything especially elaborate/complicated, all you need to do is to get a MC to be the "Contact Area" of the hammer, cover the MC over with the graphic for the hammer. Convert both the MC and your hammer graphic into a movie clip and name it "MainHammer" or something. Then use a function to check if your nested MC (The contact area) hits a gopher when you press your left mouse button. Just use a script that runs once every few seconds that sends random numerical values and checks them with a if else statement to get your gophers to randomly pop up. That's all there is to it.:D
professor chimpo
02-21-2009, 09:52 PM
When it comes to making flash games, I'm an idiot/noob/anything else that applies. Very, very new to it all and I'm not going to pretend I know what I'm talking about. I can do animations, but not so much the gaming aspect, but I'm trying to learn! ;)
That being said, I make a "gopher board" say 3x3 holes. The actual board is one layer, the gophers are another and the hammer is a third, correct? Or are all gophers seperate? I assume the last as the they will be popping up at different times, so having them all as different layers would be the only way for it to work. At that point, I make the gophers into movie clips, and the hammer as well?
From there, how do I script the gophers to randomly pop up and how do I script it so that the hammer becomes the mouse and left clicking will "bop" the gophers?
And if it's not too much to ask, how would I go about making it so that the hit gophers change into something else (in my case, the gophers are people, so maybe using an animation to show pain) and make it so that a score can be kept.
Like I said, I'm really new to the game side of flash and I'm hoping to learn all of this so that I can make much more elaborate games in the future. Gotta start somewhere ;)
kkbbcute
02-22-2009, 03:56 AM
When it comes to making flash games, I'm an idiot/noob/anything else that applies. Very, very new to it all and I'm not going to pretend I know what I'm talking about. I can do animations, but not so much the gaming aspect, but I'm trying to learn! ;)
That being said, I make a "gopher board" say 3x3 holes. The actual board is one layer, the gophers are another and the hammer is a third, correct? Or are all gophers seperate? I assume the last as the they will be popping up at different times, so having them all as different layers would be the only way for it to work. At that point, I make the gophers into movie clips, and the hammer as well?
From there, how do I script the gophers to randomly pop up and how do I script it so that the hammer becomes the mouse and left clicking will "bop" the gophers?
And if it's not too much to ask, how would I go about making it so that the hit gophers change into something else (in my case, the gophers are people, so maybe using an animation to show pain) and make it so that a score can be kept.
Like I said, I'm really new to the game side of flash and I'm hoping to learn all of this so that I can make much more elaborate games in the future. Gotta start somewhere ;)
Sent you a PM so we don't spam this thread and others can submit they're ideas.
cjx3711
02-22-2009, 06:54 AM
Just use a script that runs once every few seconds that sends random numerical values and checks them with a if else statement to get your gophers to randomly pop up. That's all there is to it.:D
You probably need more elaboration to this.
Label your gophers 1-9
Put in the script: random (8) + 1 to get a random number
then put for each gopher:
if (random number == 1) {
Gopher1 pops up;
}
cjx3711
02-22-2009, 06:57 AM
And if it's not too much to ask, how would I go about making it so that the hit gophers change into something else (in my case, the gophers are people, so maybe using an animation to show pain) and make it so that a score can be kept.
You can make the gophers into movieclips that animate the gopher moving up and down. When you click on it, Make the movieclip play a frame of "pain" and add one to your score variable.
kkbbcute
02-22-2009, 07:04 AM
@cjx3711, Don't double post, edit your last post instead, and use AS tags for your script ;)
Anyway if everything is still unclear, you could do away with the animation of the gophers first and just work with 3 frames, being gopher pop up, gopher in pain, and no gopher. Then with the random script, just play the second frame whenever the respective "random" function is called through the if else loop. I suggest you use more than 8 numbers in your random script, or almost all of your gophers would be popping up at the same time. Remember to use setInterval to make the gophers disappear after a period of time.
EDIT: I attached a file with the basic file structure and some pseudocode to go along with it.
professor chimpo
02-22-2009, 01:25 PM
Thanks for all input.
I'll get working on this stuff now and if I screw something up so badly I can't figure out the fix I'll post back. All seems pretty straightforward, but we'll see ;)
Thanks again!
kkbbcute
02-22-2009, 01:35 PM
If you need anything else, such as the actual code instead of pseudocode like those I gave you, you could always give me a PM and I'll help you out.
That being said, I make a "gopher board" say 3x3 holes. The actual board is one layer, the gophers are another and the hammer is a third, correct? Or are all gophers seperate?
Only timeline animation cares about layers. The actionscipt doesn't care about layers, only that they are separate movieclips and each one is given an id so the code can access it.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.