[Squeakland] Copy an object programmatically.
Randy Heiland
heiland at indiana.edu
Tue Mar 7 01:40:49 PST 2006
> -----Original Message-----
> From: Blake [mailto:blake at kingdomrpg.com]
> Sent: Tuesday, March 07, 2006 2:05 AM
> To: Randy Heiland
> Subject: Re: [Squeakland] Copy an object programmatically.
>
> On Mon, 06 Mar 2006 07:20:10 -0800, Randy Heiland <heiland at indiana.edu>
> wrote:
>
> > The key is that you can create a variable which is of type 'Player' (on
> > the variable's menu, select 'change value type' and choose 'Player').
> > E.g., I created a player variable called 'clone1' for my sketch
> > (actually I called it 'clone', but apparently it conflicted with some
> > reserved var, so a '1'
> > was appended). You can then
> > 1) assign something to that var - e.g. 'sketch's copy', and
> > 2) use that var on the left-hand of an assignment - e.g. replace the
> > 'sketch' in 'sketch's x <- <value>' with 'sketch's clone'
> >
> > Hopefully the attached image will help clarify.
>
> Yes, thank you. So you have to do everything with the base type first and
> then replace with the variable?
That's my understanding.
>
> > You might also want to get in the habit of doing things in a playfield
> > instead of in the world.
>
> Yeah, I noticed the problems with using the world pretty quickly.
Please copy the list! Archives are a wonderful resource.
--Randy
More information about the Squeakland
mailing list