How do I translate, "by pretending that something is real?" Just as the title says. I really have no idea how to translate the word "by" in this sense. It's just a form of grammar I've never even been exposed to, so I wouldn't know where to start. Anyone know how?
通过假装...是真的的方式

By pretending the dinner is real, Peter and his friends forgot about hunger.
通过假装晚餐是真的的方式， 潘和他的朋友们忘掉了饥饿。

Or you can take a little liberty:

通过假装用晚餐的方式， 潘和他的朋友们忘掉了饥饿。