Monday, June 13, 2011

I'm an object factory (a lua poem)*

I'm an object factory ( parameters )
   
    I make a new Prop2D or whatever when the factory is called
        with ( parameters passed in )
    end construction
   
    I give each one of these created props some built-in abilities
       
        maybe it can modify its own appearance
        then delete itself
        and instructions about how it behaves in a thread (self:stop)
       
        maybe it can blink, or spawn other objects
        or who knows what
        and instructions about how it behaves in a thread (self:stop)
       
    end built-in abilities
   
    I'm the main function for any given instance of the prop built in this factory
        in certain circumstances, I may
            execute one of the built-in abilities described above
        or in other circumstances I might
            change some quality about myself, or create or delete a quality,
            or who knows what
        end circumstances

        when I'm done I'll pass control to another process until it's my turn again
        I could also return some information about my current state       
    end main function
   
    Here's the thread itself
    Please run this thread now
   
end factory


*have I finally gone off the deep end?

No comments:

Post a Comment