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

Author Topic: Which language to use?  (Read 8768 times)

0 Members and 1 Guest are viewing this topic.

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Which language to use?
« Reply #15 on: April 16, 2010, 12:18:41 pm »
For an sf::string, of course, a stringstream will help :wink:
Mindiell
----

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Which language to use?
« Reply #16 on: April 16, 2010, 12:22:49 pm »
then, use phyton  :lol:

Code: [Select]
myAge = 23
myString = "I am " + str(myAge) + " years old"
Pluma - Plug-in Management Framework

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: Which language to use?
« Reply #17 on: April 16, 2010, 12:38:28 pm »
Quote from: "Mindiell"
Be careful, I'm just asking questions, not judging you. It's always interesting to see what others do.


Hey I didn't mean to offend you, I was only puzzled by your question.

Here is how my code looks like:

Code: [Select]
int txt = sprintf_s(string, "KPH %6.0f WHEELS %6.2f AIR %6.3f DISTANCE %6.0f POWER %6.0f", s, wheels, air, dist, pwr);
label.SetString(string);


Label is an sf::Text object. So, as you can see, displaying these numbers with all the formatting, using c++ streams would be much more complex.

Anyway, I seem to have some problem with my code. I declare the "float wheels = 0.f;" and when I run the program, SOMETIMES it is not equal to zero. it's very strange to me. the value randomly is equal to zero or something else, each time I run the program.

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Which language to use?
« Reply #18 on: April 16, 2010, 02:11:33 pm »
Very strange, what is the value in wheels if it's not 0 ?

Quote from: "kolofsson"
Hey I didn't mean to offend you, I was only puzzled by your question.
Ok, I was afraid I offended you. I'm french and am not always completely sure of my english comprehension ;)
Mindiell
----

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Which language to use?
« Reply #19 on: April 16, 2010, 02:29:18 pm »
Quote from: "gsaurus"
then, use phyton  :lol:

Code: [Select]
myAge = 23
myString = "I am " + str(myAge) + " years old"

Use C++ 8)
Code: [Select]
template <typename T>
std::string str(const T& t)
{
    std::ostringstream oss;
    oss << t;
    return oss.str();
}

int myAge = 23;
std::string myString = "I am " + str(myAge) + " years old";
Laurent Gomila - SFML developer

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Which language to use?
« Reply #20 on: April 16, 2010, 04:48:24 pm »
I know Laurent :P For us C++ coders, it's all ok 8) But for a hobbyist programmer phyton is much simpler to learn and use.

But it's all up to you kolofsson, learning C++ is great but will probably make things harder to you. If you have the time and interest on learning and use C++ with SFML for your game, go ahead  :). But if you just want to make a game without many worries, I'd say phyton. Phyton specially if you're used to php and/or javascript, because they all uses dynamic type checking, when C++ uses static typing instead.

I found this comparison article, actually I didn't read it all, but you may find it interesting.
Pluma - Plug-in Management Framework

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Which language to use?
« Reply #21 on: April 20, 2010, 12:38:00 pm »
D is also to be chosen over C++.
But if you are into php you better go with Python or some other high-level language.

Wibbs

  • Newbie
  • *
  • Posts: 40
    • View Profile
Which language to use?
« Reply #22 on: April 30, 2010, 12:58:10 am »
I'm working with SFML and c# and apart from a few minor wrinkles largely to do with my misunderstanding the SFML API, its been extremely straightforward to use.