← 输入框|github.com|刷新
Skip to content

How will images be associated with animal subclasses? #83

Open

Description

@cool-RR

I mean, if the user creates a Frog, how will the frog image be associated with it? If the user create a new animal like Elephant, which graphic will show up?

Activity

  1. darvin commented on Oct 4, 2010

    @darvin

    if user makes:
    class Elephant(Animal):
    image = "some_image_that_in_resource_folder"

    than image will be resources/some_image_that_in_resource_folder.png
    else image will be like image of Animal (base class, some abstract image)

  2. cool-RR commented on Oct 4, 2010

    @cool-RR
    MemberAuthor

    That will require us to tell the user in some way what all the available images are. (And, of course, to make these images.) So it will have to be a help screen with a legend between animal images and names.

    And if the child makes a mistake, his Frog will have an image of a turtle, and I think that children will find this much more emotionally upsetting than us programmers do.

    I'm starting to think this is too complicated. Maybe instead of Animal, we'll have Turtle, and if the child wants to make subclasses, he can call them JumpingTurtle, ColorfulTurtle, ShakyTurtle? So they will all have turtle images. (Possibly with slight random variations, computed with a hash function on the class's name, that'll be cool.) This will prevent these problems.

  3. darvin commented on Oct 5, 2010

    @darvin

    ow, i have idea!
    we can extract image name from name of class and from it's superclass.
    so, we have some base classes:

    • Animal, with image of some "Abstract Animal"
    • Turtle, with image of turtle
    • Frog, with image of frog
    • something another classes

    so, child make it's own class:

    • JumpingTurtle(Turtle) - we shows turtle image
    • JumpingTurtle(Animal) - we shows turtle image
    • LazyFrog(Animal) - we shows frog image
    • FroshLittle(Frog) - we shows frog image
    • JumpingTurtle(Frog) - child means Turtle, so, we shows turtle image
    • PrettyLittleGremlin(Animal) - we don't know that child means. so, we shows some "animal abstract" image, if child don't make: image = "path/to/custom/image"

    i think it is preferable scheme, and we have artist! )

  4. cool-RR commented on Oct 5, 2010

    @cool-RR
    MemberAuthor

    Great idea. Though we'll have to prepare quite a few animals in advance, so it'll be some work. (I'd say 10-20 animals.)

  5. darvin commented on Oct 5, 2010

    @darvin

    yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions