What's the Name of That Book??? discussion

This topic is about
Heir Apparent
SOLVED: Children's/YA
>
SOLVED. YA book about a girl stuck in a virtual reality video game. [s]
date
newest »

The cover of the book is green.
Spoilers ahead:
A girl gets a coupon to go to her favorite video game place and play any game for 30 mins. I dont really remember the name of the girl. When she starts the virtual reality game, a glitch occurs in the system, and she cant get out of the game until she wins. She is told about this glitch by one of the employees, but in the game it appears to her as if it were god speaking from the skies above.
She keeps dying and having to start over again. The basic outline of the video game involves her living in a small town and then being called to the palace. It involves a king and queen as well. She has to try not to die.
When she finally wins the game, she wakes up to the love interest of the game holding her in real life. He then explains, that he is the developer and added himself. It all ends up well.