I have the impression that you want it to sound serious and strict. In that case, you may say, '嘿! 不准玩遊戲!' The fact that you are saying this to someone playing games in class will clarify when this rule applies.I [...] was wondering how to say "No playing computer games during class time!" in Chinese.
I actually prefer 玩電腦 to 玩遊戲. 玩遊戲 is more faithful to @yuechu's original, but 玩電腦 has a broader coverage: It can be anything that you are doing with your computer for fun.This is a computer class. So it is better to be 上课别玩游戏！