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

#1 2007-05-16 18:23:01

gamerfreak
Scratcher
Registered: 2007-05-15
Posts: 7

Object Creation, and Duplication

It would be nice if there was a feature to create or duplicate an object on the stage.

I.E. Every time A collides with B then bring C onto the stage

Offline

 

#2 2007-05-16 21:06:51

jasonholm
Scratcher
Registered: 2007-05-16
Posts: 5

Re: Object Creation, and Duplication

You could create a batch of objects, put them up in the corner, and hide them. Then, once you want them to appear, you move the next one into place and unhide it. Not an optimal solution, I know, but a temporary fix for anyone who wants to try it out now - say for projectiles or something.

Offline

 

#3 2007-05-16 21:51:34

gamerfreak
Scratcher
Registered: 2007-05-15
Posts: 7

Re: Object Creation, and Duplication

Yeah, I see what your saying. It wouldn't work well in my situation however, it would limit the amount the user could play the game. If you only made 20 projectiles, a player could only shoot or throw them 20 times.

In short, I want to be able to have more than one of the same object on the stage at one time. Let me know what you think scratch crew.

Thanks.

Last edited by gamerfreak (2007-05-16 23:36:29)

Offline

 

#4 2007-05-16 22:13:09

Shrimpster
Scratcher
Registered: 2007-05-16
Posts: 3

Re: Object Creation, and Duplication

Just downloaded scratch yesterday, as a learning excercise, I sat down and made a fun little game of asteroids. Everything was great until I got to the part where the asteroids needed to be duplicated/split apart.  This is kind of a killer for any serious games in the program.

sad

Last edited by Shrimpster (2007-05-16 22:13:51)

Offline

 

#5 2007-05-17 00:01:53

jasonholm
Scratcher
Registered: 2007-05-16
Posts: 5

Re: Object Creation, and Duplication

Here you go -- an example of both the multiple projectiles and the splitting asteroids:

http://scratch.media.mit.edu/projects/jasonholm/3715

Offline

 

#6 2007-05-17 08:02:00

dmagee
Scratcher
Registered: 2007-05-17
Posts: 13

Re: Object Creation, and Duplication

http://scratch.mit.edu/projects/dmagee/3464

This also does multiple projectiles. I simply have 4 shots for the player, as you fire they move across the screen and hide when they hit something or hit the edge. Then when you fire again, they move to the players location and unhide and repeat. Unless you fire really fast, you basically will never notice. I could just add more shots to solve the firing fast problem.

I wish there was a way in the code to copy sprites, because it would be useful for populating my level without making sprites for every bad guy. And it would allow me to randomize the bad guys a lot easier.

Last edited by dmagee (2007-05-17 08:02:56)

Offline

 

#7 2007-05-17 12:39:07

gamerfreak
Scratcher
Registered: 2007-05-15
Posts: 7

Re: Object Creation, and Duplication

I see how to do it with projectiles, however for a game I was thinking about doing, I would need to make 100's of thede enemy's. Its more of a sugestion to be able to have more than one of the same object on the stage, than a question. Thanks for your input.

Offline

 

#8 2007-05-17 15:55:29

ernestpazera
Scratcher
Registered: 2007-05-16
Posts: 5

Re: Object Creation, and Duplication

i think that the performance of 100 items on screen moving at the same time would be disappointing.  i wrote a simple game with 36 moving objects,  (http://www.playdeez.com/scratch/JetLag.sb.zip), and while the performance is "acceptable", the fact that I didn't need to put a "wait" block anywhere indicates that scratch is not meant for high performance applications.

Offline

 

#9 2007-05-17 15:55:39

agiudici
Scratcher
Registered: 2007-05-17
Posts: 1

Re: Object Creation, and Duplication

I think it's a very good sugestion, and I should add the need for arrays to manage multiple objects, and if we have a form to invoke methods that would we even better!!

For example, I made this project http://scratch.mit.edu/projects/agiudici/3941 and that would be excellent to improve it.

Last edited by agiudici (2007-05-17 15:56:07)

Offline

 

#10 2007-05-19 13:44:37

ViNull
Scratcher
Registered: 2007-05-19
Posts: 1

Re: Object Creation, and Duplication

In the eyes of keeping it simple (because I'm using this with my 4 and 7 year old daughters!) I would suggest a "clone" under the Pen group.  Similar to "Stamp", but would copy all scripts, variables, and current settings to a new sprite.  A "Clear" called would remove the clones, and maybe a new Sensing option of "clone?" for conditional operations that effect clones but not the master.

Offline

 

Board footer