Hi all,
when I create a circle physics object and by using applyForce() move it from the bottom to the top of the screen. The physics object moves smoothly as expected. When I attach a graphic to it, it also moves smoothly up the screen. The problem is however, the graphic flickers, and therefore looks faint. I guess this is happening for three reasons: 1) the physics object is moving about 5 pixels a step, and the graphic has to redraw itself evertime. 2) both the body and the graphic is quite small (maybe 5 to 6 pixels diameter). I have tried the graphic as a stand alone graphic and as part of a sprite sheet but I cant see no difference. 3)I have the step rate at 60 frames a second.
Are there any strategies to get the graphic to move without flickering. Another thing to note that this thing is created at runtime (it is a bullet) where as the other object that is created at the start of the level does not flcker when moved (but there again it moves slower and is bigger. I am moving the graphic to the body by using the object:setPosition() function. Is the optimum way of doing this?
I am sure there is an optimum way of doing this, so if anyone has ideas, I am all ears (and eyes).
Comments
Likes: antix
Yes I think I am doing both of those things. Here is a cutdown version of the code that I am using (note I am using Scenemanager for level control)