This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-05-25 16:55:43

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Help with game: coins

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
end
Thank you for your support!  big_smile

Last edited by powerpoint56 (2012-05-25 16:56:18)


http://i48.tinypic.com/2072ctw.gif

Offline

 

#2 2012-05-25 16:58:42

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

Re: Help with game: coins

When a sprite "stamps" itself, all it is on the stage is a little image. It has no scripts or properties.  sad

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

 

#3 2012-05-25 17:37:05

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: Help with game: coins

Yeah, that's what I thought  sad
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
End
Maybe that will be a solution in the future!
Now I'm all excited!
Thanks  smile


http://i48.tinypic.com/2072ctw.gif

Offline

 

#4 2012-05-25 18:51:51

ManaUser
Scratcher
Registered: 2009-03-11
Posts: 100+

Re: Help with game: coins

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.


http://i.imgur.com/SPYSM.gif http://i.imgur.com/t9k1Z.gif http://i.imgur.com/OwYVa.gif http://i.imgur.com/0qlZq.gif

Offline

 

#5 2012-05-25 20:34:33

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Help with game: coins

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

 

#6 2012-05-25 21:10:27

KrIsMa
Scratcher
Registered: 2011-09-20
Posts: 500+

Re: Help with game: coins

Ok, you do not need to use a new coin for every game. Hide the coins when someone touches it and show the coin on the next level.


http://blocks.scratchr.org/API.php?user=KrIsMa&amp;action=onlineStatus&amp;online=http://i49.tinypic.com/2pzic0m.png&amp;offline=http://i49.tinypic.com/r7p10n.png
The Scratch Team (and fellow scratchers!) is/are so nice!!!

Offline

 

Board footer