SFML community forums
General => SFML projects => Topic started by: Srejv on February 13, 2009, 09:56:04 pm
-
Hey guys!
I've made little puzzler and I'd like some feedback. :)
http://srejv.radhuset.org/flipgame/
So I rewrote the game, and improved on it. :) Changed a few of the levels too.
I'd still like some feedback! Good luck! :)
I'm using the animation framework in the wiki for animation. :]
-
Thank you. :)
-
Nice Game, funny to play. :)
If you want to continue working on it, you could make everything a little bit more colored, add some flip animations or something like this... ;)
I already have a feature request: a save function. Because noone will finish all the 100 (!) levels in one go.
That is definitively not SFML's task. ;)
You can save by writing into files. Use the C++ standard library's file stream std::fstream (http://www.cplusplus.com/reference/iostream/fstream/) to do so.
-
Thank you! :)
Yes, animation is on the list. :] And colors!
I think I have to rewrite my screen class to support sharing variables between screens. I'm currently using http://www.sfml-dev.org/wiki/en/tutoriels/multiecransjeu_en and I try to add a static bool to that class to check if you press the "load game" option. But it won't compile. :(
1>main.obj : error LNK2001: unresolved external symbol "protected: static bool Screen::load_game" (?load_game@Screen@@1_NA)
So I'm gonna have to think of another way.
-
Would you mind releasing the source code so that non-Windows users can enjoy your game? :)
-
So I'm gonna have to think of another way.
Not really. You probably forgot to define the Screen::load_game function or didn't define it exactly with the same type as declared. At least the linker cannot find the definition.
-
Would you mind releasing the source code so that non-Windows users can enjoy your game? :)
Yes, that's the plan, only it's kinda broken right now since I'm trying to make it a better game. :] But I'm having some trouble so ... well.
Not really. You probably forgot to define the Screen::load_game function or didn't define it exactly with the same type as declared. At least the linker cannot find the definition.
I just had a public static bool, no function. :\ No idea what I'm doing wrong.
class Screen
{
public:
static bool load_game;
virtual int Run (sf::RenderWindow &App) = 0;
};
Edit:
1>square.obj : error LNK2001: unresolved external symbol "protected: static class sf::Image Square::m_White" (?m_White@Square@@1VImage@sf@@A)
1>square.obj : error LNK2001: unresolved external symbol "protected: static class sf::Image Square::m_Grey" (?m_Grey@Square@@1VImage@sf@@A)
Trying to follow http://www.sfml-dev.org/tutorials/1.4/graphics-sprite.php to get static vars working, but it's not working. Checked http://msdn.microsoft.com/en-us/library/f6xx1b1z(vs.71).aspx and I think it's got something to do with accessing the variables from other places. :\
Edit again:
Yes. When I remove the call from square.cpp the error vanishes. Hm. So calling a static variable from another file isn't allowed? :S
-
I just had a public static bool, no function. :\ No idea what I'm doing wrong.
Ah sorry. But the problem remains the same. The variable needs to be defined in the CPP file:
bool Screen::load_game; // or:
bool Screen::load_game = false;
If you don't initialize load_game, it is initialized with its null value (in this case false) like all static or global variables.
-
I just had a public static bool, no function. :\ No idea what I'm doing wrong.
Ah sorry. But the problem remains the same. The variable needs to be defined in the CPP file:
bool Screen::load_game; // or:
bool Screen::load_game = false;
If you don't initialize load_game, it is initialized with its null value (in this case false) like all static or global variables.
Aah! It works now! :D Thank you so much!
Though I still think I have to rewrite some of this stuff. Trying to figure out how to make the animation.
-
Aah! It works now! :D Thank you so much!
No problem. ;)
Trying to figure out how to make the animation.
One way is to have several sprites which represent each step of the animation. So you draw one sprite, wait a certain time, draw the next, and so on... The more steps you have, the more fluent the animation looks.
-
Just a question :D. I was level 33 and i clicked on start game so i lose my save game... How can i revert back to level 33?
-
Sorry, if you clicked the start game button the saved game is pretty much gone. :\ I'm working on a better way to solve the saving in a new version.
It's got animation and colors. :)
-
The game crash when we close the window.
Im stuck at level 54.
Edit: Stuck at level 60!
-
Yes, the game crash is also fixed in the new version that's coming soon. Working on it right now. :]
-
Good job, I like the new animations. Don't know what I think about the way you show the current level though :)
I also get an error when I quit the game:
'The instruction at "0x0930afda" referenced memory at "0x00000080". The memory could not be "read".'
-
I think the new way of showing the level is better... but maybe that's just me. :\
Yes, it's the sf::font class when it loads the default font. :\ From what I understood it's a sfml bug..
-
Yes, it's the sf::font class when it loads the default font. :\ From what I understood it's a sfml bug..
Hm, I rather don't think so. Did you initialize it before main() is invoked? If the font is set inside a constructor or a called function from a global or static object, this may lead to problems.