Yes, now I can do following:

private void drawAsteroids(Canvas canvas) {
    GameEntity[] asteroids = mAsteroids;
    GameEntity asteroid;
    for(int i = 0; i < MAX_ASTEROIDS; i++) {
        asteroid = asteroids[i];
        if(asteroid.isAlive()) {
            canvas.setMatrix(null);
            canvas.rotate(asteroid.moveAngle, asteroid.x,
asteroid.y);
            canvas.drawBitmap(
                asteroid.bitmap,
                asteroid.x - asteroid.width / 2,
                asteroid.y - asteroid.height / 2,
                null);
        }
    }
}

thanks again

On 18 янв, 15:19, skink <[email protected]> wrote:
> On Jan 18, 1:01 pm, Andre <[email protected]> wrote:
>
> > Hello skink, thanks for advice
>
> > I agree, my array manipulations is not quite well.
>
> > And I think you right about getters too...(this is
> > one of the key principles in "designing for performance"
> > document), I don't yet replace them with members,
> > just becouse my updatePhysics is take ~1ms to execute...
>
> > Best Regards, Andre
>
> hi,
>
> i mean getters in drawAsteroids() & drawBullets() methods: getX|Y|
> Width|Height
>
> they are called on asteroids[i] & bullets[i]
>
> pskik
-- 
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