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

#1 2010-09-16 18:14:01

igorl
New Scratcher
Registered: 2010-09-16
Posts: 2

Instansing of sprite elements

Hi,
Is it possible to create in runtime several instances of one defined sprite element?

Thank you,
Igor

Offline

 

#2 2010-09-16 19:25:39

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: Instansing of sprite elements

If I understand your post correctly you are looking for something like "Sprite Duplication" or "Cloning" currently you can not do this in Scratch.

If I misread your post then just clarify your question and I'll try and give you an answer.


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

#3 2010-09-16 21:54:24

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Instansing of sprite elements

If you mean what demosthenes said, you can do it somewhat, but not really.  The sprites have to be made already, you can't create new sprites in a program (at least not with just scratch).  In which case you would have to set up a variable that would tell each sprite if it should go.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#4 2010-09-16 21:54:57

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Instansing of sprite elements

If I understand what you're asking, then no. Any sort of cloning isn't supported by the current version of Scratch. Jwosty's upcoming mod, Blocktalk, will let you define a sprite class and then make instances of it. A "clone" feature is also being considered for future versions of Scratch.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#5 2010-09-16 22:20:24

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Instansing of sprite elements

As of now, there are no working Cloning functions of any time. The best way is to have a decent amount for the actual thing itself (i recommend 10 for shooters, 20 for small things...) and you can code one sprite and duplicate using the duplicate function in the sprite pane.   big_smile

Last edited by bbbeb (2010-09-16 22:20:57)


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#6 2010-09-17 01:44:58

igorl
New Scratcher
Registered: 2010-09-16
Posts: 2

Re: Instansing of sprite elements

I see, thank for answers!

Offline

 

Board footer