Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Quick random ultimately inconsequential question

Recommended Posts

So.. like the title says.. this isn't really a big deal.. just a curiosity. It doesn't really effect gameplay. But here's the setup.


I have a character that is moving by arrow key presses.. using an enter frame.. nothing to do with greensock classes there. That character is using some gravity, friction, velocity, whatever.. to move every frame..


Then in a separate class (obstacles) on top of the character, I have a couple random objects that are using tweenlite to move randomly between two points in an array of points. easy peasy right.


Well the thing is, that right when the obstacle ends its tween, my character increases speed slightly, I'm assuming because I'm dropping some frames.


I've tried removing the bezier curve the obstacles use.. I've removed all eases.. I've even tried useFrames.. but not matter what I do the character still speeds up very slightly as each tween ends. Any ideas would be great, but no biggie. Thanks.


this is the obstacles code.


	var p:Point = _spots[NumberUtils.randomRange(0, 7)];
		var cp:Point = _centers[NumberUtils.randomRange(0, 5)];
		var _o:DisplayObject = DisplayObject(_obstacles[NumberUtils.randomRange(0,2)]);
		TweenLite.to(_o, _freq-1, {x:p.x, y:p.y, bezierThrough:[{x:cp.x, y:cp.y}]});

Link to comment
Share on other sites

It's tough to say without seeing it in context - there may be some other code that's interfering (or not). It's always SUPER helpful when troubleshooting to have an FLA that demonstrates the issue very clearly and concisely. Feel free to post one if you can. But I can assure you that the tweens don't suddenly accelerate at the end unless you specify an ease that does that (which you said you didn't).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.