Can you confirm the exact message and the line it refers to? The line you quoted (38) will only throw an NPE if hp is null, but to get there it must have executed line 24, so hp cannot be null (or I'm mis-reading your code, in which case, apologies)
JamesCherrill
... trying to help
8,525 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,456
Skill Endorsements: 30
To debug a NPE insert print statements that print every value (variable or expression or method call that returns a value) used on the line where the exception was thrown. THis tells you which variable or expression was null. Then trace back thru your logic to find out why.
JamesCherrill
... trying to help
8,525 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,456
Skill Endorsements: 30