SFML Error! :(

Started by
14 comments, last by SiCrane 11 years, 6 months ago
Yes SiCrane, that's exactly the numbers! It says it is uninitialized by (3435973836 x 3435973836) two times, for two images. Can you elaborate on the member variable constructor order problem that you described :)?

I'm a game programmer and computer science ninja !

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here !

Advertisement
When an object is constructed, first any base classes are constructed, then its member variables are constructed in order of declaration in the class definition, regardless of what order you put them in the member initialization list. If you use one member variable to initialize another member variable in the member initialization list of a constructor you need to be sure that any member variable referenced actually appears above in the class definition. The easiest way to do this is to make sure that your member initialization list always follows the same order as the class definition and don't reference member variables that appear later. MSVC is unfortunately just about the only major compiler on the planet that won't give you a warning for not putting your member initialization list in class declaration order (which is frankly stupid).
I did that, and now It shows the ball moving, you can't move your paddle, and none of the blocks are displayed. Well, I'm still trying to fix it :(.

I'm a game programmer and computer science ninja !

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here !

Okay, I'm not trying to fix it. I need to do something simpler. I do not have the knowledge required yet to make breakout. I am now going to attempt a space invaders clone, or maybe something of the sort. This project is dead, and the code design is stupid. I need to start preplanning, creating interfaces, and designing my classes better.

I'm a game programmer and computer science ninja !

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here !


I need to start preplanning, creating interfaces, and designing my classes better.


To be honest, you don't. You aren't really at that stage yet where you should really be worrying about design all that much.

What you should focus on is figuring out *WHY* your current project doesn't work. You can't design around a problem you don't understand.

It's a frustrating experience, working through a problem you don't understand, but it is a valuable part of learning anything. Switching from Breakout to Space Invaders will not help you in the least. Now, if your problems are stemming from an overly complicated design ( aka, biting off more than you can chew ), by all means, revisit and simplify, but don't abandon a project just because you can't get it to work. The most likely reason is a lack of understanding of the language itself, which is a problem you are going to have to face and starting over isn't how you do it.

Finally, and I will say this like a broken record... you can't skip the learning curve, don't bother trying. You really are just going to make things harder on yourself over all.

I don't mean to be harsh, but comments like this are extremely telling:

How can I use visual studios debugger?

Instead of starting a new project, this is EXACTLY what you should be learning next. You will advance your skillset a thousand fold more by learning how to debug, than you will by going from one game type to another. Until you have a pretty solid grasp of debugging, you will never really understand code. Trust me on this, the insight you will gain from interacting with your code as it runs will be a massive eye opener.

A quick google turned up this introduction (pdf link) which seems pretty good. It also turned up a lot of crap tutorials too, oddly debugging seems to be something people did a lousy job of explaining... the one intro do debugging tutorial ( one of the top results ), jumped straight in to disassembly, perhaps the last thing a beginner needs to know.... There also appear to be a ton of video tutorials on YouTube, but I've personally never been a fan of a) video tutorials b) YouTube.
Judging by your errors, the problem isn't that breakout is too complicated for you, the problem is that you're trying to tackle too much of the complexity all at once. Start in smaller chunks and grow slowly, testing as a you go. Don't try constructing a ball, paddle and bricks all at once. First put in the paddle, then maybe see about moving it around and then put in something else.

This topic is closed to new replies.

Advertisement