| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: May 2007
Posts: 29
|
Help with some action script
Ok im makeing my own version of duck hunt for a short project, I dont have much of a clue about action script. But i have my gun and sights set up and an animated flying duck symbol. What i need is the code to randomly generate the duck in a position outsite the screen and then the duck to fly across the screen. You no so that it appears that every few seconds a duck flys across the screen in a random position so that it looks like random ducks flying out of the reeds or something. Ill include my .fla file for you to look at if you want. |
|
|
|
|
|
#2 (permalink) |
|
Junior Graphic Designer
|
You should linkage the Movie Clip of the Duck choosing "Export for ActionScript" by right-clicking on the Symbol in the library and then use a setInterval to call a function (interval = setInterval(this, "functionName", 2000) function functionName { _root.attachMovie(NameOfTheSymbol(duck1.gif in your case), IstanceNameofThenewSymbol, numberFortheDepth, {_x:StartingPosition X of the duck}); } Hope this will be useful for you, and i'm sorry to don't have time to do it on the file. |
|
|
|
#3 (permalink) | |
|
+
Join Date: May 2005
Location: Tropical Networks
Posts: 1,584
|
Quote:
Forget about game programming. Just forget it. Learn the basics first. Fonts are like cologne: A bad choice speaks louder than a good one. Justin Feinstein
|
|
|
|
|
#4 (permalink) | |
|
mingin dawg baitch
|
Quote:
Everyone has to start somewhere. What better place than a mess about with a simple game? I understand where your walk before you can run comment comes from but I reckon if the man wants a go at it why not? |
|
|
|
|
#6 (permalink) |
|
Registered User
Join Date: May 2007
Posts: 29
|
Well i am learning the basics im doing a web development course at college, flash is just a small portion of that and not really the main part im interested in. However we are required to produce a small flash slide show or a simple game. I chose the simple game only to find out the tutor aint really got a clue herself and just handed out a bunch of crappy tutorials to work through and said if you need anything just go on the net and find out how to do it! Last edited by andy91 : 22-05-2007 at 16:08. |
|
|
|
#7 (permalink) |
|
Registered User
Join Date: May 2007
Posts: 29
|
I did manage to get the game in my first post working the way i wanted. Im now working on the second part. Im about two thirds the way their. There is just a couple of majour bugs i need to work out. I can some of you take a look at the attached .fla file and offer any suggestions? The object is to annihilate as many ducks as possible with the minigun before the time runs out. Iv got my ducks flying the way i want and the minigun following the mouse . The problems are i cant get the minigun animation to keep on playing repeatedly when the mouse is held down and there is a problem with the collision detection on the crosshair. The ducks die as soon as they touch the crosshair weather the mouse button is pressed or not. Iv really just used a missmash of different code from different sources to get this far. I just need to tie them togther. |
|
|
|
#10 (permalink) | |
|
Deep in the Design Trench
|
Quote:
This was the method that I learned and still learn by. Sure there are tutorials and basics, but I dove right in and tried to figure it out that way. I had some experience with Javascript and ASP so I suppose I had a small advantage. Learn the way you feel comfortable. |
|
|
![]() |