Mr. Boy
Mr. Boy

Reputation: 63748

What interfaces/base-class should my AS3 engine's base renderable class implement/extend?

I'm writing an AS3/Flex4 game engine, and I want to have a base class for any item that can be put in the scenegraph. I wondered if extending UIComponent is the right approach, but there seems to be a whole lot of internal stuff there I don't want to get tangled up in... if possible I'd have some separation between my engine and the Flex framework. And I'm not sure if UIComponent adds overhead?

My renderable base can do fairly arbitrary things but for now consists of drawing simple shapes like lines and other primitives.

What might make a decent architecture? And also, many game engines have a "render" method to redraw the whole scene... but I imagine in a Flex app I should play with the DisplayObjectContainer or Canvas, rather than roll my own?

Upvotes: 0

Views: 165

Answers (1)

grapefrukt
grapefrukt

Reputation: 27045

If you're making a game engine I'd advise you to stay well away from the Flex classes. They're made to be skinnable, extensible and generic. Neither of which make them especially snappy performance wise.

Go with the most bare bone class you can get away with, in this case Sprite seems like the best choice.

Upvotes: 3

Related Questions