this is a boss battle and to beat it you have to collect energy from the beams of light that will shine into the cavern to knock down the crab and attack.use arrow keys to move, 1 and 2 keys to switch between the gem and the sword, finally use z and x to aim the gem(laser comes from the tip)
thanks again to my friends for helping me with code