-
How do you hide a cloned movie element?
ok one of the users on this board helped me with cloning a movie element.
ok the movie element i cloned was an asteroid.
I have 5 astroids in my game.
I have a ship that shots a bullet upwards.
This is the code i have used for all my other games concerning hiding an object after collision:
astroid=element("astroid")
bullet=element("paint 207")
if(astroid.collideRect(bullet))
if(astroid.hide())
if(astroid.position.x=-999)
if(astroid.position.y=-999)
}
ok well its not working with this one because well im not sure but the bullet goes through the asteroids. Maybe it cant hide it because its a clone or a movie element.
Could someone help me figure out a way to hide the cloned movie element ("astroid")
If you need me to make an attachment of my game in progress i can, but otherwise, please send a message of help as soon as possable.
thanks
-
Senior Member
astroid = element("astroid").clone()
astroid.hide();
-
so my code cant be this:
astroid = element("astroid").clone()
bullet=element("paint 207")
if(bullet.collideRect(astroid))
if(astroid.hide())
what shold it be, because with this code, when i view my game from my site, everything slows down for some reason and this one astroid looks all funny.
Do you have a different code?
-
Senior Member
this should work...
PHP Code:
astroid = element("astroid").clone();
bullet = element("paint 207");
if (bullet.collideRect(astroid)) {
astroid.hide();
bullet.hide();
playSound ("Boom");
}
-
somethings wrong
somethings wrong, well i gatta go, but everythings acting weird lol
-
well
well... one min ill try to get stuff to work
Last edited by sonic04; 02-15-2005 at 06:32 PM.
-
file
can u help me make it so that when my bullet hits the cloned astroids they hide? i cant seem to get it to work, i think its because im used to dealing with paint elements, not movie elements.
ahh jeeze, i cant upload the file i need to convert it to a zip format.
-
Senior Member
Re: file
Originally posted by sonic04
ahh jeeze, i cant upload the file i need to convert it to a zip format.
just use winzip or winrar to compress the file as a .ZIP. then you be able to upload it.
-
A Senior Newbie - How Odd
It may just be a typo in the post, but remember:
In an 'if' statement, you must remember that it's == and not = .eg.
if (bob=sue)
{
terry=june
}
Will set bob to be equal to sue, which you don't want, whereas :
if (bob==sue)
{
terry=june
}
Will set terry equal to june, if bob equals sue, which is what I think you want.
Hope this helps,
Morgan.
Note: Edited because I accidentally hit tab then enter when typing the script, therefore it posted before I'd finished the example. Jeez Lopez you're quick
Last edited by ForumNewbie; 02-15-2005 at 07:03 PM.
-
Senior Member
Originally posted by ForumNewbie
Remember:
if (bob=sue)
no it's:
PHP Code:
if (hell==earth) {
girlfriend=zombie;
}
-
-
o jeeze
o jeeze, well lopez, you know how u made my the sample of the clone movie? I know its a lot to ask for in all, but do you think you could use that movie and make a basic ship and basic bullet that when the bullet hits the astroid clone it hides the astroid?
im not saying you have to do it now, but if u ever had spare time it really help me. Im afraid im getting off on the wrong track and if you give me a good example of just some cloned astroids and a ship and a bullet, that would help me get back on the right track if i can look at what you did.
i just dont understand, ive made other games using my collide code before and the objects hide when collision happened, but i was dealing with all paint elements and no clones. I guess using movie clips and clones is a little different.
Well id really appreciate it if you could make this little mini game for me, but if you cant ill understand.
thanks
Last edited by sonic04; 02-15-2005 at 10:16 PM.
-
Senior Member
-
KoolMoves Moderator
Originally posted by lopez1_de
(every next question will cost an ammount of 10$)
Don't I wish!
-
lol
its ok i know all i need to know...
for now lol
but thanks seriously.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|