Well, too many pieces of the puzzle are missing to give a suggestion here. Can you please share more of your code?
- the update() is within the Player? If not, to which class it belongs?
- what are source and target and where are they set?
- are the involved Entities all added correctly?
A few tips (I know I’m too much into lists lately ) …
- in many cases the Console can give a great hand in solving things like this (you can try enabling it and see if your entities hitboxes are positioned as you expect)
- you could / should also take advantage of FlashDevelop, compile in Debug mode and set some breakpoints to see what values your variables assume at a given time (assuming you’re on Windows and developing with it)
- another very useful trick is to use the Draw class to draw things in an overridden render() method.
In your case you could try this:
override public function render():void {
super.render();
Draw.line(this.source.x, this.source.y, this.target.x, this.target.y);
}
(don’t know if you must account for camera position in there, 'cause I don’t know yet what source and target are).
But if you can post your code we could surely have a better idea of what could be wrong in it and hopefully be able to come up with a solution.