Advertisement Jump to content
  • Advertisement

MrCpaw

Member
  • Content Count

    538
  • Joined

  • Last visited

Community Reputation

193 Neutral

About MrCpaw

  • Rank
    Advanced Member
  1. MrCpaw

    Private vs Protected

    Anything protected is visible to the class and derived classes, while private is just shown for that class. It all goes back to how you're going to be setting up your classes. If you don't need protected, just use private.
  2. MrCpaw

    Yeah, I made it.

    Just keep on rolling. :P
  3. MrCpaw

    Soldier On

    The best way I've found in setting up a game is to design it all on paper, once I'm satisfied with what I have I start working on each unit and item, ect... in great detail. Once the paper work is all completed and I have a list of all the graphic resources I need I get drawing them all and finish it all first. Once that is done I get down to programming the game itself. After this has been completed I can get a better feel for the mood and feel of the game to better compose the soundtrack. I'm pretty much sticking to this way of doing things for my projects. It has the thought in mind that you're doing it all on your own though. Normally team projects start once the design doc is done and they all work at the same time.
  4. MrCpaw

    Sounds Like a Hack

    Very nice! I use XNA a bit and could use something like this.
  5. MrCpaw

    The Thing That Should Not Be

    Sorry for your difficulties. I cannot relate to your problem, but I hope things are much better now! :)
  6. I honestly think C# will be the future when it comes to Windows games, just not right away. C++ still remains a very popular language due to the massive code bases companies have and all of the portability it has, which doesn't apply in this care with Direct X. Not to mention the power, speed, and memory management which is major requirement for developing on consoles, and hand helds. C# with XNA alone has proved to be a very powerful combination in today's indie games. Being a programmer means you need to adapt and yes, learn new languages as they become available. Never be stuck to any one language, it's like being a artist, sometimes you gotta try the new brushes and paints. C alone is still be used to develop a lot of games, so I don't see C++ becoming a dead language for at least a decade.
  7. MrCpaw

    Sound menu and sliders

    I see you're still working a rapid pace! :P Knowing how lazy I am at times, I would of made an image with a cut out circle bar leaving it transparent, than just slide a rectangle box that is white under it when increasing or decreasing volume giving the same effect you have. It just wouldn't look too good because you have transparency on your GUI window.
  8. MrCpaw

    Should i swap languages?

    To be honest, if you stick out learning C++ now a lot of the other languages will be easy to catch on after you learn their syntax. Not to mention all of the skills you will learn about memory management; You will come to love languages like C# that handle memory for you. I would suggest sticking it out, however if it's not that pleasant to you, then by all means change the language.
  9. MrCpaw

    Fix You

    Technically speaking since you're using new and delete you wont loose anything from doing it, however it's just a bad practice to getting into allocating memory over and over when you don't need to. It's no different than using pointers, never over use something and never use something unless you need too. For such simple games it's really pointless. I was working on another game a while back which I had to allocate memory very often and delete because I had to use a ton of resources, plus I didn't want to have a slow down on older machines. I was extremely picky on what was loaded into memory and what wasn't. However that was mainly graphic files, not classes. In general, if you can reuse that code you should. In some cases you wont, for example I'm working on a game now which I have a ton of classes made that are all enemies, which was done for a good reason because I needed a ton of enemies on the screen at once which use different settings from that class. However in your case, you're dealing with one ball here and you should reuse it instead of deleting and using new. In the end it all comes down to what works for you, even if it isn't considered right by me or others, some might consider it the right way. I personally stay away from new and delete unless I must use it, period.
  10. MrCpaw

    Fix You

    Try to picture this in your mind. You're playing a game of basketball, 1 on 1. Would you recreate the ball in real life every time you put in in a net or it went out of bounds? No, you would reuse that ball. What you're doing is adding more steps than required to do the same thing as making that ball not active. Here is an example I made for you. I have a class called Ball, and I only use one Red_Ball from it for two loops. Make a new win32 console for C++ and paste this in a run it. You should always reuse as much as you can instead of recreating all over the place. This may not be the best example, but it's just showing me reusing the ball after it goes out of bounds, which is at location 100 for x. #include <iostream> class Ball { private: // Position int X; // Speed int Speed; public: // Constructor Ball::Ball() { X = 0; Speed = 1; } // Set X void Ball::Set_X(int X_Temp) { X = X_Temp; } // Get X int Ball::Get_X() { return X; } // Show X void Ball::Show_X() { std::cout << "\nX = " << X; } // Move X Right void Ball::Move_X_Right() { X += Speed; // Check if X goes out of the area if (X >= 100) { std::cout << "\nX is out of bounds!\n\nX = " << X; // Reset X to 0 Set_X(0); std::cout << "\nPutting X at 0! X = " << X; } } }; int main() { // Create The Ball Ball Red_Ball; // Game Loop bool Game_Active = true; int Loop_Amount = 0; while (Game_Active == true) { // Show X Value Red_Ball.Show_X(); // Move X Red_Ball.Move_X_Right(); // If X is Reset to 0, exit! if (Red_Ball.Get_X() == 0) { Loop_Amount ++; if (Loop_Amount != 2) { std::cout << "\n\nPress Any Key To Loop Again (It will only happen once more!)"; std::cin.get(); } if (Loop_Amount == 2) { Game_Active = false; } } } // Wait For Keyboard Input To Exit std::cout << "\n\nPress Any Key To Quit"; std::cin.get(); return 0; } I hope this helps you understand what I mean. You should have a function called Reset, or something like that. So when the ball goes out of the play area you can reset the X and Y, plus other settings as if it was a fresh new object.
  11. MrCpaw

    Fix You

    Your download link is broken, so I cannot see your code to verify if you're doing what I think you're. You should never delete an object and re create it for something like the ball. I'm assuming you're using new when the ball is made and delete when it's out of play, then recreating it as new? Not sure if that is what you meant from your post. You should have a bool like this instead: bool Active; or bool Visible; Once the ball comes out of play it's no longer active, which means you need to add in a check to collision to make sure it cannot delete blocks or do anything when it's not active. Then reset the X and Y values and make it Active. Under your draw phase just put and if statement that only draws your ball if Active == true. Just encase you're using new and delete, this is better suited for resources you never plan on using again or for awhile. For example, if you had an intro screen at the start of your game with your logo or something, after it's done playing and you've hit the main menu you don't need it anymore. So deleting that make senses. If you have a shooter and a enemy ship graphic will no longer be used for a major part of the game or even until the next level or two, you can delete it and re allocated when needed, however it doesn't make sense to use new and delete on a lazer for example every time it hits an object or goes off screen, and you need to re-shoot it. I'm not fully sure if this is what you're doing or not, could you post your code for your ball for which you're creating a new one every time?
  12. MrCpaw

    Hate This And I'll Love You

    It wouldn't be to hard to add in. Once the ball goes out of the play area, put it's location at the paddle / 2 for the x and above the paddle for the y value, then wait until the space button is pressed to move the ball to the top right. I'm guessing you have it by default going out at an angle so you don't have to program in all that fancy stuff.
  13. MrCpaw

    Hate This And I'll Love You

    Nice job on completing your game! The only things I would change would be allowing the ball to start in the middle of your pad and by pressing the space bar you launch it because if it goes down and you're way over on the left side and the next ball comes out, it could hit a block and go right back down before you can get there. The other thing I would of changed would be adding a backspace feature for your password entry. Nice work! :)
  14. MrCpaw

    Amusing if it wasn't so tragic

    That's just WOW!!! Not to mention just sick, they're willing to can their cleaners and leave the toilets uncleaned to save a few bucks? What happens if the toilet got plugged and over flowed with crap everywhere? The funny thing about these companies is that they're willing to can the bottom down people yet they have no problem keeping their over payed salaries. Some of these guys get 100k + bonus a year, yet they cannot afford a toilet cleaner who is lucky to make 1,500k a month???
  15. MrCpaw

    Allegro enemies?

    When making enemies think just like in real life. They will have a movement speed, direction, minimum health, maximum health, current health, and attack damage. Functions that deal with movement, adding and removing health (depending on if they can regenerate), and attacking. For dieing, you just do this: if (Do Collision Here && Key Press) { Enemy.Die(); } For movement just do something like this: if (Enemy.X <= Player.X + 100) { Enemy.Move(); } This of course only works if you're on the left side of the enemy. Hopefully this helps.
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!