Game

i’m making a game (a scrolling shooter one) and would like to know how to make it when you shoot the tree it adds a movieclip from the library, so it appears whereever you shoot it. I really need to know, and nobody answers on other forums, or they ask me a vital question, then i answer and they don’t respond. please DONT IGNORE and resond a.s.a.p.

thanks.:rambo:

Vital question: what do you mean “when you shoot the tree it adds a movieclip from the library”. You mean like a bullet or something?

pom :asian:

I know what he’s talking about. I have the same problem, but without the tree :wink:

He’s asking how to duplicate a movieclip. We’ll call it ‘bullethole’.

Every time user presses mouse, ‘bullethole’ will be attached/duplicated to where ever the mouse pressed down.

There are different ways of doing this, and I found it using a start drag duplicate (don’t ask me lol)! It worked, every time you pressed it would drag down to where you shot, worked perfectly.

I lost that because it was saved in the temp directory and got deleted… and I forgot the code :-… worked on it for like 2 hrs too!

Yeah, I know, but I’m in one of my do-it-yourself moments. I don’t want to give out the code :stuck_out_tongue:

So what you have to know about attaching movie:[list][]The clip you are attaching must be in the library, and you must give it a linkage name[]the syntax looks like this

attachMovie("linkageName","newName",depth);
// you access the properties like that
newName._x=200;

[/list]pom :asian:

You can use attachMovie to do it as, ilyas suggested, or try the following fla someone did. Also if you are using it for a “dent” in the tree, make your sure have a different sound played - like a thud - I was going to implement this one of my games - but was to lazy

There’s another way of doing it - I’ll post another fla of another way of doing it. Have to find it…

I couldn’t find the other file, but I added some code to a fla that I have up on my site. You can download it from my site because it’s too big to put up here, and I can’t post a link because I use a php script for my downloads.

http://flex.funkyolive.com

Look under ammo system.

View it here

http://flex.funkyolive.com/test/tutorial2holes.html

Is that a new tute you’re working on? Looks cool. And did you bug Kirupa like I told you to? Anyway, I think I’ll create a thread where the users can put what tutorials they’re working on and all.

Oh, and I’ve just bought Jobe Makar’s Flash MX Game Design Demystified!!! So much cool stuff in there…

pom :asian:

Thanks. It was an addition to the first tutorial I did. I haven’t bugged him more yet! The first one was basic shooting. I didn’t do any more because I didn’t get a response from Kirupa. I want to get Flash Games Studio by Friends of Ed - but I don’t know if there’s a second edition for MX.

I posted a tread for that purpose in the tutorial section. Don’t give up!

Hehe, thanks Ilyas.