MichaelSinsbeck / platformer

A ninja platformer written in LÖVE
7 stars 0 forks source link

Campaign jumps to wrong level #170

Closed Germanunkol closed 10 years ago

Germanunkol commented 10 years ago

To reproduce, close the game after finishing level 2 (the game will remember that you've played level 2). Reopen, but instead of continuing at level 3, choose another level (7, for example) finish the level and the campaign will jump you to level 3.

I guess when starting a level, the campaign number isn't set correctly.

michalove commented 10 years ago

Solved. I split up the menu.startGame function into two: the original one and a new one "menu.startCampaignLevel". If the second one is called, you have to give a number as parameter (not a filename) and then it does the same as menu.startGame, except that the Campaign.current is set correctly. The level editor still uses the menu.startGame.