Wednesday, July 29, 2009

CSPSP: feet

Finally brought myself to work on cspsp again. I'm having second thoughts about dropping the counterstrike theme, since it doesn't seem like all of the effort to change things would be really worth it (the code is a ridiculous mess and I basically have to relearn what I wrote everytime I restart work on it. Seriously though, I once spent like thirty minutes trying to figure out why two files had blocks of the same exact collision code. Turns out I had tried to do some refactoring and moved the collision function to another class, but decided to just leave the previous code there [not sure what I was thinking {also, nested parentheses :b}]).

Anyways, I'm still planning to at least redo some of the graphics for cspsp. Today I managed to finish adding feet, which do actually make the players look a lot more like people (instead of crabs):















I'm actually considering just using solid colors for the players. I mean, I really do think that the plain white sprites (which were just for testing) in the screenshot above look better than the ugly normal sprites :/.

(those numbers in the screenshot are just the angle that the player is currently facing - I completely forgot the range and orientation of the angle >_>)

Friday, July 3, 2009

CSPSP code fail

So I was working on the clan system for CSPSP yesterday. Since it required changes to the player's model schema (clan was changed from a StringProperty to a ReferenceProperty), I decided to test out the small maintenance mode I had written into CSPSP (or thought I had written). Basically, it should have just given the player an "under maintenance" message when the state was set to STAGE_MAINTENANCE. Unfortunately, I failed at code copy-and-pasting, and this is what happened:
...
else if (mStage == STAGE_SUSPENDED) {
 mRenderer->FillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,ARGB(255,0,0,0));
 gFont->DrawString("[O] Return",SCREEN_WIDTH_2,SCREEN_HEIGHT_F-20,JGETEXT_CENTER);

 gFont->SetScale(1.0f);
 char buffer[128];
 sprintf(buffer,"You are suspended for %i hour(s)",mSuspendHours);
 gFont->DrawString(buffer,SCREEN_WIDTH_2,SCREEN_HEIGHT_2-10,JGETEXT_CENTER);

 strcpy(buffer,"");
 sprintf(buffer,"Reason: %s",mSuspendReason);
 gFont->DrawString(buffer,SCREEN_WIDTH_2,SCREEN_HEIGHT_2+10,JGETEXT_CENTER);
}
else if (mStage == STAGE_SUSPENDED) {
 mRenderer->FillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT,ARGB(255,0,0,0));
 gFont->DrawString("[O] Return",SCREEN_WIDTH_2,SCREEN_HEIGHT_F-20,JGETEXT_CENTER);

 gFont->SetScale(1.0f);
 gFont->DrawString("The online system is currently under maintenance.",SCREEN_WIDTH_2,SCREEN_HEIGHT_2,JGETEXT_CENTER);
}
...

yeahhh...should have been mStage == STAGE_MAINTENANCE. Oh well. Means that for about half an hour people were unable to login properly (app engine was probably spitting out errors during that time).

Edit: Also, I hate naming variables. What would you name the reference variable of the Clan a Player leads? leadsClan? clanLeader? thisistheclanthatilead? And how about the date someone joined? joinDate or dateJoined? damnit ):

Edit2: eventually decided on leadsClan :|