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

Author Topic: Let's Create an sf::Pig!  (Read 6653 times)

0 Members and 1 Guest are viewing this topic.

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Let's Create an sf::Pig!
« 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)
« Last Edit: December 19, 2012, 08:34:39 pm by Aster »

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Let's Create an sf::Pig!
« Reply #1 on: December 15, 2012, 12:12:36 pm »
You just forgot sf::Pig::explode()

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Let's Create an sf::Pig!
« Reply #2 on: December 15, 2012, 12:36:56 pm »
You just forgot sf::Pig::explode()
Ah right! Added! Thanks for the input.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Re: Let's Create an sf::Pig!
« Reply #3 on: December 16, 2012, 04:38:37 am »
You aren't consistent with your member function names.

Aster

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: Let's Create an sf::Pig!
« Reply #4 on: December 19, 2012, 08:34:58 pm »
You're right! Fixed that!

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Re: Let's Create an sf::Pig!
« Reply #5 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.

masskiller

  • Sr. Member
  • ****
  • Posts: 284
  • Pointers to Functions rock!
    • MSN Messenger - kyogre_jb@hotmail.com
    • View Profile
    • Email
Re: Let's Create an sf::Pig!
« Reply #6 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.
Programmer, Artist, Composer and Storyline/Script Writer of "Origin of Magic". If all goes well this could turn into a commercial project!

Finally back into the programming world!

Cornstalks

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • My Website
Re: Let's Create an sf::Pig!
« Reply #7 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  :(

mateandmetal

  • Full Member
  • ***
  • Posts: 171
  • The bird is the word
    • View Profile
    • my blog
Re: Let's Create an sf::Pig!
« Reply #8 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
- Mate (beverage) addict
- Heavy metal addict _lml
- SFML 2 addict
- My first (and free) game: BichingISH!

fstream

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: Let's Create an sf::Pig!
« Reply #9 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?

 

anything