I put meteor(s) out of the _root inside another movieclip but now I have to redefine some things like this:
ext = _root[‘m’+ii]
ext._x = Math.random()*640
How should I define the “ext” when the movieclip isn’t in the root anymore?
David’s idea is excellent. If you put all your asteroids in the same movie clip, everything will be much simpler. You could also consider creating an object containing all the properties of an asteroid for each asteroid. [size=1]Well, that’s what Jobe Makar does in his book…[/size]
And David, I was just trying to say that when you use for in loops, it’s better to write the path completely
for (mc in _root) {
if (this.hitTest(**_root.**mc)) {
ohh… yeah, that’s a good idea. See told you I was Flash ‘cold’.
ok here’s what I got so far. It’s incomplete as the shot doesn’t fire from the ship yet, and it doesn’t take damage the way I want it to… namely like the old asteroids game where you get hit, the ship fades for a few seconds (at which time it’s invulnerable) and then it comes back to visible with damage.
Take a look at it. scalp what you need.
If anyone has any fixes for it, please feel free.
only 27k so far… and the swf is only 4 k so far… pretty nice
I checked the game out but no collision detection… :-
I still have to know how to use this:
ext = _root[‘m’+ii]
when the “m”+ii is not in _root. Instead it’s inside another movieclip.
ext = _root.containerClip[‘m’+ii];
or whatever else you want in the string.
Thanks to all of you! =) =)
I got the collision detection working and I’ve got basically everything working in the game that I wanted.
Thanks again.
you’ve got to post an end result for us. I love games.
Can’t add swf files as an attachment? :o
Ok, here it is even though it’s not complete. It still needs a few things like the
“try again” button I had to disable because of some problems. :-
But I guess I’ll try to work them out on my own.
Thanks to everyone for helping me out with this little experiment.
I can’t look at your file right now, but i just remembered that there is a tutorial at MM’s explaining how to build your own Ateroids game, from A to Z. Might be interesting to compare with your fla when you’re done
I’ve been making the game more now and right now I’m dealing with some collision detection inaccuracy issues…
But actually the game I’m making isn’t a traditional “asteroids” game. You have to evade asteroids as long as you can and as you survive longer, the game gets harder and you get more score.
Well I got a bit of a problem here.
I’d like to make a LOCAL highscore list for the asteroid game.
It should save the scores to a text file on the harddrive and read them when needed.
I have no clue on how to do this… If anyone does, please tell me.
If you’re using Flash MX, you could use the shared objects. That’s what they’re made for
Otherwise, PHP is the way to go, baby!!
Yes, I’m using FlashMX.
Shared objects? What are they:q: =)
Oh… and if I use PHP, how to do it locally?
There is a tute about shared objects. And concerning the PHP thing, you should post it in the server-side section.
pom :cowboy:
I really enjoyed this thread, and voted a 4 for it!
=)
Thanks for voting.
Thanks for the help everyone!
It works perfect now! =)
Well, in that case it would need a little clean-up, don’t you think?
pom
Why php, shared objects are really cool.