Death punishment to my cpu using infinate repaint()...

Hey people, lately i was programming my project and i saw something very weird.

i have a map for my game, and i allways see the light flashes of the repainting. my computers thinks alot and i didn't even finish creating the game.

Now, from what isaw from blizzard games and such (sorry for this unfair comparsion), you don't such bugs, they use like X100 more resources and information and yet their game runs X100 better then mine.

Now, i am asking from your experience, is there any ways that can ease the computer cpu suffering greatly? is their for example Images that are drawn more easily? Threads? anything?

i would like to recieve some theortical explainations about this issue :]

[722 byte] By [Aviva] at [2007-10-2 9:11:04]
# 1

It sounds like you are using the standard AWT Paint function (correct me if I'm wrong) to do you painting. There are a number of problems with this:

1.) The AWT Thread also handles input from the keyboard and mouse, so by using the same thread to paint, you hog resources from the thread.

2.) this method draws your image directly to the screen, without a back-buffer. If you don't understand what this means, you can find plenty of helpful information on this forum if you search for "double-buffering" or "page-flipping". Java provides great methods for doing this, but since they are so well documented on other posts, I won't go into them here.

NCecila at 2007-7-16 23:18:05 > top of Java-index,Other Topics,Java Game Development...