Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Jumpster

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. This flag combination is supposed to hide the mouse cursor and disable mouse messages; but it doesn't do that for me. Anyway, the program is multi-threaded with the mouse created in the primary application thread and acquired()/polled() in the mouse thread; does anyone know if the thread seperation would be causing this? I can't find anything on multithreading in the documentation. (DX9). Regards, Jumpster
  2. Jumpster

    Debug mode error (VC++ 6)

    static void makeDead(IMBase* p) { util::list<IMBase*>::iterator j = activeList.begin();; for( ; j != activeList.end(); j++) (*j); util::list<IMBase*>::iterator i = activeList.begin(); for( ; i != activeList.end(); i++ ) if( (*i) == p ) { activeList.erase(i); // delete element i from the active list deadList.push_back(p); return; // object adds itself, so there will never be more than // 1 copy of it's pointer in the list } } [/QUOTE] Ok. This being the code of makeDead(), I can see a few problems here... First: What's the point of the first 'for(;j!=activeList.end();j++)' loop? All you're doing is cycling through them until j = activeList.end(). What a waste of precious time you got going there - especially if you have A LOT of elements in your list<>... Of course, any decent optimizing compiler will eliminate that loop in release build - since you're not using j anywhere else within the function - but still, continuous improvement says you could do better... :) Really though, the only thing I see is that the list<> object is in the util:: namespace. Is this a class you developed; or copied from a book? I ask because the STL list<> wouldn't have a problem with the code you display (except *maybe* in multi-thread stuff - which I doubt is a problem here). Try using the STL std::list<> class. If you're already doing so, you have to let us know - it seems like you're using a non-standard list<> class, which all of us others don't seem to have a clue about... I will help you with your problem, personally, if you contact me via email. My email is Jump@fourman.com. Contact me there if you feel the need. Regards, Jumpster
  3. Jumpster

    2D Shooting Bullets

    Determine how fast you want your bullet to fly across the screen in PixelsPerSecond. So if you have 800x600 resolution, and you want the bullet to take 3 seconds to cross the screen (left to right), then velocity would be 800/3 = 267 pps. Between frames, I assume you keep track of frame timing, set the bullet's velocity to: BaseVelocityX = (267 * FramingTimingMS); BaseVelocityY = (200 * FramingTimingMS); Assuming a 30fps, FramingTimingMS would be about 33ms or .033 giving a BaseVelocityX of 8.8ppf and BaseVelocityY of 6.6ppf where ppf = PixelsPerFrame. Note: Moving Left to Right/Top to Bottom = +ppf. Moving Right to Left / Bottom to Top = -ppf. Of course, for this to feel right, you'd have to take the same approach for your ship's movement and the individual asteroids as well. But, this will give a consistant feel between frames, regardless of the movement/angle of the ship, asteroids etc. This is how I'd go about it anyway, good luck and happy gaming! Regards, Jumpster
  4. Jumpster

    Debug mode error (VC++ 6)

    I've had problems like this in the past myself. For me, the culprit was always in the redefinition of the NULL value. If you redefine your own NULL value - as I do from time to time - check to make sure the definition is occurring for your code. I redefine NULL (and other values) in order to keep from #including a slew of useless headers that Windows inadvertantly adds to the program. Regards, Jumpster
  • 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!