Game loop implementation