javascript version of RIKAL Game