In my game, I'm making it so that there's lots of coins in it. But what I don't want to do is end up copying like 1,000 coins, since this game is a multi-level game. If I do a script like the one below, when the coins stamp only the original coin has the original properties. For example, if you stamp something 10 times that says when the flag's clicked to hide, only one will have that property, when the flag's clicked.
This is the script I mentioned above, the one that won't work.
when gf clicked if <<touching sprite1?>> hide endThank you for your support!
Last edited by powerpoint56 (2012-05-25 16:56:18)
Offline
When a sprite "stamps" itself, all it is on the stage is a little image. It has no scripts or properties.
If you want to make coins that disappear when they touch the main sprite, you'll unfortunately have to create multiple coin sprites.
EDIT: If you want to control the timing of the coins appearing on stage, you could use a script like this for each coin:
when gf clicked forever if <touching [mouse pointer v]?> hide wait <pick random (1) to (20)> secs show end
Last edited by silvershine (2012-05-25 17:10:11)
Offline
Yeah, that's what I thought
But I looked around and found something interesting - if you don't already know, in version 2.0 of Scratch, you can do something like this!
When gf clicked Clone EndMaybe that will be a solution in the future!
Offline
One thing you can do is make sure that the coins are a different color than everything else (say bright yellow), and then use "if touching color <yellow>" on the main character to detect them. In this case, the tricky part will be removing them, because the only way to remove a stamp (other than clearing the whole screen) is to stamp or draw (with pen) over it.
It won't be easy, but that's probably your best bet, because even in Scratch 2.0, making 1000 clones isn't going to be practical.
Offline
If you're feeling really ambitious, you could make a project designed for exclusively for flash turbo, where everything is drawn with pen. See this project for an example. Using the pen, the program can redraw all the planets very quickly (click on an empty part of the player to add a planet, then click again to select the proper size). If this is useful, I can help you implement the same method in your own project. By the way, if you're planning on making something that scrolls (as I assume you are) the efficiency can be increased by only drawing coins that will appear onscreen. Theoretically, you could have an unlimited number of coins.
Hope that helps.
Last edited by amcerbu (2012-05-25 20:43:09)
Offline