Search found 27 matches

by jaybee
Tue May 21, 2013 9:59 pm
Forum: Programming Discussion
Topic: Destructor sometimes called on static object
Replies: 14
Views: 6155

Re: Destructor sometimes called on static object

I discussed a pretty useful alternative to the Singleton design pattern that we use here: http://elysianshadows.com/phpBB3/viewtopic.php?f=48&t=7817&p=82674&hilit=singleton#p82674 Shit dude I just went back and read this thread one more time and I just got your point. That's pretty slic...
by jaybee
Mon May 20, 2013 11:08 pm
Forum: Programming Discussion
Topic: Destructor sometimes called on static object
Replies: 14
Views: 6155

Re: Destructor sometimes called on static object

Thanks for the replies guys. That blog post with the engine code is really interesting. Looks like I've got a lot of studying up to do on design patterns. Sometimes I've wondered if I should just go about my business coding like a dumbass if for no other reason than to fall flat on my face and under...
by jaybee
Sun May 19, 2013 4:45 pm
Forum: Programming Discussion
Topic: Destructor sometimes called on static object
Replies: 14
Views: 6155

Re: Destructor sometimes called on static object

The order in which global objects (such as an instance static) are initialized is not guaranteed. You may have a singleton that depends on another singleton, but the dependent singleton is initialized first. By using lazy evaluated singletons, you ensure that singletons are initialized in the prope...
by jaybee
Sun May 19, 2013 3:37 pm
Forum: Programming Discussion
Topic: Destructor sometimes called on static object
Replies: 14
Views: 6155

Re: Destructor sometimes called on static object

If you're going to implement the Singleton Pattern at least do it correctly. Or even better, don't do it at all [see: http://forums.elysianshadows.com/search.php?st=0&sk=t&sd=d&sr=posts&keywords=singleton for reasons] Yeah, I've heard that it isn't a good idea. I know nothing about ...
by jaybee
Sun May 19, 2013 3:29 pm
Forum: Programming Discussion
Topic: Destructor sometimes called on static object
Replies: 14
Views: 6155

Re: Destructor sometimes called on static object

Hmmmm... it looks like you're right. It is getting called, it just seems to take quite a while sometimes for it to finish. That's the reason I thought it wasn't getting called. Sometimes it just finishes really quickly and sometimes it takes like 30 - 40 seconds. Here is the code: SoundManager::~Sou...
by jaybee
Sun May 19, 2013 2:35 pm
Forum: Programming Discussion
Topic: Destructor sometimes called on static object
Replies: 14
Views: 6155

Destructor sometimes called on static object

I was writing a music/sound manager class the other day and it has a destructor that first stops all music or sounds that are currently playing and deletes the objects that are stored in a std::map. Sometimes with my manager classes I like to do something like this: class Manager { public: static Ma...
by jaybee
Wed Feb 15, 2012 12:01 pm
Forum: Programming Discussion
Topic: Help with SDL!
Replies: 12
Views: 2636

Re: Help with SDL!

lalacomun wrote:Well i get to the conclusion That Dev-C++ SUCKS!
I think that's the general consensus among most people on this forum. ;)
by jaybee
Tue Feb 07, 2012 2:46 pm
Forum: Game Development
Topic: Dawn Engine Development
Replies: 3
Views: 1968

Re: Dawn Engine Development

Nice progress man! I've been procrastinating on making a level editor for a while now for my platformer. I know it will make the whole process a lot easier but I just really don't want to do it lol. I'm looking forward to seeing where you take the project.
by jaybee
Tue Feb 07, 2012 12:46 pm
Forum: Programming Discussion
Topic: Handling non-uniform sprite animations
Replies: 4
Views: 1853

Re: Handling non-uniform sprite animations

It's a tricky one huh! If I had to have different bounding and pivot for each sprite, then I'd store it as a variable, maybe an animation struct with the collision and pivot data, plus animation speed, transition modes, and whatever else the engine demands. This makes sense. As it stands my animati...
by jaybee
Sun Feb 05, 2012 9:46 pm
Forum: Programming Discussion
Topic: Handling non-uniform sprite animations
Replies: 4
Views: 1853

Handling non-uniform sprite animations

So up until this point I've mostly been using a box as a placeholder for the platformer I've been casually working on. I finally decided to add some animations just to keep my motivation up. I had no problem implementing some basic animations but another problem has popped up along the way. As I cyc...
by jaybee
Tue Jan 31, 2012 11:38 am
Forum: Programming Discussion
Topic: [SOLVED] 2d platformer collision
Replies: 7
Views: 1671

Re: 2d platformer collision

Ok So I figured out what I was doing wrong here. I wasn't comparing the ABSOLUTE VALUE of the overlaps or setting the minimum distance to the half widths and half heights of the rects :oops:
by jaybee
Tue Jan 31, 2012 8:58 am
Forum: Programming Discussion
Topic: [SOLVED] 2d platformer collision
Replies: 7
Views: 1671

Re: 2d platformer collision

Find the coordinates of the corners of your bounding rect (this will work even if you decide to use rotations later, just the math for finding the corner will be more involved). Check which corners intersect. Depending upon if you want a physical pushback or to just land squarely on the tile, you c...
by jaybee
Tue Jan 31, 2012 12:24 am
Forum: Programming Discussion
Topic: [SOLVED] 2d platformer collision
Replies: 7
Views: 1671

Re: 2d platformer collision

I'm not sure what type of high school you went to, but in mine, we had to give the books back at the end of the semester ;) . I have tried to do exactly that and it has failed. I'm not sure exactly what the problem is. Can you possibly point me in a direction other than: 1.) Find a book you had to r...
by jaybee
Mon Jan 30, 2012 11:25 pm
Forum: Programming Discussion
Topic: [SOLVED] 2d platformer collision
Replies: 7
Views: 1671

[SOLVED] 2d platformer collision

So I'm going to go ahead and ask a question that many have asked before, not because I haven't read the relevant posts, but because I can't seem to square away an implementation that works for me. I'm going to assume this is a lack of experience and knowledge on my part, however, maybe some of you c...
by jaybee
Sun Apr 10, 2011 12:29 am
Forum: Game Development
Topic: Commodore 64 is BACK and Amiga soon!
Replies: 5
Views: 2148

Re: Commodore 64 is BACK and Amiga soon!

Guess that depends on when you were born...