I'm programming a game in as3 using flashDevelop the player (among other things) is moving across the screen using EnterFrame event which update his coordinates while he moves its hard to see details of the animation and its look kinda blur how do i fix this problem?
Asked
Active
Viewed 3,780 times
0
-
you may want to set the pixel coordinates to integers. – Patrick Lorio Feb 16 '12 at 01:02
-
1Another thing that might be useful depending on the type of movement and animations you want is Tweens. Just google "Flash as3 Tweens" or check out a simple tutorial like [this](http://www.zedia.net/actionscript-3-tweens-tutorial/) – M. Laing Feb 16 '12 at 01:05
-
What is the object that you are animating? A vector or bitmap? – redhotvengeance Feb 17 '12 at 23:45
-
i'm pretty sure its a vector. (its not a bitmap) – Yosefki Feb 18 '12 at 18:19
4 Answers
2
As Patrick mentioned you should avoid non integer co-ordinates. You just need to round the values. So instead of:
clip.x += value
Use:
clip.x += Math.round(value)
If you set non-integer co-ordinates Flash the clip may appear blurry due to anti-aliasing as Flash is trying to split pixels. You could also try increasing the frame rate.

Code Monkey
- 335
- 3
- 8
-
i have one that this way clip.x+=int(value), i guess it is the same but i cant see a different – Yosefki Feb 16 '12 at 21:36
1
Have you considered using Tweening libraries?
Some of them are lightweight and automatically make calculations on the movement according to the FPS ( which you should try to maintain high )
Here are couple of them:
Hope it helps

Mc-
- 3,968
- 10
- 38
- 61
0
may this can be helpfull for you. Optimizing transition/movement smoothness for a 2D flash game There is 2 ways to optimizzation.

Community
- 1
- 1

Azzy Elvul
- 1,403
- 1
- 12
- 22