I am a new Muslim and want to know that about playing fantasy genre video games. They have monsters and ghosts that players can fight. Is it allowed to play such games?
In general, it is not forbidden to play video games, unless there is clear harm (for instance, destructive addiction) or clearly forbidden content (such as real pornography).
There may be some grey areas of fantasy video games which involve things that are against the ethos of Islam (such as violence, insufficient clothing, relationships outside of marriage, or polytheism), and these are areas where you have to use your own judgment and also consider how the game affects you.
However, in Islam, we are encouraged to make best use of our time, since we will all be accountable to Allah on the Day of Judgment with respect to how we used our time. So you have to weigh how beneficial playing games is to you and the people around you - is it helping you in other aspects of life, or would it be more useful for you to spend time on other things? This is especially relevant with respect to fantasy games since they require a large investment of time. If a person is neglecting their children because they are busy gaming, for instance, that's bad. Anyway, this is something that you have to answer for yourself.
As a side note (self-spam alert!), I wrote a short piece a few years ago about fantasy games and Islam that you might find interesting. It is called "A Muslim Reflection on [Joseph Laycock's] Dangerous Games: What the Moral Panic over Role-Playing Games Says about Play, Religion, and Imagined Worlds" and hangs out on my academia.edu profile page, if you are interested!