Friday, 17 July 2015

In a nutshell

Encapsulation.  Neat word.  But I am yet to fully grasp what it is and how to use it better.
Current code does everything I want it to.  However, I now want to add something to the code to make it do more.
To be specific, I have a map.
Click a button and a new randomly generated map appears on screen.  But the 'game' needs to be more than just that.
So I wrote some extra lines to add a 'player' somewhere on the map and visible on screen.  About 10 lines or so.  However, rather than working first time without trouble (expecting way too much there), it throws an error about one of my arrays not being in scope or something.


*EDIT
Apparently, it was probably a caching issue with the debugger rather than something wrong with my code. AS the new code that wasn't working last night is now working fine even without any extra changes.  A restart of the IDE seems to have fixed it.

No comments:

Post a Comment