Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

101 Neutral

About Grundoko

  • Rank

Personal Information

  1. I'm loving C++ so far in that it's complex, but logical. With other languages I memorized functions, but with C++, it's not just memory, each time I practice writing code in it, I get a better understanding of what I'm doing. Last night I spent the entire night playing with classes, trying to figure out inheritance of subclasses, and such. I wanted to make it so that every object was a subclass to a superclass, and is given an id upon creation. (So that multiple objects of a single class could be distinguished.) I'm sure there are several ways to do this. I'm bound to figure something out sooner or later
  2. Thanks for the tip Randi. I am however, willing to put in the extra effort to create cross-platform games. At this point, it's as easy as recompiling for the other system, though in the future I'm sure it will require os checks, and running specific code for each platform, when os-dependant code is required. And I appreciate the advice Hiiri, I'm working on a naming convention, but it's difficult to do so when I don't fully understand the language. In Game Maker I used obj_* for objects, and spr_* for sprites. I should probably do something similar in C++, cl_* for classes maybe. And I found the issue with my code in post #9, thanks to Tank on the SFML IRC. As it turns out the class player is outside of the main scope, so when it looks for "App", it finds the variable that was initialized in line 3, but never used. Here's my new code. http://codepad.org/5mHlwSnt
  3. I want to write applications for Linux, Windows, Mac, Android, and iOS. For the time being, I'm writing applications for my platform of choice, Linux, because that's what I run, and that's what I'm testing on. What I'm saying is that I'm not going to install Windows, just so that I can write applications for a platform I'm not going to use, using tools I'm not going to use.
  4. 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.
  5. My favorite C++ IDE for Linux is CodeBlocks, though CodeLite is also an option. Both should be in the repositories of any modern distro. (CodeBlocks was just recently added to the Debian Repos.) If you're looking to do Python programming, you can use any text editor, like Gedit, which has syntax highlighting. Personally, I used Geany for Python, just for the simple convenience of having a button to execute the file. It also has a bunch of plugins to help you do whatever it is you're doing. As for setting up, for Python, you really don't have to do anything. Every modern Linux distro comes with Python pre-installed, and since Python is an interpreted language, all you need to do, is write the code in a ".py" file, and then execute it by opening a terminal and typing (for example if your file was called main.py) "python main.py". Python is a very easy language to get started with, thought its syntax is a little different from most other languages. As for C++, you'll need to install G++ from the repositories, which is the Gnu C++ Compiler. In Debian, or a Debian based distro (like Ubuntu), this can be installed by opening a terminal and typing "sudo apt-get install g++". Or of course in Synaptic or the Ubuntu Software Center. C++ for Dummies is actually a fairly well written beginner's guide to C++ programming, and it's not operating system specific. All of its examples use Code:Blocks as the IDE, and so if you're using Code:Blocks as your IDE on Linux, it tells you how to use the IDE. Mind you, it only teaches command-line examples. But you'll want to learn those basics before moving on to anything else. Once you've learned the basics, you can go on to use a library like SFML to get input, draw to the screen, play sounds, etc. Or for 3D, you could use OpenGL.
  6. 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.)
  7. A 2D API would be nice. I'm not ready to jump right into the third dimension at this point, but thanks!
  8. 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!
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!