Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Carlitox

Pages: 1 2 3 [4]
46
General discussions / Re: SFML 3 - What is your vision?
« on: April 30, 2014, 03:47:04 pm »
For me is about prototyping and fast development and trashing.  .....  Maybe I should not use SFML for that purpose and using something like unity or gamemaker. But I like C++ and SFML  ;D

For protoypes it's better to use a lua based framework. My favorite one is gideros mobile.

47
General discussions / Re: SFML 3 - What is your vision?
« on: April 29, 2014, 03:18:52 pm »
There was a problem with sf::sleep. Some programs like Chrome modify the FPS.

http://en.sfml-dev.org/forums/index.php?topic=10231.0

I had the same problem using sf::sleep to wait in the main loop. This should be solved in SFML 3.0

48
General discussions / Re: SFML 3 - What is your vision?
« on: April 28, 2014, 06:02:07 pm »
- Scripted quest system

I think this is way too specific for a library. I can think of many games (let alone applications) that would never, ever need this. A lot of game engines (which SFML is not) don't even go to these sorts of lengths.


Yes it is.

Abstract that could be difficult but challenging,

49
General discussions / Re: SFML 3 - What is your vision?
« on: April 28, 2014, 05:45:29 pm »
- Change the developement direction to a game programming framework not being only a media layer.
- Integrate thor library
- Create an entity system
- Create a TiledMap class
- Messaging systems
- Lua scripting class that exposes entities, camera and the map
- Scripted quest system


One way to do it it's create another layer.

50
General discussions / Re: Creating Action-RPG using SFML
« on: April 16, 2014, 12:56:02 am »
http://www.solarus-games.org/

You have this engine that is open source to take a look and see how difficult could be to program an action rpg like "Zelda: a link to the past".

51
SFML projects / Re: Thor 2.0
« on: December 25, 2013, 04:40:52 pm »
Now I avoid the unnecesary copies.

std::mt19937 mt;
std::uniform_real_distribution<float> distr(1.f, 3.f);

auto randomizer_lambda = [&distr, &mt]
{
        return sf::seconds(distr(mt));
};

thor::UniversalEmitter emitter;
emitter.setParticleLifetime(randomizer_lambda);

 

52
SFML projects / Re: Thor 2.0
« on: December 25, 2013, 03:38:30 pm »
Thank you, it works. I tried to do the same with lambda and works as well.

auto randomizer_lambda =
[]()
{
        std::uniform_real_distribution<float> distr(1.f, 3.f);
        std::mt19937 mt(std::chrono::system_clock::now().time_since_epoch().count());
        return sf::seconds(distr(mt));
};

emitter.setParticleLifetime(randomizer_lambda);

53
SFML projects / Re: Thor 2.0
« on: December 25, 2013, 03:06:54 am »
Hello I'm new with this library and in the forum. I cannot see the option to insert code.


I'm dealing with the particle system and learning all about it. I read that you can create your own distributions and apply it to the particles properties like the lifetime, rotation, position, etc.

For example:


thor::UniversalEmitter emitter;
emitter.setParticleLifetime(thor::Distributions::uniform(sf::seconds(1.f), sf::seconds(3.f)));


I tried to make the same but with my own distribution following the documentation.


unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 engine(seed);
std::uniform_real_distribution<float> distr(1.f, 3.f);
auto randomizer = std::bind(distr, engine);
thor::Distribution<float> thorDistr(randomizer);

thor::UniversalEmitter emitter;
emitter.setParticleLifetime(sf::seconds(thorDistr()));

 

This solution gives the same lifetime to all the particles, therefore it fails.

I think that I must use something like this but the library doesn't allow to do it or maibe I don't know how to implement it correctly:



unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 engine(seed);
std::uniform_real_distribution<float> distr(1.f, 3.f);
auto randomizer = std::bind(distr, engine);
thor::Distribution<sf::Time> thorDistr(randomizer);

thor::UniversalEmitter emitter;
emitter.setParticleLifetime(thorDistr().asSeconds());

 

Do you how I can implement it?

Pages: 1 2 3 [4]
anything