Public Group

# Beginner programmer looking for advice/introduction

This topic is 2435 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey, I've been aspiring to be a game developer probably since I was around 10. I'm currently 17, though I'll be 18 in under a month. Around the age of 12, I began delving into Game Maker, initially with the drag and drop block system, but later turning to the GML language. After a few years of using it, I got to a point where I could do practically whatever I wanted with the language (with the exception of networking and 3D, mostly because I never really bothered).

However, when I decided it was time to move on to a more serious language, I was baffled by the amount of choices, but eventually decided on C++. (This was probably around the age of 14, thought I'm hazy with timing). I've since played with a few different languages, but only just scratched the surface. The only one I've gotten anywhere with has been C++, first with SDL and more recently with SFML, which I find much easier to use.

Anyway, I've been slacking, and I've barely touched any code for the past year or so, and I'm now trying to hop back into it, as I hope to persue game development as a career. (Or at least a hobby if worst comes to worst). And so I've been working with C++ again, I'm not sure if it's age, or just looking at it more seriously, but things are making a lot more sense to me. But there's one thing that's been troubling me, and I'd like to get some input. When looking into anything on this topic, the majority of people put C# above C++ in terms of game development, because it's simpler, and compiles faster, and is worth the slight performance reduction, for the development speed increase.

Now here's the thing, I want to write my apps to be cross-platform, and C# with XDA doesn't allow me to do that, besides, I'm a Linux (Debian) user, and cannot use the .NET framework. I've played a little with Mono, however there is very little in the way of tutorials on libraries like SFML or SDL with Mono. According to more recent benchmarks, Mono is up to par with .NET in terms of performance in most situations, and even beats it in some, however beginner tutorials are not really available. And I'm not sure just how compatible it is with .NET C# code, I don't really want to follow a C# tutorial and find out I'm doing everything wrong. (I very well could be screwing everything up in this paragraph, because I really don't know much about C# and Mono at this point).

So anyway, my question is, is it worth using C# with Mono over C++? And if so, what is a comparable library to SFML that I can use with C#?

Thanks for the help guys!

##### Share on other sites
Axiom3D is an open-source, cross-platform 3D API for C#, so that might be one solution for you. It's based on the OGRE rendering engine (actually I think it's quite direct port), so there should be lots of tutorials available.

##### Share on other sites
A 2D API would be nice. I'm not ready to jump right into the third dimension at this point, but thanks!

##### Share on other sites

A 2D API would be nice. I'm not ready to jump right into the third dimension at this point, but thanks!

Don't worry, you can do 2D stuff with it as well. Actually, it's usually much more efficient to make 2D stuff with 3D engine by using orthographic projections.

##### Share on other sites
Do you really need to use Linux? Game development is mostly done on Windows.

Wouldn't it be easier to set up a Windows box (it could even run on a VM or dual boot) just for your game development needs?

##### Share on other sites
alnite, if one intends to write fully cross platform applications, wouldn't one want to use the platforms in which they wish to develop for? I don't *need* to use Linux. I use Linux by choice, because it's my preferred system. Your comment is really irrelevant to my question.

And thankyou Manabreak, I appreciate the tip. I'll check out Axiom3D.

Another question I have; is .NET C# code fully compatible with Mono C# code. If I did a C# tutorial, would it work for Mono C#? (With the exception of most libraries, which I assume don't work under Mono.)

##### Share on other sites
Most of .NET works in mono (see http://www.mono-proj...m/Compatibility).

The main issue is when stuff outside of .NET is used:
-Sometimes code will call some of the Windows stuff (plain C functions or COM objects, usually if .NET doesnt expose the specfic OS functionality). Naturally Linux doesnt have these, so the code will fail. However Linux is likly to have equivlant API's, so I guess you can detect OS at runtime to use the correct code.
-Projects which are partially made up from native code (e.g. graphics). Some of these may have Linux builds, which you may be able to use esaily. If the .NET wrapper used C++/CLI to provide the native<->.NET transitions however I believe you are out of luck (http://www.mono-project.com/CPlusPlus)

Of course this can be avoided with projects written with .NET and Mono in mind.

##### Share on other sites
Howbout using Java? I know the word Java seems like unholy to most people, especially when it comes to game programming, but with modern computers and opengl being upgraded a lot since 2.0 (another unholy word), etc.... I think Java could be one possible solution for crossplatform game programming. There is even pretty good free game engine, that holds very little restrictions to my knowledge in the terms of usage, called jME3: http://jmonkeyengine.org/ .

##### Share on other sites
Thanks for all the advice guys. I think I'm going to keep going ahead with C++ and SFML for the time being, and likely do some Java in the future (to get a head start, because my computer science course begins with Java). If things don't go well with C++, maybe I'll fall back to Mono/C#, and come back when I've got a better feel of the fundamentals, but for right now, C++ feels good.

So I suppose my final question would be, where could I go to get advice on small code problems? Some things just seem too trivial to make a dedicated thread about them here. Is there a section here for simple code troubles?

 #include <SFML/Graphics.hpp> #include <iostream> sf::RenderWindow App; using namespace std; // Define Classes class player{ private: bool visible; int x; int y; int height; int width; public: player(){ x = 30; y = 70; width = 30; height = 30; } void Draw(){ App.Draw( sf::Shape::Rectangle( x, y, x+width, y+height, sf::Color(180, 180, 180) ) ); } void SetPosition(int newx, int newy) { x = newx; y = newy; } }; int main() { // Create Objects player obj_player; // Create the game window. sf::RenderWindow App( sf::VideoMode(640, 480, 32), "dropBlox" ); // Start game loop. while ( App.IsOpened() ) { // Process Events. sf::Event Event; while (App.GetEvent(Event)) { // Close the game when exit button pressed, if (Event.Type == sf::Event::Closed) { App.Close(); } } // Clear Screen App.Clear(); // Draw Objects obj_player.Draw(); App.Draw( sf::Shape::Rectangle( 90, 90, 120, 120, sf::Color( 200, 200, 200 ) ) ); // Update Screen App.Display(); } } 

My issue right now, is that envoking obj_player's Draw function, doesn't draw anything on the screen, whereas writing the same thing directly does.

##### Share on other sites

alnite, if one intends to write fully cross platform applications.... (snip)

Stop right now.

Writing a fully cross-platform app is difficult; incredibly difficult. This should be the least of your concerns at the level you're at now. You'll have a much easier time of it if you focus on a single platform and get the best you can done with that. Get that under your belt 3 or 4 times and you'll be ready to start looking at fully cross-platform; you have enough to be getting on with learning without throwing extra complexities into the mix.

1. 1
Rutin
61
2. 2
3. 3
4. 4
5. 5

• 12
• 10
• 28
• 20
• 9
• ### Forum Statistics

• Total Topics
633412
• Total Posts
3011751
• ### Who's Online (See full list)

There are no registered users currently online

×