SFML community forums

General => General discussions => Topic started by: Aster on December 15, 2012, 09:36:15 am

Title: Let's Create an sf::Pig!
Post by: Aster on December 15, 2012, 09:36:15 am
Hi y'all!
I'm currently doing the Ludum Dare, using C++ and SFML (because SFML is just so cool for this stuff), and I realized that SFML did not have an sf::Pig. As my game is about a pig, this made me sad.  So I suggest the easter-eggy implementation of an sf::Pig! (Complete with texture and everything)

usage:
sf::Pig Johnny( sf::Pig::Personality::Nice, true); // creates a little piggy with attitude "nice" and active = true.
Johnny.runAround();
Johnny.Oink();
Johnny.Fart(sf::Pig::fartType::loud);
if(Johnny.shootGiantLaserBeamOutOfMouth())
{
    Johnny.Slaughter();
}
else
{
    Johnny.Explode();
}
 

I find this a genius idea. Thanks for reading!

(Yes, I AM kidding, although it'd be pretty cool to have an sf::Pig)
Title: Re: Let's Create an sf::Pig!
Post by: Lo-X on December 15, 2012, 12:12:36 pm
You just forgot sf::Pig::explode()
Title: Re: Let's Create an sf::Pig!
Post by: Aster on December 15, 2012, 12:36:56 pm
You just forgot sf::Pig::explode()
Ah right! Added! Thanks for the input.
Title: Re: Let's Create an sf::Pig!
Post by: panithadrum on December 16, 2012, 04:38:37 am
You aren't consistent with your member function names.
Title: Re: Let's Create an sf::Pig!
Post by: Aster on December 19, 2012, 08:34:58 pm
You're right! Fixed that!
Title: Re: Let's Create an sf::Pig!
Post by: model76 on December 20, 2012, 06:07:54 am
No no no. This is much too specific to be included in a multimedia library.

What I would suggest is that you change the active parameter from bool to float. That way the users could control how active the pig should be.
Title: Re: Let's Create an sf::Pig!
Post by: masskiller on December 20, 2012, 07:37:41 am
Not to mention that you should be able to control the radius of the explosion or whether the fart is explosive or not regardless of how loud it may be.
Title: Re: Let's Create an sf::Pig!
Post by: Cornstalks on December 21, 2012, 10:57:13 pm
I tried compiling this but I keep getting "Undefined reference to sf::Pig::runAround" and other errors  :(
Title: Re: Let's Create an sf::Pig!
Post by: mateandmetal on December 23, 2012, 06:34:54 pm
I tried compiling this but I keep getting "Undefined reference to sf::Pig::runAround" and other errors  :(

You must link against the pig library (libsfml-pig)  ;D
Title: Re: Let's Create an sf::Pig!
Post by: fstream on December 25, 2012, 06:56:58 am
You must link against the pig library (libsfml-pig)  ;D
It seems the download link has disappeared. Do you have a mirror?