(Very) Basic OO System
in
Programming Questions
•
1 year ago
Hi all,
I'm using eclipse and have started playing with multiple classes.
I have a Base class which extends PApplet (this is where void setup() and void draw() are). I then pass a reference to the Base object when initialising the new generic Object Class. This way I can generate loads of circle objects etc.
problem is...
How can I get the object class to redraw once every frame?
I could make an update method manually.. and call obj.update() from void draw()
This would work but if I had say ten objects.. obj1, obj2 etc etc then I would have to call update() on all of them separately.
I have tried letting the object class call it's own update() (so that it can draw ellipses or rects itself) but I run into the problem of it drawing more than once per frame.
Dan
1