That's a legal question above the level of mere anonymous commenters on the Internet. If you feel that there is enough money involved, talk to a lawyer. Here is what your lawyer will ask you, so know the answers to avoid wasting your time and money:
(1) Are there any written agreements at all? Note that e-mail may, in some circumstances, be considered a written agreement (depends).
(2) Was there any relationship by which you would be considered to be an employee? Did they provide office space,or a computer? Did you have to report at particular times and places? Did they provide any compensation at all, whether in the form of pay or something else? Or, just "maybe someday" comments?
(3) Can you prove that you did the writing? This is important. "Why" you did it, or "for whom" you did it, is not the question. I repeat: Can you prove that YOU did the writing? If so, was your writing according to script or outline provided by them (known in some circles as "copy") or was your writing original, merely based on general character names and theme? Did you write after seeing the specific game scenes, or prior to that?
(4) Did you do anything that would relinquish or transfer your copyright?
(5) Did you do anything that granted them a license to use your writing? If so, on what terms?
(6) Assuming that your were paid at a "writer's rate" rather than by "hoping to make big bucks via stock options" rate, how much money would be involved? I have no clue as to what a "writer's rate" is for something like that, but I imagine that an experienced writer, not a known name, would get about $30 per hour of writing (not per hour of game time).
(7) Have they actually used your work in a product that they are selling? Or has it only been used internally, as a demo?