Ok.. Got the ship combat integrated into the main project.. the integration itself and making it work within the main program was the easy part.. Even with my preperations, converting it to actually pull the gameworld data and use that instead of the dummy test data, weill that was a whole nother story..

Integrating all this made me realize some of my short comings in the original code.. Like for one, if you going to keep a persistant list of all the ships a player owns, welllll…. You have to be a moron to not have some kind of static global ID number that increments and is assigned to each ship.. yep.. I was a moron.. 

As I said before, because of all the differences in my ship classes during "normal" use and during "combat" use, I created a seperate class for the combat… this way I can use it for players and enemies and all.. and then when you go into combat, I just cycle through the list, convert what I need.. the class adds the rest.. and boom!  But since Im cheating to test, occasionally I would get 2 ships with the same name.. thats bad… 

The combat ships didnt know any difference, and it was combining the two ships health.. Combat ships had ID’s.. the main ship list didnt and I realized I really needed them.. and I needed them to persist and be saved.. which meant I had to add a variable to my gameworld.. which breaks my profile screen.. and started causing null errors, because when creating a profile, the gameworld reference im trying to reference hasnt been created yet.. 

So yeah.. it goes on, and I created myself a little trouble for a bit, but thats all worked out.. With good planning ahead of time (and rewriting this same game code for 4 platforms now) it becomes relatively easy to make a major change without a headache.. 

All in all, so far today ship combat is now in the game, and working properly.. I added the victory and defeat screens.. and modified the combat so that you return right back to the travel screen where you left it.. perfect.. THe combat now parses your original ship list and converts those.. and tomorrow I will get it to reconcile the 2 lists once combat is over, removing any sunk ships, etc.. Im also going to add in a popup for when you return to the travel screen to show you any cargo and coin you may have gotten.. It will be easier to do that on the travel screen since that popup already exists and can be reused..

After I get that done, Im going to get the hand to hand in .. and then that takes care of our integration issues.. hand to hand should be a lot easier to deal with.. I also in this change found some minor bugs on my shipyards in the way they display the health.. so I gotta fix that.. and im putting that here, so I dont forget. 

I also still need to come up with some thoughts on how to handle people if they hit the back button during ship to ship combat.. I do *NOT* want used as an easy escape when things go south.. but at the same time, I have to allow that back button to have functionality to pass certification.. I cant just leave it out.. I may just have it so if they hit back, it warns them… and then if they hit it again, reconcile the ship lists, sink and remove any I need to so its not a complete way to cheat.. and then work it from there.. There’s layers of screens here, so its going to take some playing.. 

In other news, Day 2 of chantix.. I can actually tell I’m smoking less, the urges arent *as* strong.. but of course, its only day 2 on the pill. Crossing my fingers here!