I'm writing a pacman style game that has a lot of things to be drawn,
namely, the dots that pacman likes to eat.

I'm finding that the drawing of the dots is greatly hampering the
performance of the game. If I turn them off my app consumes much fewer
cpu cycles than if they are left on.

here is the code i'm using to draw the dots: http://paste2.org/p/1432169

 void drawDots(Canvas c) {
                if (!this.drawDots)
                        return;

                Paint p = new Paint(mPaint);
                p.setColor(this.dotColor);
                for (int i=0; i<dots.size(); i++)
            {
                        Dot d = dots.get(i);
                if (this.pacdroid.detectCollision(d))
                        d.disableDot();
                if (d.enabled)
                        c.drawCircle(d.x, d.y,d.r, p);
                //dots.get(i).draw(c, p);
            }
        }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to