Though you can do this in fltk, I am not sure I would - there are
other libraries that are more focussed on gaming, so if that is your
objective then they might well be a better fit for your needs.
Fltk's main strengths lie in other areas, it was not meant to be a
game engine...!
That said, there are a few examples, so a poke about the links page
https://www.fltk.org/links.php might find something - I used "play" as
the search term and got a fair number of hits!