Update engine.js

add constructor to created object