2017-09-19 02:39:28

Hello.
I had planned to learn java so that I could then learn how to develop for android. I haven't given up on that idea, but I'm having some technical difficulties. I was thinking about learning ruby since it looks easy enough. Is it worth all the time and work to learn ruby? Can I use it to make audiogames? I can understand programming concepts and I know a little bit of python. The only reason I'm not continuing with python is I'm a little annoyed with python's indentation. I like the syntax I just wanted to try something new.
Thanks.

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2017-09-19 18:23:57

I don't think Ruby is the best for audiogames. I've found that interpreted languages (or languages that are compiled into some kind of bytecode to be executed on a VM of sorts) run far slower than a native application that doesn't have such a complexity. I'd recommenc C++ -- it's not as difficult as people make it out to be. I'm certainly starting to enjoy it at least. Here's how you might read/write a configuration file in C++ with Boost.PropertyTree:

#include <boost/property_tree/ptree.hpp>
#include <iostream>
#include <string>
// We include the different parsers to demonstrate the
// different formats.
// You don't need to include all of these unless
// your writing a multi-language configuration
// database
#include <boost/property_tree/info_parser.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/json_parser.hpp>
using namespace std;
using namespace boost::property_tree;
int main () {
try {
// Initialize the property tree to hold our configuration
// data
ptree pt;
// Then we use pt.put to add our entries:
pt.put ("version", 1.0);
// Or we can add an indefinite number of sections and
// sub-sections and so on:
pt.put ("libloader.loader.libs", "libgl");
// Or even:
pt.put ("this.is.a.very.long.section.that.descends.to.the.key.1.which.is.defined.as", 1);
// Now, write it in the different formats.
// All writers follow the syntax: write_lang (filename, property_tree_object).
info_parser::write_info ("test.info", pt);
xml_parser::write_xml ("test.xml", pt);
json_parser::write_json ("test.json", pt);
// We leave this for last since it throws an exception.
ini_parser::write_ini ("test.ini", pt);
} catch (exception &ex) {
cerr << "Error: " << ex.what() << endl;
return 1;
}
return 0;
}

The resulting output is as follows:
test.info:

version 1
libloader
{
    loader
    {
        libs libgl
    }
}
this
{
    is
    {
        a
        {
            very
            {
                long
                {
                    section
                    {
                        that
                        {
                            descends
                            {
                                to
                                {
                                    the
                                    {
                                        key
                                        {
                                            1
                                            {
                                                which
                                                {
                                                    is
                                                    {
                                                        defined
                                                        {
                                                            as 1
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Ini:

version=1
[libloader]

JSON:

{
    "version": "1",
    "libloader": {
        "loader": {
            "libs": "libgl"
        }
    },
    "this": {
        "is": {
            "a": {
                "very": {
                    "long": {
                        "section": {
                            "that": {
                                "descends": {
                                    "to": {
                                        "the": {
                                            "key": {
                                                "1": {
                                                    "which": {
                                                        "is": {
                                                            "defined": {
                                                                "as": "1"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

XML:

<?xml version="1.0" encoding="utf-8"?>
<version>1</version><libloader><loader><libs>libgl</libs></loader></libloader><this><is><a><very><long><section><that><descends><to><the><key><1><which><is><defined><as>1</as></defined></is></which></1></key></the></to></descends></that></section></long></very></a></is></this>

As for gaming libraries in C++, I'd highly recommend SFML and SDL. SFML is written in C++ and SDL is written in C. Both can be used together and work very well. (I know I posted something that was irrelevant to the question at hand; I wanted to dispel the notion that interpreted languages are good with games, as it seems like some people have that. In truth, their not really suited to such a task: every line is compiled as the program is executed (in the context of Python or Ruby), so this drastically slows down gameplay for the users, and (in the case of Java) it's very really to reverse engineer -- far easier than C++ code is, at any rate. And unless you like your code being option to the world, Python and Ruby are not the best languages for writing games or shareware products.)

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2017-09-21 01:55:42

Hi Ethin.
Thanks. Thanks for the code sample, I like the way c++ syntax works.
What do you think about c#? I looked at that the other day and it looks easy enough. Actually, I was wondering if there is a free version of visual c#? I have an old copy on my computer but I can't run c# code because it wants me to register. I don't want to buy something I haven't even tried yet. Could you post a link to a free copy of visual c# if there is one? I went on microsoft's website for that but it takes me forever to sort the versions and things. I have a 32-bit windows 7 machine if that helps. I'd appreciate it.
Also do you have any experience on making apps for android? I'd be interested to hear your thoughts on that. I'm interested in making games for both windows and android. Somebody mentioned to me that c# can make android apps is this true?
Thanks.

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2017-09-21 18:19:27 (edited by Nuno 2017-09-21 18:21:18)

You can download Visual Studio community from This URL

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com