What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
There’s not enough information here for anybody to help you.
Programming is about solving problems, and the first step in any problem is to define it clearly.
What is Point A? Is it a movieclip, the mouse pointer, a Point object? How to you want it to ‘go’? Teleport, move in a straight line, or like a homing missile? What language are you using?
A-movieclip represented by a circle
B-movieclip represented by a circle
I need an equation to move the point A to B.
Problem: The basic equation (X-Xa)/(Xb-Xa)=(Y-Ya)/(Yb-Ya) gets bugged if the point B changes his position.
where: Xa, Xb, Ya, Yb are the initial coordonates of the 2 points. Those should not change.
Xa will be saved in var a;
Xb in var b;
Ya in a2
Yb in b2
Possible Solution: When Point B changes his possition, his X and Y saved will be re-memorated in 2 variables.
Actionscript won’t solve equations for you. To move a movieclip, you need to give specific instructions for where you want it to go. A common way to animate a movieclip is to set an x velocity and y velocity, and use them to modify the location of the clip each frame:
//I defined CircleAVelocity as a point so I can store X and Y velocity in a single variable
CircleAMovieClip.x += CircleAVelocity.x;
CircleAMovieClip.y += CircleAVelocity.y;
If the target location moves, you will need to recalculate CircleAVelocity every frame.