game algorithm + resource add js