Changed some basic things in the code and added the feature of player stamina.