zulo
Junior Devvie  
Java games rock!
|
 |
«
Posted
2003-02-23 01:21:16 » |
|
My game is fullscreen bufferstrategy(3),its a breakout game, it runs at 70fps with 64 objects in the game area(bricks) + the ball.
Theres only one type of brick object now represented with a png image, and its static so that means all objects share that image(am I right?).
This fps is only with 64 bricks(2 rows)..theres 32 columns pr row of bricks. And the game runs in 800x600 so I need more rows. I tried with 12 rows, that means its 384 brick objects on screen, and the fps gets down to 30,and the ball is clearly slowing down in movement.
Now heres my question, can I set the clipping to draw only the ball at its new position? I tried g2.setClip(ball.x,ball.y,ballwidth,ballheight); , but it doesnt seem to change anything. I have seen clipping in applets but never in fullscreen applications. Please help.
Do you think the slowdown could be because of all the objects? (384 objects is getting checked for collision with the ball every frame) I could try to change the collision code to check only the bricks that are near the ball..that would be maximum 8 bricks instead of 384,or 600 if the level is big.
|