Dark_Glitch

Members
  • Content count

    66
  • Joined

  • Last visited

Community Reputation

138 Neutral

About Dark_Glitch

  • Rank
    Member
  1. SDL: Control Problems

    Well... Thanks!
  2. SDL: Control Problems

    Hello again. This time, I decided to try to make a program that would behave similar to games such as The Guardian Legend. TGL had a labyrinth mode that let the player move in 8 directions, each with its own set of animations. I have used LazyFoo's tutorials and everything works fine except the following: Currently, when I use a joystick, the character will move in a certain direction, lets say down. But as soon as the joystick is centered, in the designated Neutral position, the character will begin to move up and to the left when it's supposed to stay still! If you attempt to move the joystick again, the freaking character will move only in diagonals... This is the function that handles the joystick input void Player::handle_Events() { if(window_Events.type == SDL_JOYAXISMOTION) { if(window_Events.jaxis.which == 0) // Joytick 0 or Player One { if(window_Events.jaxis.axis == 0) // X Axis { if( (window_Events.jaxis.value > -8000) && (window_Events.jaxis.value < 8000) ) { Hvelocity = 0; } if(window_Events.jaxis.value > 8000) // RIGHT { Hvelocity = 5; } if(window_Events.jaxis.value < 8000) // LEFT { Hvelocity = -5; } } if(window_Events.jaxis.axis == 1) // Y Axis { if( (window_Events.jaxis.value > -8000) && (window_Events.jaxis.value < 8000) ) { Vvelocity = 0; } if(window_Events.jaxis.value > 8000) // DOWN { Vvelocity = 5; } if(window_Events.jaxis.value < 8000) // UP { Vvelocity = -5; } } } } } // end of void Player::handle_Events() And this, for your viewing pleasure, is the function that controls what animation should be shown based on a set of enumerated values that are quite self-explanatory. void Player::show() { if(Hvelocity < 0) // If player is moving to the LEFT { pStatus = Player::LEFT; lastStatus = Player::LEFT; frame++; } if(Hvelocity > 0) // If player is moving to the RIGHT { pStatus = Player::RIGHT; lastStatus = Player::RIGHT; frame++; } if(Vvelocity > 0) // If player is moving DOWN { pStatus = Player::DOWN; lastStatus = Player::DOWN; frame++; } if(Vvelocity < 0) // If player is moving UP { pStatus = Player::UP; lastStatus = Player::UP; frame++; } if(Vvelocity == 0 && Hvelocity == 0) { frame = 0; pStatus = Player::NEUTRAL; } if(Vvelocity > 0 && Hvelocity > 0) // Diagonal Down RIGHT { pStatus = Player::DOWNRIGHT; lastStatus = Player::DOWNRIGHT; frame++; } if(Vvelocity > 0 && Hvelocity < 0) // Diagonal Down LEFT { pStatus = Player::DOWNLEFT; lastStatus = Player::DOWNLEFT; frame++; } if(Vvelocity < 0 && Hvelocity > 0) // Diagonal Up RIGHT { pStatus = Player::UPRIGHT; lastStatus = Player::UPRIGHT; frame++; } if(Vvelocity < 0 && Hvelocity > 0) // Diagonal Up LEFT { pStatus = Player::UPLEFT; lastStatus = Player::UPLEFT; frame++; } if(frame > 3) { frame = 0; } if(pStatus == Player::UP) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Up[frame]); } if(pStatus == Player::DOWN) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Down[frame]); } if(pStatus == Player::LEFT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Left[frame]); } if(pStatus == Player::RIGHT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Right[frame]); } if(pStatus == Player::UPRIGHT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &UpRight[frame]); } if(pStatus == Player::UPLEFT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &UpLeft[frame]); } if(pStatus == Player::DOWNRIGHT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &DownRight[frame]); } if(pStatus == Player::DOWNLEFT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &DownLeft[frame]); } if(pStatus == Player::NEUTRAL) { if(lastStatus == Player::UP) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Up[frame]); } if(lastStatus == Player::DOWN) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Down[frame]); } if(lastStatus == Player::LEFT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Left[frame]); } if(lastStatus == Player::RIGHT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &Right[frame]); } if(pStatus == Player::UPRIGHT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &UpRight[frame]); } if(pStatus == Player::UPLEFT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &UpLeft[frame]); } if(pStatus == Player::DOWNRIGHT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &DownRight[frame]); } if(pStatus == Player::DOWNLEFT) { apply_Surface(Player::offSetX, Player::offSetY, guardian, screen, &DownLeft[frame]); } } } // end of void Player::show() Some things I noticed: On first run, when I tilt the stick to the right, the character moves right, but when I let go, it moves left. After that, if I try to move it again, it wigs out and the diagonal movement starts. Some of the animations are screwed up. i'll have to check my clips.
  3. how does one make a game?

    Quote:[i] - Modeling the env and characters in 3d - Texturing the models - do the realtime shading (...? how) - import them in the game engine - define the logic and movements...... - work around the AI - make the physics....... - make the user input controls Well first I'd say modeling and texturing is the easiest part of everything you just listed. Get a 3D modeler such as Blender (free) or Autodesk 3DS Max (expensive, but worth it if you have the dough). There are others out there, but I've only used 3ds max and Lightwave, but I recommend 3ds max. For texturing, this is a 'simple' matter of creating textures with some strong image creation software such as Photoshop CS3 or something. Now the shading, importing, logic, AI, physics, and user controls are all programmer side stuff. If you want to make a game, you are gonna need a strong TEAM of people to get this done. You probably COULD make a game by yourself, but it probably wouldn't be a good idea depending on what type of game your aiming for. Most high end games are made by a great deal of people (see ending credits at the end of any commercial game). Hope that helped.
  4. Collision Detection! SDL

    Thank you for taking the time out to look though my code. I wasn't sure what the problem was so I just posted it all. I know that annoys the crap outta alot of people here but I was at my wits end. Also, I must have been so preoccupied with the animation glitches that I forgot about the vertical velocity. Thanks for pointing that out. I'll keep that in mind when I edit this program.
  5. Collision Detection! SDL

    bool checkContactCollision(SDL_Rect* A, SDL_Rect B) { // The sides of the rectangles int leftA, leftB; int rightA, rightB; int topA, topB; int bottomA, bottomB; // Calculate sides of A leftA = A->x; rightA = A->x + A->w; topA = A->y; bottomA = A->y + A->h; // Calculate sides of B leftB = B.x; rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; // If any of the sides from A are outside of B if(bottomA < topB) { return false; } if(rightA < leftB) { return false; } if(leftA > rightB) { return false; } if(bottomA == topB) { return true; } } OK, I narrowed it down to this. Somehow this function is changing the frame variables when it gets called so when X walks and stuff, he doesn't get blitted to the screen properly. On top of that, the collisions don't get detected because the numbers are already higher than the ground variables, and I believe I may have done the above function incorrectly anyways. My interweb is back on, and even though no one decided to answer to this, I think I may just figure this one out on my own. Any suggestions for some proper collision detections would be great though. I want to make the game check each animation frame to see if the bottom of that frame is touching the ground. I thought I'd figured out how, but it's back to the drawing board.
  6. Collision Detection! SDL

    Ok, I'm gonna post the whole program. I'm using CodeBlocks cause for some reason I can't get this code to work in VS2008. I'm trying to make a megaman X game and it was comming along fine. I had X walking correctly and then I decided to work on the collision detection, so I could start my jump functions and the like....but I've changed the program like 20 times (seriously) and nothing works. I've tried to follow my code flow and figure out where the problem is, and I think the problem is in my draw() function or in my fall() function. Please, if you have time, look at this code and tell me what I should be doing, or just give me a hint, I've figured out all my other problems on my own lately, but this is starting to piss me off :D. As for the problem: When the program starts, X is positioned at the top of the screen, and I have set the lastInput variable to IDLE_RIGHT. I want to make sure that when the program starts, if there is nothing underneath X (ground) then the many if statements I've set up will decipher what should be done. What happens is X is rendered with many of the WRONG frames and he falls at a decent rate, but then, just as he touches the ground he stops for JUST a moment and then keeps falling. I've about pulled my dreads out over this. If you have TIME, please help me. You'll get credit when my game is done :D Here's the code. If you want the images to use to check what I'm talking about, go DL the sprite sheet from Sprites Inc. I used the MMX 5 sprites. I reversed the sprite sheet instead of writing code to flip the images...I'm lazy... No actually I couldn't get that part to work either, but I'm determined to figure that out on my own. Note: Ignore some of the commented stuff cause I've changed the program so many times that stuff is probably not what I should say. My net is off at my house so I had to post this somewhere else, and I don't have much time. Once again, thanks for the help, and anyone who sees code and wants to use some of it, go ahead, once the game is done, I'm putting all the code up so people can learn from my code(mistakes XD) #include <string> #include "SDL/SDL.h" #include "SDL/SDL_image.h" #include "SDL/SDL_ttf.h" #include "SDL/SDL_mixer.h" #include <cstdlib> SDL_Rect x_teleport_ani[ 16 ]; SDL_Rect x_idle_ani[ 5 ]; SDL_Rect x_walk_ani[ 64 ]; // Optimized SDL_Rect reverse_x_walk_ani[ 64 ]; // Optimized SDL_Rect reverse_x_idle_ani[ 5 ]; SDL_Rect reverse_x_dash_ani[ 16 ]; SDL_Rect x_dash_ani[ 16 ]; SDL_Rect x_jump_ani[ 6 ]; SDL_Rect x_fall_ani[ 2 ]; SDL_Rect reverse_x_jump_ani[ 11 ]; SDL_Rect reverse_x_fall_ani[ 1 ]; SDL_Rect x_charge_one_ani[ 4 ]; SDL_Rect x_shot_ani[ 16 ]; SDL_Rect ground; // Constants const int SCREEN_WIDTH = 800; const int SCREEN_HEIGHT = 600; const int SCREEN_BPP = 32; const int FRAMES_PER_SECOND = 60; SDL_Surface *screen = NULL; SDL_Surface *background = NULL; SDL_Surface *no_armor_x = NULL; SDL_Surface *reverse_no_armor_x = NULL; SDL_Surface *charge_ani_one = NULL; SDL_Event event; SDL_Joystick *joystick = NULL; TTF_Font *font = NULL; SDL_Color textColor = {255, 255, 255}; class Timer { private: //The clock time when the timer started int startTicks; //The ticks stored when the timer was paused int pausedTicks; //The timer status bool paused; bool started; public: //Initializes variables Timer(); //The various clock actions void start(); void stop(); void pause(); void unpause(); //Gets the timer's time int get_ticks(); //Checks the status of the timer bool is_started(); bool is_paused(); }; Timer::Timer() { //Initialize the variables startTicks = 0; pausedTicks = 0; paused = false; started = false; } void Timer::start() { //Start the timer started = true; //Unpause the timer paused = false; //Get the current clock time startTicks = SDL_GetTicks(); } void Timer::stop() { //Stop the timer started = false; //Unpause the timer paused = false; } int Timer::get_ticks() { //If the timer is running if( started == true ) { //If the timer is paused if( paused == true ) { //Return the number of ticks when the timer was paused return pausedTicks; } else { //Return the current time minus the start time return SDL_GetTicks() - startTicks; } } //If the timer isn't running return 0; } void Timer::pause() { //If the timer is running and isn't already paused if( ( started == true ) && ( paused == false ) ) { //Pause the timer paused = true; //Calculate the paused ticks pausedTicks = SDL_GetTicks() - startTicks; } } void Timer::unpause() { //If the timer is paused if( paused == true ) { //Unpause the timer paused = false; //Reset the starting ticks startTicks = SDL_GetTicks() - pausedTicks; //Reset the paused ticks pausedTicks = 0; } } bool Timer::is_started() { return started; } bool Timer::is_paused() { return paused; } void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL ) { //Make a temporary rectangle to hold the offsets SDL_Rect offset; //Give the offsets to the rectangle offset.x = x; offset.y = y; //Blit the surface SDL_BlitSurface( source, clip, destination, &offset ); } bool checkContactCollision(SDL_Rect* A, SDL_Rect B) { // The sides of the rectangles int leftA, leftB; int rightA, rightB; int topA, topB; int bottomA, bottomB; // Calculate sides of A leftA = A->x; rightA = A->x + A->w; topA = A->y; bottomA = A->y + A->h; // Calculate sides of B leftB = B.x; rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; // If any of the sides from A are outside of B if(bottomA < topB) { return false; } if(rightA < leftB) { return false; } if(leftA > rightB) { return false; } if(bottomA == topB) { return true; } } bool checkHitCollision(SDL_Rect A, SDL_Rect B) { // The sides of the rectangles int leftA, leftB; int rightA, rightB; int topA, topB; int bottomA, bottomB; // Calculate sides of A leftA = A.x; rightA = A.x + A.w; topA = A.y; bottomA = A.y + A.h; // Calculate sides of B leftB = B.x; rightB = B.x + B.w; topB = B.y; bottomB = B.y + B.h; // If any of the sides from A are outside of B if(bottomA <= topB) { return false; } if(topA >= bottomB) { return false; } if(rightA <= leftB) { return false; } if(leftA >= rightB) { return false; } // If none of the sides from A are outside B return true; } /****************************************************************************** ******************************************************************************* ********************************* MMX CLASS *********************************** ******************************************************************************* ******************************************************************************/ class MMX { private: //The offset int offSet; int v_offSet; //Its rate of movement int velocity; int v_velocity; //Its current frame int frame; typedef enum statusVar { IDLE_RIGHT, IDLE_LEFT, DASH_RIGHT, DASH_LEFT, WALK_LEFT, WALK_RIGHT, JUMP_RIGHT, JUMP_LEFT, NEUTRAL, NORMAL_SHOT, CHARGE_ONE, FALLING_RIGHT, FALLING_LEFT, CHECKFALLING }; //Its animation status statusVar lastInput; public: //Initializes the variables MMX(); //Handles input void handle_events(); //Moves the character void move(); // Draws the character void draw(); // Testing these functions void idle(); // Works void walkLeft(); // Works void walkRight(); // Works void fall(); }; MMX::MMX() { //Initialize movement variables offSet = 0; v_offSet = 0; velocity = 0; v_velocity = 0; //Initialize animation variables frame = 0; lastInput = MMX::IDLE_RIGHT; }; void MMX::move() { offSet += velocity; v_offSet += v_velocity; //Keep the stick figure in bounds if( ( offSet < 0 ) || ( offSet + x_walk_ani[ frame ].w > SCREEN_WIDTH ) ) { offSet -= velocity; } if(checkContactCollision(&x_idle_ani[frame], ground) && (velocity >= 0 || velocity <= 0) && lastInput == MMX::IDLE_RIGHT) { x_idle_ani[frame].y = ground.y; } if(checkContactCollision(&reverse_x_idle_ani[frame], ground) && (velocity >= 0 || velocity <= 0) && lastInput == MMX::IDLE_LEFT) { reverse_x_idle_ani[frame].y = ground.y; } if(checkContactCollision(&x_walk_ani[frame], ground) && (velocity >= 0 || velocity <= 0) && lastInput == MMX::WALK_RIGHT) { x_walk_ani[frame].y = ground.y; } if(checkContactCollision(&reverse_x_walk_ani[frame], ground) && (velocity >= 0 || velocity <= 0) && lastInput == MMX::WALK_LEFT) { reverse_x_walk_ani[frame].y = ground.y; } }; void MMX::draw() { if(velocity == 0 && (checkContactCollision(&x_idle_ani[frame], ground) || checkContactCollision(&reverse_x_idle_ani[frame], ground)))//&& (lastInput == MMX::IDLE_LEFT || lastInput == MMX::IDLE_RIGHT)) { idle(); } if(velocity < 0 && (checkContactCollision(&reverse_x_walk_ani[frame], ground))) { walkLeft(); } if(velocity > 0 && (checkContactCollision(&x_walk_ani[frame], ground))) { walkRight(); } }; void MMX::fall() { if((lastInput == MMX::IDLE_RIGHT || lastInput == MMX::WALK_RIGHT || lastInput == MMX::DASH_RIGHT || lastInput == MMX::JUMP_RIGHT) && !checkContactCollision(&x_fall_ani[0], ground)) { lastInput = MMX::FALLING_RIGHT; v_velocity++; if(v_velocity >= 5) { v_velocity --; } apply_surface(offSet, v_offSet, no_armor_x, screen, &x_fall_ani[0]); if(checkContactCollision(&x_fall_ani[1], ground)) { idle(); } } if((lastInput == MMX::IDLE_LEFT || lastInput == MMX::WALK_LEFT || lastInput == MMX::DASH_LEFT || lastInput == MMX::JUMP_LEFT) && !checkContactCollision(&reverse_x_fall_ani[0], ground)) { lastInput = MMX::FALLING_LEFT; v_velocity++; if(v_velocity >= 5) { v_velocity --; } apply_surface(offSet, v_offSet, reverse_no_armor_x, screen, &reverse_x_fall_ani[0]); if(checkContactCollision(&reverse_x_fall_ani[0], ground)) { idle(); } } }; void MMX::idle() { if(checkContactCollision(&x_idle_ani[frame], ground) && lastInput == MMX::WALK_RIGHT || lastInput == MMX::IDLE_RIGHT || lastInput == FALLING_RIGHT) { lastInput = MMX::IDLE_RIGHT; frame = 0; apply_surface( offSet, v_offSet , no_armor_x, screen, &x_idle_ani[ frame ] ); } else if(checkContactCollision(&reverse_x_idle_ani[frame], ground) && lastInput == MMX::WALK_LEFT || lastInput == MMX::IDLE_LEFT) { lastInput = MMX::IDLE_LEFT; frame = 0; apply_surface( offSet, v_offSet, reverse_no_armor_x, screen, &reverse_x_idle_ani[ frame ] ); } }; void MMX::walkLeft() { lastInput = WALK_LEFT; if(velocity == 0) { idle(); } frame++; apply_surface( offSet, v_offSet , reverse_no_armor_x, screen, &reverse_x_walk_ani[ frame ] ); if(frame >= 63) { frame = 9; } }; void MMX::walkRight() { lastInput = WALK_RIGHT; if(velocity == 0) { idle(); } frame++; apply_surface( offSet, v_offSet , no_armor_x, screen, &x_walk_ani[ frame ] ); if(frame >= 63) { frame = 9; } }; /*************************************************** **************** HANDLE EVENTS ******************** ***************************************************/ void MMX::handle_events() { if(event.type == SDL_JOYAXISMOTION) { if(event.jaxis.which == 0) { if(event.jaxis.axis == 0) { if(event.jaxis.value <= 8000 && event.jaxis.value >= -8000) { velocity = 0; } if(event.jaxis.value > 8000) { velocity = 5; } if(event.jaxis.value < -8000) { velocity = -5; } } } } /*if(event.jbutton.button) { if(event.type == SDL_JOYBUTTONDOWN) { // Handle Joystick Button Presses if ( event.jbutton.button == 3 ) { if( lastInput == WALK_RIGHT) { status = DASH_RIGHT; } else if(lastInput == WALK_LEFT) { status = DASH_LEFT; } } if(event.jbutton.button == 0) { status = NORMAL_SHOT; } if(event.jbutton.button == 2) { status = JUMP_RIGHT; } } if(event.type == SDL_JOYBUTTONUP) { if ( event.jbutton.button == 3 ) // Dash { status = NEUTRAL; } if(event.jbutton.button == 2) // Jump { status = CHECKFALLING; } } }*/ }; /***************************************************************************** ************************* MMX CLASS END ************************************* *****************************************************************************/ MMX X; using namespace std; SDL_Surface *load_image( string filename ) { SDL_Surface* loadedImage = NULL; SDL_Surface* optimizedImage = NULL; loadedImage = IMG_Load( filename.c_str() ); if(loadedImage != NULL) { //Map the color optimizedImage = SDL_DisplayFormat( loadedImage ); SDL_FreeSurface( loadedImage ); if( optimizedImage != NULL ) { Uint32 colorkey = SDL_MapRGB(optimizedImage->format, 255, 0, 228); //Set all pixels of color R 255, G 0, B 228 to be transparent SDL_SetColorKey( optimizedImage, SDL_SRCCOLORKEY, colorkey); } // Return the optimized image return optimizedImage; } } bool init() { //Initialize all SDL subsystems if( SDL_Init( SDL_INIT_EVERYTHING ) == -1 ) { return false; } //Set up the screen screen = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, SDL_SWSURFACE ); //If there was an error in setting up the screen if( screen == NULL ) { printf("Error message: %s\n", IMG_GetError()); SDL_Delay(2000); return false; } // Initialize TTF_Font if(TTF_Init() == -1) { return false; } /* if(Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096) == -1) { return false; } */ //Check if there's any joysticks // Seed random srand(SDL_GetTicks()); if( SDL_NumJoysticks() < 1 ) { return false; } //Open the joystick joystick = SDL_JoystickOpen( 0 ); SDL_JoystickNumButtons(joystick); //If there's a problem opening the joystick if( joystick == NULL ) { return false; } //Set the window caption SDL_WM_SetCaption( "Megaman X: The Human War", NULL ); //If everything initialized fine return true; } bool load_files() { //Load the image background = load_image("background.png"); //If there was an error in loading... if(background == NULL ) { printf("Error message: %s\n", IMG_GetError()); SDL_Delay(2000); return false; } charge_ani_one = load_image("charge_sheet.png"); font = TTF_OpenFont("arialbd.ttf", 72); if(font == NULL) { return false; } /* music = Mix_LoadMUS("To Zanarkand.mp3"); if(music == NULL) { printf("Music Problem: %s\n", IMG_GetError()); return false; } */ no_armor_x = load_image("no_armor_x_sheet.png"); if( no_armor_x == NULL ) { printf("Error message: %s\n", IMG_GetError()); SDL_Delay(2000); return false; } reverse_no_armor_x = load_image("reverse_no_armor_x_sheet.png"); if( reverse_no_armor_x == NULL ) { printf("Error message: %s\n", IMG_GetError()); return false; } //If it worked return true; } void setClips() { // Shot Animations x_shot_ani[ 0 ].x = 130; x_shot_ani[ 0 ].y = 442; x_shot_ani[ 0 ].w = 75; x_shot_ani[ 0 ].h = 65; x_shot_ani[ 1 ].x = 130; x_shot_ani[ 1 ].y = 442; x_shot_ani[ 1 ].w = 75; x_shot_ani[ 1 ].h = 65; x_shot_ani[ 2 ].x = 215; x_shot_ani[ 2 ].y = 442; x_shot_ani[ 2 ].w = 75; x_shot_ani[ 2 ].h = 65; x_shot_ani[ 3 ].x = 215; x_shot_ani[ 3 ].y = 442; x_shot_ani[ 3 ].w = 75; x_shot_ani[ 3 ].h = 65; x_shot_ani[ 4 ].x = 300; x_shot_ani[ 4 ].y = 442; x_shot_ani[ 4 ].w = 75; x_shot_ani[ 4 ].h = 65; x_shot_ani[ 5 ].x = 300; x_shot_ani[ 5 ].y = 442; x_shot_ani[ 5 ].w = 75; x_shot_ani[ 5 ].h = 65; x_shot_ani[ 6 ].x = 388; x_shot_ani[ 6 ].y = 442; x_shot_ani[ 6 ].w = 75; x_shot_ani[ 6 ].h = 65; x_shot_ani[ 7 ].x = 388; x_shot_ani[ 7 ].y = 442; x_shot_ani[ 7 ].w = 75; x_shot_ani[ 7 ].h = 65; x_shot_ani[ 8 ].x = 475; x_shot_ani[ 8 ].y = 442; x_shot_ani[ 8 ].w = 79; x_shot_ani[ 8 ].h = 66; x_shot_ani[ 9 ].x = 475; x_shot_ani[ 9 ].y = 442; x_shot_ani[ 9 ].w = 79; x_shot_ani[ 9 ].h = 66; x_shot_ani[ 10 ].x = 564; x_shot_ani[ 10 ].y = 442; x_shot_ani[ 10 ].w = 62; x_shot_ani[ 10 ].h = 66; x_shot_ani[ 11 ].x = 564; x_shot_ani[ 11 ].y = 442; x_shot_ani[ 11 ].w = 62; x_shot_ani[ 11 ].h = 66; x_shot_ani[ 12 ].x = 634; x_shot_ani[ 12 ].y = 442; x_shot_ani[ 12 ].w = 59; x_shot_ani[ 12 ].h = 66; x_shot_ani[ 13 ].x = 634; x_shot_ani[ 13 ].y = 442; x_shot_ani[ 13 ].w = 59; x_shot_ani[ 13 ].h = 66; x_shot_ani[ 14 ].x = 700; x_shot_ani[ 14 ].y = 442; x_shot_ani[ 14 ].w = 53; x_shot_ani[ 14 ].h = 67; x_shot_ani[ 15 ].x = 700; x_shot_ani[ 15 ].y = 442; x_shot_ani[ 15 ].w = 53; x_shot_ani[ 15 ].h = 67; // Charge Animations x_charge_one_ani[ 0 ].x = 7; x_charge_one_ani[ 0 ].y = 18; x_charge_one_ani[ 0 ].w = 59; x_charge_one_ani[ 0 ].h = 67; x_charge_one_ani[ 1 ].x = 75; x_charge_one_ani[ 1 ].y = 13; x_charge_one_ani[ 1 ].w = 66; x_charge_one_ani[ 1 ].h = 74; x_charge_one_ani[ 2 ].x = 148; x_charge_one_ani[ 2 ].y = 6; x_charge_one_ani[ 2 ].w = 66; x_charge_one_ani[ 2 ].h = 74; x_charge_one_ani[ 3 ].x = 223; x_charge_one_ani[ 3 ].y = 4; x_charge_one_ani[ 3 ].w = 61; x_charge_one_ani[ 3 ].h = 73; // X Teleport x_teleport_ani[ 0 ].x = 127; x_teleport_ani[ 0 ].y = 18; x_teleport_ani[ 0 ].w = 10; x_teleport_ani[ 0 ].h = 121; x_teleport_ani[ 1 ].x = 148; x_teleport_ani[ 1 ].y = 42; x_teleport_ani[ 1 ].w = 33; x_teleport_ani[ 1 ].h = 97; x_teleport_ani[ 2 ].x = 186; x_teleport_ani[ 2 ].y = 89; x_teleport_ani[ 2 ].w = 61; x_teleport_ani[ 2 ].h = 49; x_teleport_ani[ 3 ].x = 256; x_teleport_ani[ 3 ].y = 74; x_teleport_ani[ 3 ].w = 91; x_teleport_ani[ 3 ].h = 79; x_teleport_ani[ 4 ].x = 357; x_teleport_ani[ 4 ].y = 68; x_teleport_ani[ 4 ].w = 97; x_teleport_ani[ 4 ].h = 91; x_teleport_ani[ 5 ].x = 465; x_teleport_ani[ 5 ].y = 65; x_teleport_ani[ 5 ].w = 97; x_teleport_ani[ 5 ].h = 97; x_teleport_ani[ 6 ].x = 574; x_teleport_ani[ 6 ].y = 65; x_teleport_ani[ 6 ].w = 97; x_teleport_ani[ 6 ].h = 97; x_teleport_ani[ 7 ].x = 684; x_teleport_ani[ 7 ].y = 74; x_teleport_ani[ 7 ].w = 82; x_teleport_ani[ 7 ].h = 79; x_teleport_ani[ 8 ].x = 123; x_teleport_ani[ 8 ].y = 192; x_teleport_ani[ 8 ].w = 62; x_teleport_ani[ 8 ].h = 63; x_teleport_ani[ 9 ].x = 196; x_teleport_ani[ 9 ].y = 186; x_teleport_ani[ 9 ].w = 52; x_teleport_ani[ 9 ].h = 63; x_teleport_ani[ 10 ].x = 295; x_teleport_ani[ 10 ].y = 183; x_teleport_ani[ 10 ].w = 52; x_teleport_ani[ 10 ].h = 66; x_teleport_ani[ 11 ].x = 328; x_teleport_ani[ 11 ].y = 180; x_teleport_ani[ 11 ].w = 49; x_teleport_ani[ 11 ].h = 69; x_teleport_ani[ 12 ].x = 390; x_teleport_ani[ 12 ].y = 167; x_teleport_ani[ 12 ].w = 32; x_teleport_ani[ 12 ].h = 82; x_teleport_ani[ 13 ].x = 435; x_teleport_ani[ 13 ].y = 165; x_teleport_ani[ 13 ].w = 31; x_teleport_ani[ 13 ].h = 84; x_teleport_ani[ 14 ].x = 477; x_teleport_ani[ 14 ].y = 177; x_teleport_ani[ 14 ].w = 103; x_teleport_ani[ 14 ].h = 72; x_teleport_ani[ 15 ].x = 583; x_teleport_ani[ 15 ].y = 183; x_teleport_ani[ 15 ].w = 102; x_teleport_ani[ 15 ].h = 66; x_teleport_ani[ 16 ].x = 693; x_teleport_ani[ 16 ].y = 180; x_teleport_ani[ 16 ].w = 56; x_teleport_ani[ 16 ].h = 69; // Walk x_walk_ani[ 0 ].x = 174; x_walk_ani[ 0 ].y = 640; x_walk_ani[ 0 ].w = 50; x_walk_ani[ 0 ].h = 68; x_walk_ani[ 1 ].x = 174; x_walk_ani[ 1 ].y = 640; x_walk_ani[ 1 ].w = 50; x_walk_ani[ 1 ].h = 68; x_walk_ani[ 2 ].x = 174; x_walk_ani[ 2 ].y = 640; x_walk_ani[ 2 ].w = 50; x_walk_ani[ 2 ].h = 68; x_walk_ani[ 3 ].x = 174; x_walk_ani[ 3 ].y = 640; x_walk_ani[ 3 ].w = 50; x_walk_ani[ 3 ].h = 68; x_walk_ani[ 4 ].x = 231; x_walk_ani[ 4 ].y = 639; x_walk_ani[ 4 ].w = 48; x_walk_ani[ 4 ].h = 68; x_walk_ani[ 5 ].x = 231; x_walk_ani[ 5 ].y = 639; x_walk_ani[ 5 ].w = 48; x_walk_ani[ 5 ].h = 68; x_walk_ani[ 6 ].x = 231; x_walk_ani[ 6 ].y = 639; x_walk_ani[ 6 ].w = 48; x_walk_ani[ 6 ].h = 68; x_walk_ani[ 7 ].x = 231; x_walk_ani[ 7 ].y = 639; x_walk_ani[ 7 ].w = 48; x_walk_ani[ 7 ].h = 68; x_walk_ani[ 8 ].x = 290; x_walk_ani[ 8 ].y = 635; x_walk_ani[ 8 ].w = 47; x_walk_ani[ 8 ].h = 69; x_walk_ani[ 9 ].x = 290; x_walk_ani[ 9 ].y = 635; x_walk_ani[ 9 ].w = 47; x_walk_ani[ 9 ].h = 69; x_walk_ani[ 10 ].x = 290; x_walk_ani[ 10 ].y = 635; x_walk_ani[ 10 ].w = 47; x_walk_ani[ 10 ].h = 69; x_walk_ani[ 11 ].x = 290; x_walk_ani[ 11 ].y = 635; x_walk_ani[ 11 ].w = 47; x_walk_ani[ 11 ].h = 69; x_walk_ani[ 12 ].x = 348; x_walk_ani[ 12 ].y = 638; x_walk_ani[ 12 ].w = 61; x_walk_ani[ 12 ].h = 67; x_walk_ani[ 13 ].x = 348; x_walk_ani[ 13 ].y = 638; x_walk_ani[ 13 ].w = 61; x_walk_ani[ 13 ].h = 67; x_walk_ani[ 14 ].x = 348; x_walk_ani[ 14 ].y = 638; x_walk_ani[ 14 ].w = 61; x_walk_ani[ 14 ].h = 67; x_walk_ani[ 15 ].x = 348; x_walk_ani[ 15 ].y = 638; x_walk_ani[ 15 ].w = 61; x_walk_ani[ 15 ].h = 67; x_walk_ani[ 16 ].x = 415; x_walk_ani[ 16 ].y = 639; x_walk_ani[ 16 ].w = 73; x_walk_ani[ 16 ].h = 66; x_walk_ani[ 17 ].x = 415; x_walk_ani[ 17 ].y = 639; x_walk_ani[ 17 ].w = 73; x_walk_ani[ 17 ].h = 66; x_walk_ani[ 18 ].x = 415; x_walk_ani[ 18 ].y = 639; x_walk_ani[ 18 ].w = 73; x_walk_ani[ 18 ].h = 66; x_walk_ani[ 19 ].x = 415; x_walk_ani[ 19 ].y = 639; x_walk_ani[ 19 ].w = 73; x_walk_ani[ 19 ].h = 66; x_walk_ani[ 20 ].x = 497; x_walk_ani[ 20 ].y = 641; x_walk_ani[ 20 ].w = 73; x_walk_ani[ 20 ].h = 64; x_walk_ani[ 21 ].x = 497; x_walk_ani[ 21 ].y = 641; x_walk_ani[ 21 ].w = 73; x_walk_ani[ 21 ].h = 64; x_walk_ani[ 22 ].x = 497; x_walk_ani[ 22 ].y = 641; x_walk_ani[ 22 ].w = 73; x_walk_ani[ 22 ].h = 64; x_walk_ani[ 23 ].x = 497; x_walk_ani[ 23 ].y = 641; x_walk_ani[ 23 ].w = 73; x_walk_ani[ 23 ].h = 64; x_walk_ani[ 24 ].x = 579; x_walk_ani[ 24 ].y = 640; x_walk_ani[ 24 ].w = 59; x_walk_ani[ 24 ].h = 65; x_walk_ani[ 25 ].x = 579; x_walk_ani[ 25 ].y = 640; x_walk_ani[ 25 ].w = 59; x_walk_ani[ 25 ].h = 65; x_walk_ani[ 26 ].x = 579; x_walk_ani[ 26 ].y = 640; x_walk_ani[ 26 ].w = 59; x_walk_ani[ 26 ].h = 65; x_walk_ani[ 27 ].x = 579; x_walk_ani[ 27 ].y = 640; x_walk_ani[ 27 ].w = 59; x_walk_ani[ 27 ].h = 65; x_walk_ani[ 28 ].x = 652; x_walk_ani[ 28 ].y = 638; x_walk_ani[ 28 ].w = 46; x_walk_ani[ 28 ].h = 68; x_walk_ani[ 29 ].x = 652; x_walk_ani[ 29 ].y = 638; x_walk_ani[ 29 ].w = 46; x_walk_ani[ 29 ].h = 68; x_walk_ani[ 30 ].x = 652; x_walk_ani[ 30 ].y = 638; x_walk_ani[ 30 ].w = 46; x_walk_ani[ 30 ].h = 68; x_walk_ani[ 31 ].x = 652; x_walk_ani[ 31 ].y = 638; x_walk_ani[ 31 ].w = 46; x_walk_ani[ 31 ].h = 68; x_walk_ani[ 32 ].x = 182; x_walk_ani[ 32 ].y = 721; x_walk_ani[ 32 ].w = 41; x_walk_ani[ 32 ].h = 70; x_walk_ani[ 33 ].x = 182; x_walk_ani[ 33 ].y = 721; x_walk_ani[ 33 ].w = 41; x_walk_ani[ 33 ].h = 70; x_walk_ani[ 34 ].x = 182; x_walk_ani[ 34 ].y = 721; x_walk_ani[ 34 ].w = 41; x_walk_ani[ 34 ].h = 70; x_walk_ani[ 35 ].x = 182; x_walk_ani[ 35 ].y = 721; x_walk_ani[ 35 ].w = 41; x_walk_ani[ 35 ].h = 70; x_walk_ani[ 36 ].x = 235; x_walk_ani[ 36 ].y = 720; x_walk_ani[ 36 ].w = 54; x_walk_ani[ 36 ].h = 69; x_walk_ani[ 37 ].x = 235; x_walk_ani[ 37 ].y = 720; x_walk_ani[ 37 ].w = 54; x_walk_ani[ 37 ].h = 69; x_walk_ani[ 38 ].x = 235; x_walk_ani[ 38 ].y = 720; x_walk_ani[ 38 ].w = 54; x_walk_ani[ 38 ].h = 69; x_walk_ani[ 39 ].x = 235; x_walk_ani[ 39 ].y = 720; x_walk_ani[ 39 ].w = 54; x_walk_ani[ 39 ].h = 69; x_walk_ani[ 40 ].x = 298; x_walk_ani[ 40 ].y = 722; x_walk_ani[ 40 ].w = 61; x_walk_ani[ 40 ].h = 68; x_walk_ani[ 41 ].x = 298; x_walk_ani[ 41 ].y = 722; x_walk_ani[ 41 ].w = 61; x_walk_ani[ 41 ].h = 68; x_walk_ani[ 42 ].x = 298; x_walk_ani[ 42 ].y = 722; x_walk_ani[ 42 ].w = 61; x_walk_ani[ 42 ].h = 68; x_walk_ani[ 43 ].x = 298; x_walk_ani[ 43 ].y = 722; x_walk_ani[ 43 ].w = 61; x_walk_ani[ 43 ].h = 68; x_walk_ani[ 44 ].x = 364; x_walk_ani[ 44 ].y = 723; x_walk_ani[ 44 ].w = 64; x_walk_ani[ 44 ].h = 67; x_walk_ani[ 45 ].x = 364; x_walk_ani[ 45 ].y = 723; x_walk_ani[ 45 ].w = 64; x_walk_ani[ 45 ].h = 67; x_walk_ani[ 46 ].x = 364; x_walk_ani[ 46 ].y = 723; x_walk_ani[ 46 ].w = 64; x_walk_ani[ 46 ].h = 67; x_walk_ani[ 47 ].x = 364; x_walk_ani[ 47 ].y = 723; x_walk_ani[ 47 ].w = 64; x_walk_ani[ 47 ].h = 67; x_walk_ani[ 48 ].x = 440; x_walk_ani[ 48 ].y = 724; x_walk_ani[ 48 ].w = 64; x_walk_ani[ 48 ].h = 67; x_walk_ani[ 49 ].x = 440; x_walk_ani[ 49 ].y = 724; x_walk_ani[ 49 ].w = 64; x_walk_ani[ 49 ].h = 67; x_walk_ani[ 50 ].x = 440; x_walk_ani[ 50 ].y = 724; x_walk_ani[ 50 ].w = 64; x_walk_ani[ 50 ].h = 67; x_walk_ani[ 51 ].x = 440; x_walk_ani[ 51 ].y = 724; x_walk_ani[ 51 ].w = 64; x_walk_ani[ 51 ].h = 67; x_walk_ani[ 52 ].x = 514; x_walk_ani[ 52 ].y = 723; x_walk_ani[ 52 ].w = 57; x_walk_ani[ 52 ].h = 69; x_walk_ani[ 53 ].x = 514; x_walk_ani[ 53 ].y = 723; x_walk_ani[ 53 ].w = 57; x_walk_ani[ 53 ].h = 69; x_walk_ani[ 54 ].x = 514; x_walk_ani[ 54 ].y = 723; x_walk_ani[ 54 ].w = 57; x_walk_ani[ 54 ].h = 69; x_walk_ani[ 55 ].x = 514; x_walk_ani[ 55 ].y = 723; x_walk_ani[ 55 ].w = 57; x_walk_ani[ 55 ].h = 69; x_walk_ani[ 56 ].x = 585; x_walk_ani[ 56 ].y = 721; x_walk_ani[ 56 ].w = 49; x_walk_ani[ 56 ].h = 70; x_walk_ani[ 57 ].x = 585; x_walk_ani[ 57 ].y = 721; x_walk_ani[ 57 ].w = 49; x_walk_ani[ 57 ].h = 70; x_walk_ani[ 58 ].x = 585; x_walk_ani[ 58 ].y = 721; x_walk_ani[ 58 ].w = 49; x_walk_ani[ 58 ].h = 70; x_walk_ani[ 59 ].x = 585; x_walk_ani[ 59 ].y = 721; x_walk_ani[ 59 ].w = 49; x_walk_ani[ 59 ].h = 70; x_walk_ani[ 60 ].x = 644; x_walk_ani[ 60 ].y = 720; x_walk_ani[ 60 ].w = 42; x_walk_ani[ 60 ].h = 72; x_walk_ani[ 61 ].x = 644; x_walk_ani[ 61 ].y = 720; x_walk_ani[ 61 ].w = 42; x_walk_ani[ 61 ].h = 72; x_walk_ani[ 62 ].x = 644; x_walk_ani[ 62 ].y = 720; x_walk_ani[ 62 ].w = 42; x_walk_ani[ 62 ].h = 72; x_walk_ani[ 63 ].x = 644; x_walk_ani[ 63 ].y = 720; x_walk_ani[ 63 ].w = 42; x_walk_ani[ 63 ].h = 72; // Dash x_dash_ani[ 0 ].x = 144; x_dash_ani[ 0 ].y = 808; x_dash_ani[ 0 ].w = 55; x_dash_ani[ 0 ].h = 63; x_dash_ani[ 1 ].x = 206; x_dash_ani[ 1 ].y = 818; x_dash_ani[ 1 ].w = 70; x_dash_ani[ 1 ].h = 55; x_dash_ani[ 2 ].x = 284; x_dash_ani[ 2 ].y = 825; x_dash_ani[ 2 ].w = 81; x_dash_ani[ 2 ].h = 48; x_dash_ani[ 3 ].x = 284; x_dash_ani[ 3 ].y = 825; x_dash_ani[ 3 ].w = 81; x_dash_ani[ 3 ].h = 48; x_dash_ani[ 4 ].x = 284; x_dash_ani[ 4 ].y = 825; x_dash_ani[ 4 ].w = 81; x_dash_ani[ 4 ].h = 48; x_dash_ani[ 5 ].x = 372; x_dash_ani[ 5 ].y = 825; x_dash_ani[ 5 ].w = 86; x_dash_ani[ 5 ].h = 48; x_dash_ani[ 6 ].x = 372; x_dash_ani[ 6 ].y = 825; x_dash_ani[ 6 ].w = 86; x_dash_ani[ 6 ].h = 48; x_dash_ani[ 7 ].x = 372; x_dash_ani[ 7 ].y = 825; x_dash_ani[ 7 ].w = 86; x_dash_ani[ 7 ].h = 48; x_dash_ani[ 8 ].x = 466; x_dash_ani[ 8 ].y = 808; x_dash_ani[ 8 ].w = 58; x_dash_ani[ 8 ].h = 65; x_dash_ani[ 9 ].x = 531; x_dash_ani[ 9 ].y = 807; x_dash_ani[ 9 ].w = 47; x_dash_ani[ 9 ].h = 65; x_dash_ani[ 10 ].x = 580; x_dash_ani[ 10 ].y = 807; x_dash_ani[ 10 ].w = 71; x_dash_ani[ 10 ].h = 66; x_dash_ani[ 11 ].x = 657; x_dash_ani[ 11 ].y = 808; x_dash_ani[ 11 ].w = 56; x_dash_ani[ 11 ].h = 65; // Idle x_idle_ani[ 0 ].x = 286; x_idle_ani[ 0 ].y = 257; x_idle_ani[ 0 ].w = 55; x_idle_ani[ 0 ].h = 70; x_idle_ani[ 1 ].x = 349; x_idle_ani[ 1 ].y = 258; x_idle_ani[ 1 ].w = 54; x_idle_ani[ 1 ].h = 69; x_idle_ani[ 2 ].x = 414; x_idle_ani[ 2 ].y = 259; x_idle_ani[ 2 ].w = 53; x_idle_ani[ 2 ].h = 68; x_idle_ani[ 3 ].x = 479; x_idle_ani[ 3 ].y = 261; x_idle_ani[ 3 ].w = 54; x_idle_ani[ 3 ].h = 66; x_idle_ani[ 4 ].x = 541; x_idle_ani[ 4 ].y = 259; x_idle_ani[ 4 ].w = 55; x_idle_ani[ 4 ].h = 68; // Jump x_jump_ani[ 0 ].x = 150; x_jump_ani[ 0 ].y = 338; x_jump_ani[ 0 ].w = 39; x_jump_ani[ 0 ].h = 79; x_jump_ani[ 1 ].x = 200; x_jump_ani[ 1 ].y = 338; x_jump_ani[ 1 ].w = 36; x_jump_ani[ 1 ].h = 80; x_jump_ani[ 2 ].x = 246; x_jump_ani[ 2 ].y = 338; x_jump_ani[ 2 ].w = 36; x_jump_ani[ 2 ].h = 80; x_jump_ani[ 3 ].x = 307; x_jump_ani[ 3 ].y = 338; x_jump_ani[ 3 ].w = 37; x_jump_ani[ 3 ].h = 87; x_jump_ani[ 4 ].x = 357; x_jump_ani[ 4 ].y = 343; x_jump_ani[ 4 ].w = 41; x_jump_ani[ 4 ].h = 82; x_jump_ani[ 5 ].x = 411; x_jump_ani[ 5 ].y = 344; x_jump_ani[ 5 ].w = 52; x_jump_ani[ 5 ].h = 76; // Falling x_fall_ani[ 0 ].x = 472; x_fall_ani[ 0 ].y = 343; x_fall_ani[ 0 ].w = 48; x_fall_ani[ 0 ].h = 79; x_fall_ani[ 1 ].x = 531; x_fall_ani[ 1 ].y = 342; x_fall_ani[ 1 ].w = 46; x_fall_ani[ 1 ].h = 81; // Reversed Idle reverse_x_idle_ani[ 0 ].x = 560; reverse_x_idle_ani[ 0 ].y = 258; reverse_x_idle_ani[ 0 ].w = 55; reverse_x_idle_ani[ 0 ].h = 69; reverse_x_idle_ani[ 1 ].x = 495; reverse_x_idle_ani[ 1 ].y = 258; reverse_x_idle_ani[ 1 ].w = 55; reverse_x_idle_ani[ 1 ].h = 70; reverse_x_idle_ani[ 2 ].x = 432; reverse_x_idle_ani[ 2 ].y = 260; reverse_x_idle_ani[ 2 ].w = 55; reverse_x_idle_ani[ 2 ].h = 68; reverse_x_idle_ani[ 3 ].x = 365; reverse_x_idle_ani[ 3 ].y = 258; reverse_x_idle_ani[ 3 ].w = 57; reverse_x_idle_ani[ 3 ].h = 70; reverse_x_idle_ani[ 4 ].x = 302; reverse_x_idle_ani[ 4 ].y = 258; reverse_x_idle_ani[ 4 ].w = 57; reverse_x_idle_ani[ 4 ].h = 69; // Reversed Walk reverse_x_walk_ani[ 0 ].x = 675; reverse_x_walk_ani[ 0 ].y = 639; reverse_x_walk_ani[ 0 ].w = 50; reverse_x_walk_ani[ 0 ].h = 68; reverse_x_walk_ani[ 1 ].x = 675; reverse_x_walk_ani[ 1 ].y = 639; reverse_x_walk_ani[ 1 ].w = 50; reverse_x_walk_ani[ 1 ].h = 68; reverse_x_walk_ani[ 2 ].x = 675; reverse_x_walk_ani[ 2 ].y = 639; reverse_x_walk_ani[ 2 ].w = 50; reverse_x_walk_ani[ 2 ].h = 68; reverse_x_walk_ani[ 3 ].x = 675; reverse_x_walk_ani[ 3 ].y = 639; reverse_x_walk_ani[ 3 ].w = 50; reverse_x_walk_ani[ 3 ].h = 68; reverse_x_walk_ani[ 4 ].x = 619; reverse_x_walk_ani[ 4 ].y = 638; reverse_x_walk_ani[ 4 ].w = 48; reverse_x_walk_ani[ 4 ].h = 69; reverse_x_walk_ani[ 5 ].x = 619; reverse_x_walk_ani[ 5 ].y = 638; reverse_x_walk_ani[ 5 ].w = 48; reverse_x_walk_ani[ 5 ].h = 69; reverse_x_walk_ani[ 6 ].x = 619; reverse_x_walk_ani[ 6 ].y = 638; reverse_x_walk_ani[ 6 ].w = 48; reverse_x_walk_ani[ 6 ].h = 69; reverse_x_walk_ani[ 7 ].x = 619; reverse_x_walk_ani[ 7 ].y = 638; reverse_x_walk_ani[ 7 ].w = 48; reverse_x_walk_ani[ 7 ].h = 69; reverse_x_walk_ani[ 8 ].x = 561; reverse_x_walk_ani[ 8 ].y = 636; reverse_x_walk_ani[ 8 ].w = 49; reverse_x_walk_ani[ 8 ].h = 69; reverse_x_walk_ani[ 9 ].x = 561; reverse_x_walk_ani[ 9 ].y = 636; reverse_x_walk_ani[ 9 ].w = 49; reverse_x_walk_ani[ 9 ].h = 69; reverse_x_walk_ani[ 10 ].x = 561; reverse_x_walk_ani[ 10 ].y = 636; reverse_x_walk_ani[ 10 ].w = 49; reverse_x_walk_ani[ 10 ].h = 69; reverse_x_walk_ani[ 11 ].x = 561; reverse_x_walk_ani[ 11 ].y = 636; reverse_x_walk_ani[ 11 ].w = 49; reverse_x_walk_ani[ 11 ].h = 69; reverse_x_walk_ani[ 12 ].x = 490; reverse_x_walk_ani[ 12 ].y = 638; reverse_x_walk_ani[ 12 ].w = 62; reverse_x_walk_ani[ 12 ].h = 67; reverse_x_walk_ani[ 13 ].x = 490; reverse_x_walk_ani[ 13 ].y = 638; reverse_x_walk_ani[ 13 ].w = 62; reverse_x_walk_ani[ 13 ].h = 67; reverse_x_walk_ani[ 14 ].x = 490; reverse_x_walk_ani[ 14 ].y = 638; reverse_x_walk_ani[ 14 ].w = 62; reverse_x_walk_ani[ 14 ].h = 67; reverse_x_walk_ani[ 15 ].x = 490; reverse_x_walk_ani[ 15 ].y = 638; reverse_x_walk_ani[ 15 ].w = 62; reverse_x_walk_ani[ 15 ].h = 67; reverse_x_walk_ani[ 16 ].x = 411; reverse_x_walk_ani[ 16 ].y = 638; reverse_x_walk_ani[ 16 ].w = 74; reverse_x_walk_ani[ 16 ].h = 67; reverse_x_walk_ani[ 17 ].x = 411; reverse_x_walk_ani[ 17 ].y = 638; reverse_x_walk_ani[ 17 ].w = 74; reverse_x_walk_ani[ 17 ].h = 67; reverse_x_walk_ani[ 18 ].x = 411; reverse_x_walk_ani[ 18 ].y = 638; reverse_x_walk_ani[ 18 ].w = 74; reverse_x_walk_ani[ 18 ].h = 67; reverse_x_walk_ani[ 19 ].x = 411; reverse_x_walk_ani[ 19 ].y = 638; reverse_x_walk_ani[ 19 ].w = 74; reverse_x_walk_ani[ 19 ].h = 67; reverse_x_walk_ani[ 20 ].x = 330; reverse_x_walk_ani[ 20 ].y = 640; reverse_x_walk_ani[ 20 ].w = 75; reverse_x_walk_ani[ 20 ].h = 67; reverse_x_walk_ani[ 21 ].x = 330; reverse_x_walk_ani[ 21 ].y = 640; reverse_x_walk_ani[ 21 ].w = 75; reverse_x_walk_ani[ 21 ].h = 67; reverse_x_walk_ani[ 22 ].x = 330; reverse_x_walk_ani[ 22 ].y = 640; reverse_x_walk_ani[ 22 ].w = 75; reverse_x_walk_ani[ 22 ].h = 67; reverse_x_walk_ani[ 23 ].x = 330; reverse_x_walk_ani[ 23 ].y = 640; reverse_x_walk_ani[ 23 ].w = 75; reverse_x_walk_ani[ 23 ].h = 67; reverse_x_walk_ani[ 24 ].x = 261; reverse_x_walk_ani[ 24 ].y = 638; reverse_x_walk_ani[ 24 ].w = 61; reverse_x_walk_ani[ 24 ].h = 69; reverse_x_walk_ani[ 25 ].x = 261; reverse_x_walk_ani[ 25 ].y = 638; reverse_x_walk_ani[ 25 ].w = 61; reverse_x_walk_ani[ 25 ].h = 69; reverse_x_walk_ani[ 26 ].x = 261; reverse_x_walk_ani[ 26 ].y = 638; reverse_x_walk_ani[ 26 ].w = 61; reverse_x_walk_ani[ 26 ].h = 69; reverse_x_walk_ani[ 27 ].x = 261; reverse_x_walk_ani[ 27 ].y = 638; reverse_x_walk_ani[ 27 ].w = 61; reverse_x_walk_ani[ 27 ].h = 69; reverse_x_walk_ani[ 28 ].x = 200; reverse_x_walk_ani[ 28 ].y = 638; reverse_x_walk_ani[ 28 ].w = 47; reverse_x_walk_ani[ 28 ].h = 67; reverse_x_walk_ani[ 29 ].x = 200; reverse_x_walk_ani[ 29 ].y = 638; reverse_x_walk_ani[ 29 ].w = 47; reverse_x_walk_ani[ 29 ].h = 67; reverse_x_walk_ani[ 30 ].x = 200; reverse_x_walk_ani[ 30 ].y = 638; reverse_x_walk_ani[ 30 ].w = 47; reverse_x_walk_ani[ 30 ].h = 67; reverse_x_walk_ani[ 31 ].x = 200; reverse_x_walk_ani[ 31 ].y = 638; reverse_x_walk_ani[ 31 ].w = 47; reverse_x_walk_ani[ 31 ].h = 67; reverse_x_walk_ani[ 32 ].x = 674; reverse_x_walk_ani[ 32 ].y = 719; reverse_x_walk_ani[ 32 ].w = 45; reverse_x_walk_ani[ 32 ].h = 72; reverse_x_walk_ani[ 33 ].x = 674; reverse_x_walk_ani[ 33 ].y = 719; reverse_x_walk_ani[ 33 ].w = 45; reverse_x_walk_ani[ 33 ].h = 72; reverse_x_walk_ani[ 34 ].x = 674; reverse_x_walk_ani[ 34 ].y = 719; reverse_x_walk_ani[ 34 ].w = 45; reverse_x_walk_ani[ 34 ].h = 72; reverse_x_walk_ani[ 35 ].x = 674; reverse_x_walk_ani[ 35 ].y = 719; reverse_x_walk_ani[ 35 ].w = 45; reverse_x_walk_ani[ 35 ].h = 72; reverse_x_walk_ani[ 36 ].x = 609; reverse_x_walk_ani[ 36 ].y = 719; reverse_x_walk_ani[ 36 ].w = 57; reverse_x_walk_ani[ 36 ].h = 69; reverse_x_walk_ani[ 37 ].x = 609; reverse_x_walk_ani[ 37 ].y = 719; reverse_x_walk_ani[ 37 ].w = 57; reverse_x_walk_ani[ 37 ].h = 69; reverse_x_walk_ani[ 38 ].x = 609; reverse_x_walk_ani[ 38 ].y = 719; reverse_x_walk_ani[ 38 ].w = 57; reverse_x_walk_ani[ 38 ].h = 69; reverse_x_walk_ani[ 39 ].x = 609; reverse_x_walk_ani[ 39 ].y = 719; reverse_x_walk_ani[ 39 ].w = 57; reverse_x_walk_ani[ 39 ].h = 69; reverse_x_walk_ani[ 40 ].x = 541; reverse_x_walk_ani[ 40 ].y = 722; reverse_x_walk_ani[ 40 ].w = 62; reverse_x_walk_ani[ 40 ].h = 65; reverse_x_walk_ani[ 41 ].x = 541; reverse_x_walk_ani[ 41 ].y = 722; reverse_x_walk_ani[ 41 ].w = 62; reverse_x_walk_ani[ 41 ].h = 65; reverse_x_walk_ani[ 42 ].x = 541; reverse_x_walk_ani[ 42 ].y = 722; reverse_x_walk_ani[ 42 ].w = 62; reverse_x_walk_ani[ 42 ].h = 65; reverse_x_walk_ani[ 43 ].x = 541; reverse_x_walk_ani[ 43 ].y = 722; reverse_x_walk_ani[ 43 ].w = 62; reverse_x_walk_ani[ 43 ].h = 65; reverse_x_walk_ani[ 44 ].x = 469; reverse_x_walk_ani[ 44 ].y = 722; reverse_x_walk_ani[ 44 ].w = 69; reverse_x_walk_ani[ 44 ].h = 64; reverse_x_walk_ani[ 45 ].x = 469; reverse_x_walk_ani[ 45 ].y = 722; reverse_x_walk_ani[ 45 ].w = 69; reverse_x_walk_ani[ 45 ].h = 64; reverse_x_walk_ani[ 46 ].x = 469; reverse_x_walk_ani[ 46 ].y = 722; reverse_x_walk_ani[ 46 ].w = 69; reverse_x_walk_ani[ 46 ].h = 64; reverse_x_walk_ani[ 47 ].x = 469; reverse_x_walk_ani[ 47 ].y = 722; reverse_x_walk_ani[ 47 ].w = 69; reverse_x_walk_ani[ 47 ].h = 64; reverse_x_walk_ani[ 48 ].x = 393; reverse_x_walk_ani[ 48 ].y = 724; reverse_x_walk_ani[ 48 ].w = 65; reverse_x_walk_ani[ 48 ].h = 66; reverse_x_walk_ani[ 49 ].x = 393; reverse_x_walk_ani[ 49 ].y = 724; reverse_x_walk_ani[ 49 ].w = 65; reverse_x_walk_ani[ 49 ].h = 66; reverse_x_walk_ani[ 50 ].x = 393; reverse_x_walk_ani[ 50 ].y = 724; reverse_x_walk_ani[ 50 ].w = 65; reverse_x_walk_ani[ 50 ].h = 66; reverse_x_walk_ani[ 51 ].x = 393; reverse_x_walk_ani[ 51 ].y = 724; reverse_x_walk_ani[ 51 ].w = 65; reverse_x_walk_ani[ 51 ].h = 66; reverse_x_walk_ani[ 52 ].x = 327; reverse_x_walk_ani[ 52 ].y = 724; reverse_x_walk_ani[ 52 ].w = 61; reverse_x_walk_ani[ 52 ].h = 65; reverse_x_walk_ani[ 53 ].x = 327; reverse_x_walk_ani[ 53 ].y = 724; reverse_x_walk_ani[ 53 ].w = 61; reverse_x_walk_ani[ 53 ].h = 65; reverse_x_walk_ani[ 54 ].x = 327; reverse_x_walk_ani[ 54 ].y = 724; reverse_x_walk_ani[ 54 ].w = 61; reverse_x_walk_ani[ 54 ].h = 65; reverse_x_walk_ani[ 55 ].x = 327; reverse_x_walk_ani[ 55 ].y = 724; reverse_x_walk_ani[ 55 ].w = 61; reverse_x_walk_ani[ 55 ].h = 65; reverse_x_walk_ani[ 56 ].x = 264; reverse_x_walk_ani[ 56 ].y = 721; reverse_x_walk_ani[ 56 ].w = 52; reverse_x_walk_ani[ 56 ].h = 71; reverse_x_walk_ani[ 57 ].x = 264; reverse_x_walk_ani[ 57 ].y = 721; reverse_x_walk_ani[ 57 ].w = 52; reverse_x_walk_ani[ 57 ].h = 71; reverse_x_walk_ani[ 58 ].x = 264; reverse_x_walk_ani[ 58 ].y = 721; reverse_x_walk_ani[ 58 ].w = 52; reverse_x_walk_ani[ 58 ].h = 71; reverse_x_walk_ani[ 59 ].x = 264; reverse_x_walk_ani[ 59 ].y = 721; reverse_x_walk_ani[ 59 ].w = 52; reverse_x_walk_ani[ 59 ].h = 71; reverse_x_walk_ani[ 60 ].x = 213; reverse_x_walk_ani[ 60 ].y = 720; reverse_x_walk_ani[ 60 ].w = 47; reverse_x_walk_ani[ 60 ].h = 72; reverse_x_walk_ani[ 61 ].x = 213; reverse_x_walk_ani[ 61 ].y = 720; reverse_x_walk_ani[ 61 ].w = 47; reverse_x_walk_ani[ 61 ].h = 72; reverse_x_walk_ani[ 62 ].x = 213; reverse_x_walk_ani[ 62 ].y = 720; reverse_x_walk_ani[ 62 ].w = 47; reverse_x_walk_ani[ 62 ].h = 72; reverse_x_walk_ani[ 63 ].x = 213; reverse_x_walk_ani[ 63 ].y = 720; reverse_x_walk_ani[ 63 ].w = 47; reverse_x_walk_ani[ 63 ].h = 72; // Reversed Dash reverse_x_dash_ani[ 0 ].x = 700; reverse_x_dash_ani[ 0 ].y = 807; reverse_x_dash_ani[ 0 ].w = 53; reverse_x_dash_ani[ 0 ].h = 65; reverse_x_dash_ani[ 1 ].x = 621; reverse_x_dash_ani[ 1 ].y = 818; reverse_x_dash_ani[ 1 ].w = 72; reverse_x_dash_ani[ 1 ].h = 55; reverse_x_dash_ani[ 2 ].x = 531; reverse_x_dash_ani[ 2 ].y = 825; reverse_x_dash_ani[ 2 ].w = 83; reverse_x_dash_ani[ 2 ].h = 50; reverse_x_dash_ani[ 3 ].x = 531; reverse_x_dash_ani[ 3 ].y = 825; reverse_x_dash_ani[ 3 ].w = 83; reverse_x_dash_ani[ 3 ].h = 50; reverse_x_dash_ani[ 4 ].x = 531; reverse_x_dash_ani[ 4 ].y = 825; reverse_x_dash_ani[ 4 ].w = 83; reverse_x_dash_ani[ 4 ].h = 50; reverse_x_dash_ani[ 5 ].x = 441; reverse_x_dash_ani[ 5 ].y = 825; reverse_x_dash_ani[ 5 ].w = 86; reverse_x_dash_ani[ 5 ].h = 50; reverse_x_dash_ani[ 6 ].x = 441; reverse_x_dash_ani[ 6 ].y = 825; reverse_x_dash_ani[ 6 ].w = 86; reverse_x_dash_ani[ 6 ].h = 50; reverse_x_dash_ani[ 7 ].x = 441; reverse_x_dash_ani[ 7 ].y = 825; reverse_x_dash_ani[ 7 ].w = 86; reverse_x_dash_ani[ 7 ].h = 50; reverse_x_dash_ani[ 8 ].x = 375; reverse_x_dash_ani[ 8 ].y = 808; reverse_x_dash_ani[ 8 ].w = 58; reverse_x_dash_ani[ 8 ].h = 65; reverse_x_dash_ani[ 9 ].x = 320; reverse_x_dash_ani[ 9 ].y = 806; reverse_x_dash_ani[ 9 ].w = 48; reverse_x_dash_ani[ 9 ].h = 67; reverse_x_dash_ani[ 10 ].x = 248; reverse_x_dash_ani[ 10 ].y = 809; reverse_x_dash_ani[ 10 ].w = 62; reverse_x_dash_ani[ 10 ].h = 65; reverse_x_dash_ani[ 11 ].x = 188; reverse_x_dash_ani[ 11 ].y = 808; reverse_x_dash_ani[ 11 ].w = 54; reverse_x_dash_ani[ 11 ].h = 66; // Reverse Jump reverse_x_jump_ani[ 0 ].x = 710; reverse_x_jump_ani[ 0 ].y = 341; reverse_x_jump_ani[ 0 ].w = 39; reverse_x_jump_ani[ 0 ].h = 73; reverse_x_jump_ani[ 1 ].x = 664; reverse_x_jump_ani[ 1 ].y = 340; reverse_x_jump_ani[ 1 ].w = 36; reverse_x_jump_ani[ 1 ].h = 77; reverse_x_jump_ani[ 2 ].x = 615; reverse_x_jump_ani[ 2 ].y = 342; reverse_x_jump_ani[ 2 ].w = 37; reverse_x_jump_ani[ 2 ].h = 81; reverse_x_jump_ani[ 3 ].x = 554; reverse_x_jump_ani[ 3 ].y = 340; reverse_x_jump_ani[ 3 ].w = 40; reverse_x_jump_ani[ 3 ].h = 88; reverse_x_jump_ani[ 4 ].x = 500; reverse_x_jump_ani[ 4 ].y = 344; reverse_x_jump_ani[ 4 ].w = 42; reverse_x_jump_ani[ 4 ].h = 80; reverse_x_jump_ani[ 5 ].x = 434; reverse_x_jump_ani[ 5 ].y = 346; reverse_x_jump_ani[ 5 ].w = 54; reverse_x_jump_ani[ 5 ].h = 75; reverse_x_jump_ani[ 6 ].x = 377; reverse_x_jump_ani[ 6 ].y = 345; reverse_x_jump_ani[ 6 ].w = 50; reverse_x_jump_ani[ 6 ].h = 77; reverse_x_jump_ani[ 7 ].x = 322; reverse_x_jump_ani[ 7 ].y = 341; reverse_x_jump_ani[ 7 ].w = 44; reverse_x_jump_ani[ 7 ].h = 81; reverse_x_jump_ani[ 8 ].x = 261; reverse_x_jump_ani[ 8 ].y = 347; reverse_x_jump_ani[ 8 ].w = 50; reverse_x_jump_ani[ 8 ].h = 75; reverse_x_jump_ani[ 9 ].x = 207; reverse_x_jump_ani[ 9 ].y = 351; reverse_x_jump_ani[ 9 ].w = 47; reverse_x_jump_ani[ 9 ].h = 71; reverse_x_jump_ani[ 10 ].x = 150; reverse_x_jump_ani[ 10 ].y = 353; reverse_x_jump_ani[ 10 ].w = 51; reverse_x_jump_ani[ 10 ].h = 66; // Falling reverse_x_fall_ani[ 0 ].x = 322; reverse_x_fall_ani[ 0 ].y = 342; reverse_x_fall_ani[ 0 ].w = 45; reverse_x_fall_ani[ 0 ].h = 82; } void clean_up() { //Free the images SDL_FreeSurface( background ); SDL_FreeSurface( no_armor_x ); SDL_FreeSurface( reverse_no_armor_x ); SDL_FreeSurface( charge_ani_one ); SDL_FreeSurface( screen ); /* Free Sounds Mix_FreeMusic(music); Mix_FreeChunk(blast); // Close Audio Mixer Mix_CloseAudio(); */ // Close the font TTF_CloseFont(font); // NULL all pointers // Close Joystick SDL_JoystickClose( joystick ); // Quit SDL_ttf TTF_Quit(); //Quit SDL SDL_Quit(); } void loadStage() { ground.x = 0; ground.y = 300; ground.w = 600; ground.h = 500; } int main(int argc, char* args[]) { //Make sure that main waits for a quit bool quit = false; loadStage(); //Initialize if( init() == false) { return 1; } //Load the files if(load_files() == false) { return 1; } Timer fps; setClips(); //While the user hasn't quit while(1) { // Timer START fps.start(); //While there's an event to handle while( SDL_PollEvent( &event ) ) { X.handle_events(); if(event.type == SDL_QUIT || event.key.keysym.sym == SDLK_ESCAPE) { //Quit the program clean_up(); SDL_Quit(); return 0; } } X.move(); // Fill the screen white SDL_FillRect( screen, &screen->clip_rect, SDL_MapRGB( screen->format, 255, 255, 255 ) ); // Ground color SDL_FillRect( screen, &ground, SDL_MapRGB( screen->format, 0x77, 0x77, 0x77 ) ); // Some sort of draw code needs to go here. X.draw(); //Update Screen if(SDL_Flip( screen ) == -1) { return 1; } // Cap the frame rate if(fps.get_ticks() < 1000 / FRAMES_PER_SECOND ); { SDL_Delay( (1000 / FRAMES_PER_SECOND) - fps.get_ticks() ); } } return 0; }
  7. SDL Image Clipping Software (?)

    I was afraid someone would say this :D Well I guess I'd better figure out how to write that program. Thanks for the pseudo-guide though. I'll just have to figure out how to write this. Lazy Foo's SDL tutorials had a function that was supposed to do this, but when I tried it, my program crashed.
  8. SDL Image Clipping Software (?)

    This isn't a programming question before any of you freak out on me. :D For any of you who use SDL, you know that using sprite sheets is an awesome way to keep all of your animation images in the same file, saving space and time, blah blah blah. What I need is a program that will give me the x and y coordinates in the image in the style that SDL reads them in. Photoshop CS3 has a tool that does it, but...well its freaking time consuming to sit there and get the coordinates for a character with over 200+ movements. I have about 25 entities I'm gonna need to make clips for and I'd love to know if anyone knows a faster way to do this? In return I'll give you my undying affection. :D No seriously, I need help. Anyone got any suggestions?
  9. Searching through Maps

    See...I didn't even know I could do that. Is there a link or a book someone could point me to that will show me EVERYTHING you can use with maps? I'd really appreciate this, cause so far I'm not finding stuff that gives me all the info I need. I'd stop posting questions so much and maybe one day start answering some real problems.
  10. rpg game.

    Well, I would say that if you could do everything that comes along with game creation, then yeah you could do it by yourself... But you would have to make ALL of the images your game will use. All the Sounds. Not to mention all the tools you will need to create for your game. Plus the main framework of the game, meaning the game mechanics, actions and the like. Also, it's an online game? I just started reading a book on network programming for C++ programs and even though the writer is doing a great job of breaking it down for noobs, this stuff isn't a walk in the park, so you'll have to do that alone too. My recommendation: Build a team if you are serious.
  11. Searching through Maps

    So I'm trying to find a clever way to search through the map I created and I tried to use the debugger, to no avail. #include <iostream> #include <map> #include <fstream> #include <string> using namespace std; void AddMapData(map<string, string> &itemMap, string name, string filename) { itemMap[name] = filename; } void GetItemInfo(map<string,string> &ItemMap) { ifstream fin("C:/Game Folder/Items/MasterItemList.lis"); if(fin.fail()) { cout << "Somethings wrong with the Master Item List." << endl << "Please solve this problem by recreating the file or something..."; } string ignoredWord, itemName, filename; while(!fin.eof()) { fin >> ignoredWord >> itemName; fin >> ignoredWord >> filename; AddMapData(ItemMap, itemName, filename); } } map<string, string> items; int main() { cout << "This program will search for a specific item that the end-user types in." << endl; cout << "Please choose a created item and enter the name, no spaces: "; string selection; cin >> selection; for(map<string,string>::iterator iter = items.begin(); iter != items.end(); iter++) { if(selection == (*iter).first) { cout << "Filename: " << (*iter).second << endl; } else { cout << "Searching..." << endl; } } system("PAUSE"); return 0; } I assumed that each time the for loop goes through each iteration, that if block will be tested. If selection is equivalent to the iteration, then it should print the filename to the screen, right? I've never used maps before so I'm attempting to get familiar with them and what I can do with them and whatnot. On program run, everything up until the for statement runs properly, but when I enter a name of an item, i.e. TestSword, nothing happens, it just skips to the pause and ends the program. The map works, as I have already tested it in a similar program without the end-user input. I need to know about that for statement. Should I be doing this another way? EDIT: Ok, I must have a virus or something on this damn pc because text keeps vanishing in my compiler window. I know that sounds lame but the call to GetItemInfo(items) VANISHED in the window and it was JUST THERE. I solved the problem, this works, don't waste your time. :D Thanks for reading.
  12. Untitled

    Quote: Hope that helps. It does actually, I keep learning new keywords from you guys. I have a feeling I need to learn a whole lot more. Thanks!
  13. Untitled

    Awesome, and thank you very much again. I appreciate you talking the time out to respond and help me. I'll study map and then rewrite this. Thanks again Zahlman!
  14. Untitled

    It works when I compile it.
  15. Untitled

    0) If the initial file name is hard-coded, there's no point to creating a temporary std::string object for it. There's also almost never a point to using the .open() and .close() member functions. Just use the constructor to open the file and rely on the destructor to close it. When you find your "match", just open a separate ifstream for the other file. - The initial file name, I assume you mean the Master Item List, is hard-coded cause I want that to always be where the program will look for the locations of defined items. Maybe I'm looking at this wrong, but if I have the Item class constructor open that file whenever a new item is used, won't that cause a memory leak or something, or just waste resources? Also, with the default destructor automatically close the file or do I have to define a destructor to do that? 1) If any of your path names have spaces in them, they'll only be read up to the first space. Use std::getline() to get the rest of a line. - This program is supposed to read one word at a time. I don't really like messing with getline(). It seemed easier that way to me. 2) Your variable names are very inconsistent. Don't bother with 'sz' prefixes. They're actually not the "proper" Hungarian prefix for std::string instances, anyway. - I'm using my own prefixes, and I haven't cleaned up my code yet. :D 3) "NULL" is a strange value to use for initializing a std::string instance. Just use the default (i.e. an empty string). - I initialized this variable to null last week cause I thought that was what was causing the problem. I know empty strings don't really cause problems as the compiler won't put anything into them, unlike int's and the like. 4) In general, putting in extra words in your file format which you then skip over is a bad idea. If you want to "label" data within the file, you should do it in a way that allows the program to read the labels to ensure that things are what they're supposed to be (or even to allow the file creator some flexibility, e.g. to re-order the lines). 5) 'tmpNum' doesn't seem to be used anywhere. -It's used, I just didn't post where it gets used. I forgot to take that out. 6) Seeking to the beginning of a newly opened file is unnecessary. If the goal is to reset any error flags from a previous file opened with that stream, well... that's why you don't use .open() and .close() like that :) - Ok, I'm confused here, how else am I supposed to open/close the file if I don't use .open()/close()? Are you saying that I should've just created a new stream? 7) Deliberately pausing all the time like that probably isn't such a good idea. Eventually you'll want to be able to load large files quickly. - Those pauses were put in there so I can see if the item info was loaded or not. I plan on taking them out and adding a more efficient error checking/handling method when I work my way up there :D 8) Instead of storing data into an existing Item, have you considered constructing and returning and Item from the function? Also, instead of reading the whole file each time to construct a new Item, you might want to either (a) read the "catalog" file once and store this information somewhere else, or (b) write the function so that it creates every item in one go (you could then use the items as "prototypes" to create more, by duplicating them with the copy constructor). The code below illustrates both approaches, as well as using the constructor of Item to set up the Item instead of loading the "info" later. :) - I just came to the conclusion earlier before reading this post that I should've just read in the catalog file and stored the info somewhere, but thanks for pointing that out. Also, thanks for the example, it helps. :) 9) Duplicating name info between the 'catalog' and the per-item file data seems like a bad idea. If one is wrong, who do you trust? I've fixed this by assuming it's removed from the catalog. - The catalog only contains the name of the item, and its location in the game folder. The actual item file contains the item's info like stats, usage, etc. private: static map<string, Item> prototypes; What is that? I have never seen such a thing before. This idea of mine was supposed to allow me to use this on a MUD or maybe one day on an online rpg, and allow me to make changes to items by either doing it in-game with 'admin' commands or just editing the database files manually.