- Joined
- Apr 25, 2008
- Messages
- 2,495
- Trophies
- 0
- Age
- 31
- Location
- SCUMM Bar
- Website
- www.wabsta.com
- XP
- 438
- Country
So, I got myself a little game.
Where a MovieClip(sprite, coin, character, whatever you'd like to call it) moves from one side to the other.
This works, I also managed to get it away when I click it, and it adds points, that it shows on the top of the screen.
The thing is, I want to add more of these coins to the level.
But I don't really know how to do this.
Now I just use
to add a coin.
With an addEventListenere to see if the coin has collision, and if it is clicked.
So, I want more of these coins, each with their own eventlistener.
How should I do this? I'm thinking of creating a new class for this Coins, but I don't really know where to start.
Could anyone help me?
Where a MovieClip(sprite, coin, character, whatever you'd like to call it) moves from one side to the other.
This works, I also managed to get it away when I click it, and it adds points, that it shows on the top of the screen.
The thing is, I want to add more of these coins to the level.
But I don't really know how to do this.
Now I just use
Code:
var coin:Coin = new Coin();
ÂÂÂÂÂÂÂÂÂÂÂÂcoin.x = 100;
ÂÂÂÂÂÂÂÂÂÂÂÂcoin.y = 200;
ÂÂÂÂÂÂÂÂÂÂÂÂaddChild(coin);
With an addEventListenere to see if the coin has collision, and if it is clicked.
So, I want more of these coins, each with their own eventlistener.
How should I do this? I'm thinking of creating a new class for this Coins, but I don't really know where to start.
Could anyone help me?