Sentence 2 is wrong. Sentence 1 could do with a bit of a tweak.
The narration of past events can indeed be done using different tenses, for example:
- I was cooking when she knocked at the door
- I had been cooking for an hour when I heard her knocking at the door.
Note how I said "had been cooking for an hour" - that doesn't mean that the cooking has stopped, just that an hour had passed already when the event occurred. The knock at the door is an event - a point in time - while the cooking is something ongoing. The event occurs during the time period.
But in your example, you're not speaking about a fixed event happening during a period - you're saying that two things were happening at the same time - one person playing, the other cooking. You need the tenses to match.
In sentence 1, the tenses match; however, if your purpose is to show the two ongoing activities were coinciding, it might be better if you said:
While I was playing she was cooking.