Here's my level class. I removed some code, but this is the main structure. In main program I call first cLevel.Load_Mission_Data(1) after this player can select a vehicle and after that I call cLevel.Load_Map(1,"0101").
As I said before, all this works on HTML5, but not in Android. If I remove cLevel.Load_Mission_Data(1) and leave the second call, I get my data what I want.
'********************************************* ** * *
'*** LEVEL class
'************************************************ ** *
Class cLevel
'********************************************* ** * *
'*** Load mission data
'************************************************ ** *
Function Load_Mission_Data(campaign_id:Int)
level_data=LoadString("campaign/"+campaign_id+"/missions.txt")
If level_data
For Local line:String=EachIn level_data.Split("~n")
Next
EndIf
End Function
'********************************************* ** * *
'*** Load map
'************************************************ ** *
Function Load_Map(campaign_id:Int,map_file:String)
Local x:Int,y:Int
map_data=LoadString("campaign/"+campaign_id+"/map/"+map_file+".txt")
If map_data
EndIf
End Function
End Class
|