if (playerX+playerW <= x) //this shoudl work.........

Time for some trouble shooting then.
You make multiple assumptions and something does not work the way you wanted, odds are something is not...