0

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?

Yosefki
  • 383
  • 7
  • 22

4 Answers4

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
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:

  1. http://www.greensock.com/tweenlite/
  2. http://gskinner.com/libraries/gtween/

Hope it helps

Mc-
  • 3,968
  • 10
  • 38
  • 61
0
addEventListener(Event.ENTER_FRAME, smothMove);

var i:int = 0;
var j:int= 1;

function smothMove (event:Event):void
{

clip.x = clip.x + i;
        i = i + j;

}
Robert
  • 5,278
  • 43
  • 65
  • 115
Sammy
  • 1
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