The slope is taken into account as it is the source of energy ;) (mgh, later partially transformed in elastic energy)
Note that the reason why you can avoid to solve the equations of motions (working only with energies) is because all the forces involved are "conservative" in this example. The solid friction is of course not conservative per se but it behaves mathematically as if it was derived from a potential which does not depend explicitly on time. So at the end some quantities are conserved and it makes the problem relatively easy to solve.
It would be more complicated if air friction was taken into account as well.
Note that the reason why you can avoid to solve the equations of motions (working only with energies) is because all the forces involved are "conservative" in this example. The solid friction is of course not conservative per se but it behaves mathematically as if it was derived from a potential which does not depend explicitly on time. So at the end some quantities are conserved and it makes the problem relatively easy to solve.
It would be more complicated if air friction was taken into account as well.