SFML community forums
Help => General => Topic started by: darekg11 on November 12, 2010, 01:02:45 pm
-
Okay, sup there guys?
I finally made my main menu, new game menu, some pictures viewing, saving info to file and reading from file - basic stuff and now I need help from You guys, I got couple of questions:
1)I need tilemap map editor, I serched forum and found 2 intersting projects:
a) http://www.sfml-dev.org/forum/viewtopic.php?t=2340&start=45
b) http://www.sfml-dev.org/forum/viewtopic.php?t=1920
I wonder which one should I use? The game is top viewed.
Also if I use one of these editors how can I manage collisions with other objects like boundaries of map or other sprites? Also I dont' want to use .XML format.
I saw that SFMLMappy uses FMP format and it's also can handle isometric maps(I going to need that one in a future) - I will probably use this one editor but please give me some opinions.
2)I need to animate my character in game, You know move when I press A or W etc...
I saw that class to manage animations: http://www.sfml-dev.org/wiki/en/sources/anisprite
It's pretty cool, I think it will be enough right?
Also I want to use the same class to managa moving or trees or people in game, will it be possible?
3)How can i add some post effects like slowly moving string from top to bottom? I have to check if LastFrameTime is > 1s and if it is then change string position to lower?
Thanks in advance guys.
-
3)How can i add some post effects like slowly moving string from top to bottom? I have to check if LastFrameTime is > 1s and if it is then change string position to lower?
Last frame time is often used with a value per second.
float speed = 200.f // Pixels per second
...
while(window.IsOpened())
{
...
sprite.Move(speed*window.GetFrameTime(), 0);
}
The given sprite will move to the right at 200 pixels per second.
-
Thanks man, working great : D
-
Okay, I just saw that both map editors have code to use with SFML in C++
And I use CSFML so I have to build my own map editor or translate C++ code to C which will be kinda hard?
Or just use normal editor and then ad colission by my self but how? Damn no C materials on wiki.
Animation code is also in C++, damn.
Damn I think translating everything will be better than reinventing the wheel?
-
Any idea, what about that map editor? Translating it will be pain in the ass.
I thought about using normal map editor but then write my own code to handle maps and then, write my own colission detection and finally storing all sprites in a C list and then checking if player collises with sprite by running check throught list?
-
I thought about using normal map editor but then write my own code to handle maps and then, write my own colission detection and finally storing all sprites in a C list and then checking if player collises with sprite by running check throught list?
I recommend using Box2D for collision.
-
Okay I found function:
bool b2TestOverlap
bool b2TestOverlap ( const b2Shape * shapeA,
const b2Shape * shapeB,
const b2Transform & xfA,
const b2Transform & xfB
)
ShapeA and shapeB would be sprites right? and the two last parametrs? This function return TRUE if shapes collises so then I just have to stop animating my char and set it to position before obstacle?
Also if I do it like this how can I test collisions with map boundaries or with for exmaple tree(as tile placed in map editor)? Then I have to check it manually?
I think I first will made some background and test animation and collisions.
What about animation, how can I translate C++ to C code?