Old 12-05-2007, 23:01   #1 (permalink)
andy91
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.
Attached Files
File Type: zip duckhunt1.zip (56.4 KB, 10 views)
  Reply With Quote
Old 19-05-2007, 09:26   #2 (permalink)
Emanuele
Junior Graphic Designer
 
Emanuele's Avatar
 
Join Date: May 2007
Location: Rome
Posts: 54
Send a message via MSN to Emanuele Send a message via Skype™ to Emanuele
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) [this will call the function every 2 seconds] that will attachmovie with something like this code:

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.
  Reply With Quote
Old 21-05-2007, 01:32   #3 (permalink)
John Good
+
 
John Good's Avatar
 
Join Date: May 2005
Location: Tropical Networks
Posts: 1,584
Quote:
Originally Posted by andy91
I dont have much of a clue about action script.

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
  Reply With Quote
Old 21-05-2007, 04:22   #4 (permalink)
paulanthony
mingin dawg baitch
 
paulanthony's Avatar
 
Join Date: Apr 2004
Location: Belfast
Posts: 1,035
Send a message via MSN to paulanthony
Quote:
Originally Posted by John Good
Forget about game programming. Just forget it.
Learn the basics first.

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?
__________________
  Reply With Quote
Old 21-05-2007, 04:25   #5 (permalink)
d*d
Moderator
 
d*d's Avatar
 
Join Date: Oct 2004
Location: Bristol
Posts: 3,299
I have a feeling we'll be getting a few more questions about this game
  Reply With Quote
Old 22-05-2007, 15:56   #6 (permalink)
andy91
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.
  Reply With Quote
Old 22-05-2007, 16:06   #7 (permalink)
andy91
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.
Attached Files
File Type: zip duckhuntg3.zip (95.1 KB, 9 views)
  Reply With Quote
Old 24-05-2007, 20:40   #8 (permalink)
Emanuele
Junior Graphic Designer
 
Emanuele's Avatar
 
Join Date: May 2007
Location: Rome
Posts: 54
Send a message via MSN to Emanuele Send a message via Skype™ to Emanuele
Can't post here the solution for exceeding space problem. However you can download it from the link I told you in the PM.
Bye.
  Reply With Quote
Old 25-05-2007, 20:10   #9 (permalink)
andy91
Registered User
 
Join Date: May 2007
Posts: 29
Thanks alot for your help buddy
  Reply With Quote
Old 27-05-2007, 17:42   #10 (permalink)
switch
Deep in the Design Trench
 
switch's Avatar
 
Join Date: Sep 2006
Location: California
Posts: 19
Send a message via AIM to switch Send a message via MSN to switch Send a message via Yahoo to switch
Quote:
Originally Posted by paulanthony
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?

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.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8