There's a string just above called script which contains the students
code.  The proxy object just limits the api so that you can keep things
competitive!  There is no reason why the next level can't be making your
own game.
On 26 Sep 2013 20:35, "Simon Davy" <notifications@github.com> wrote:

> In turtlepower/asteroids.py:
>
> > @@ -52,8 +93,23 @@ def setup(self):
> >          self.setheading(90)
> >          self.dead = False
> >          self.rocket = None
> > -        self.__range = 200
> > -        self.state = "shooting"
> > +        self.range = 200
> > +
> > +        self._update_callback = None
> > +
> > +        ship = Proxy(self, {
> > +            'fire', 'range',
> > +            'turn_towards', 'towards', 'forward',
> > +            'xcor', 'ycor', 'distance',
> > +            'on_update',
> > +        })
>
> Ok, so the idea is to only expose limited apis?
>
> Not sure I get this. The student is supposed to write the ship method.
> This example is just how I wrote it in an hour or so, there's other ways to
> do it. True, the teacher might choose to provide a rocket class or similar,
> but I'd want them to be able to build it all from scratch. E.g. first, an
> asteroid turtle, then a ship turtle, then a rocket turtle. We won't know in
> advance what methods they will write.
>
> Also, the turn_towards, xcor, ycor, etc methods are part of the stdlib
> turtle interface, not specific to this game, and I would want them on every
> single turtle, not per world. It's up for the student to decide what they
> need to do.
>
> Although, I do think update() is a bit better that callback() as a name.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/AllTheWayDown/turtlepower/pull/19/files#r6611819>
> .
>