Jump to content
  • Advertisement

nano511

Member
  • Content Count

    118
  • Joined

  • Last visited

Community Reputation

103 Neutral

About nano511

  • Rank
    Member
  1. nano511

    Statemachine?

    If you go to options and change settings, then pop if off, wont the settings be lost? And also thanks everyone for telling me what it was called
  2. nano511

    Statemachine?

    No one knows what im talking about?
  3. nano511

    help with SuperSmashBro's like game

    [font=verdana, arial, helvetica, sans-serif]Let me give you an example of what i want to happen. In SuperSmashBrothersBrawl there is a screen where you can pick to play multiplayer. Lets say that is STATE_MENU. You click to play and a screen comes up where you can choose your characters, or STATE_CHARSELECT. Then another screen comes to choose the stage you would like to play on, or STATE_MAPSELECT. After all that, you can they play the game with the selected characters on the selected map. My problem is that the way my state machine is set up, i cant figure out a way to do that^^. So im asking you to help me fix me state machine so that it would be possible to do the above.[/font]
  4. nano511

    Statemachine?

    I remember reading somewhere about a vector statemachine. It was really flexible and its just what i need but i cant remember all the details of how to implement it lol. If anyone could explain it better or show me an article that would be great [font=verdana, arial, helvetica, sans-serif]basically, you pop on a state to the vector when you want that state to run ( it always runs the last state in the vector ) and if you need states to get information from another state you just stack them on top. Like a STATE_GAME would need information from STATE_SETTINGS, so they would be stacked. but STATE_GAME doesnt need information from STATE_MENU so STATE_MENU is deleted when its not being used.[/font]
  5. nano511

    help with SuperSmashBro's like game

    I have a problem. I need to modify the vector in SelectCharacters::Logic(). How can i take the vector that is passed to SelectCharacters::SelectCharacters() and move it to its Logic function?
  6. nano511

    help with SuperSmashBro's like game

    Okay so i could pass an empty vector by reference to SelectCharacters() from the state machine, fill it up, then since it was a reference it will be changed in the state machine so i could send the same vector to Game()? Would that work and be the easiest of your choices?
  7. nano511

    help with SuperSmashBro's like game

    I started brainstorming and came up with this: character selection state Get the coordinates where p1 dropped his token match the coordinates with the character store the character's number in an array ( do the same with all four players ) then somehow pass the array to Game() as a parameter. This would be hard to do ( unless characterSelection() can return an array? ) because Game() is called from main in my state machine.
  8. nano511

    help with SuperSmashBro's like game

    Im using c++ with sdl.
  9. I dont have any problems with the code yet, but i was wondering how i would send information from the character selection page to the actual game stage. Like, there are 4 tokens, and you can drag each to one of 6 characters. I need the game stage to know which characters were chosen. Im not really looking for code, but more of just a push in the right direction
  10. NVM i fixed it. The problem was i was calling NewRound() in the middle of my Logic() function when i should have been calling it at the end.
  11. nano511

    Game freezes when enemy dies

    I like programming because its like an art, and i can create what ever i want. What i dont like is having all these problems i dont know how to fix. This is not the fun part in the job. The fun part is when your programming workable code, not sitting here all morning trying to figure out why it keeps crashing. I started making this game to gain experience making games. I knew i was going to have a lot of trouble since it was my first big project. I come to you so the problem can be fixed and i can learn from it. E: i fixed the problem. After about 4 hours. >_< E2: nvm its back >
  12. nano511

    Game freezes when enemy dies

    Okay im almost positive i figured out the problem i just need your help confirming and fixing it. In the destructor of the enemy which is called when the enemy is killed, i free the surfaces used to draw him. I have 2 theories on why this is breaking the game: 1. The surfaces are freed from the whole game and the game can no longer draw the enemies who are still alive. 2. something is wrong in my code and my code attempts to draw the dead enemy who's surfaces have been free'd. I looked at the code that draws the enemy and it looks right to me so it either is wrong and i cant see it or the problem is my first theory. Could anyone help me?
  13. nano511

    Game freezes when enemy dies

    Okay i might have found the problem. When i shoot a bullet it is suppose to be removed if it hits an enemy or goes to far. After a bullet has hit something or gone to far though, the capacity for the bullets vector stays at one, but the size goes back down to 0. Is that suppose to happen?
  14. nano511

    Game freezes when enemy dies

    Okay thanks Dunge i implemented the code you showed me and there is no compiler errors but it still freezes when he dies. now it freezes on this bolded line for( std::vector<Monster*>::iterator it = monsters.begin() ; it != monsters.end(); ) { if( ( *it )->health <= 0 ) { player->points += 100; delete ( *it ); it = monsters.erase( it ); } else it++; }
  15. nano511

    Game freezes when enemy dies

    yeah im using a vector. this line doesnt work either [color=#1C2837][size=2][color=#000088]if[color=#666600]([color=#000000] [color=#666600](*[color=#000000]it[color=#666600])->[color=#000000]health [color=#666600]<=[color=#000000] [color=#006666]0[color=#000000] [color=#666600])
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!