remade the def.php and theoretical structure of the game engine