• Lucid Dreaming - Dream Views




    Results 1 to 16 of 16
    1. #1
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4

      C++ for sprite based game?

      Alright, so I just found out about this thing called XNA Game Studio. It's used to make community games for the Xbox. It comes with a beginners tutorial and such, but I think it would help to learn some C++ or C# to help make the game I want.

      Where is a good place to learn C++ or C# to make a sprite based side scrolling game? What kind of books should I look out for?

      I want something specifically for making games. Something that has easy to follow beginner tutorials.

    2. #2
      Motion Personified Alpha Achievements:
      Referrer Bronze 1000 Hall Points Veteran First Class
      mrdeano's Avatar
      Join Date
      Apr 2009
      Gender
      Location
      United Kingdom
      Posts
      1,053
      Likes
      58
      DJ Entries
      1
      http://www.youtube.com/watch?v=tyVhn...eature=channel

      Start there and follow every video. By the end of it you will be a Wizz.
      Too bad there's like 60+ videos all around 9 minutes long.
      Last edited by mrdeano; 08-31-2009 at 09:59 PM.

    3. #3
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935

    4. #4
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      Quote Originally Posted by slayer View Post
      Where is a good place to learn C++ or C# to make a sprite based side scrolling game?
      C++ & C# are two very different languages
      It grates when you bung them together like that

      I mean, C/C++ I can understand (as the two are 80% the same syntax, and while different languages both will probably compile equivalent code down to the same assembly

      but C# isn't even meant to produce binaries
      it's meant to produce byte-code

      Just thought I'd mention it
      (\_ _/)
      (='.'=)
      (")_(")

    5. #5
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by Ynot View Post
      but C# isn't even meant to produce binaries
      it's meant to produce byte-code
      C# produces binaries, I've written many a dll for C# programs running our servers.

    6. #6
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      C# produces binaries, I've written many a dll for C# programs running our servers.
      To quote wikipedia
      "By design, C# is the programming language that most directly reflects the underlying Common Language Infrastructure (CLI). Most of its intrinsic types correspond to value-types implemented by the CLI framework. However, the language specification does not state the code generation requirements of the compiler: that is, it does not state that a C# compiler must target a Common Language Runtime, or generate Common Intermediate Language (CIL), or generate any other specific format. Theoretically, a C# compiler could generate machine code like traditional compilers of C++ or FORTRAN. In practice, all existing compiler implementations target CIL."
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    7. #7
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      Quote Originally Posted by ninja9578 View Post
      C# produces binaries, I've written many a dll for C# programs running our servers.
      Didn't say "couldn't"
      said "not meant to"

      the C# compiler for Linux can compile to binary,
      but if you want to do that, why the hell are you using C#?
      better to use a more mature language, with better optimized compilers, greater library of code available, and wider platform support
      (\_ _/)
      (='.'=)
      (")_(")

    8. #8
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4
      So I should be using C++? Or should I do the OpenGL like Ninja posted?
      Last edited by slayer; 09-01-2009 at 11:33 PM.

    9. #9
      Banned
      Join Date
      May 2007
      LD Count
      Loads
      Gender
      Location
      Digital Forest.
      Posts
      6,864
      Likes
      386
      OpenGL is a library written in C.

      Use allegro: http://www.allegro.cc

      It has built-in functions for loading images, making GUIs, et al.

    10. #10
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4
      The program I'm using is the Visual C# 2008 Express Edition. I got it from http://creators.xna.com/en-US/

      It's used to make community games for the Xbox 360.

      Edit: Does anyone wanna be like my personal tutor? :x

      There's no way I'm going to read all this crap.
      Last edited by slayer; 09-02-2009 at 02:17 AM.

    11. #11
      A Natural The Invisible Man's Avatar
      Join Date
      Nov 2008
      Gender
      Posts
      365
      Likes
      8
      Quote Originally Posted by A Roxxor View Post
      OpenGL is a library written in C.

      Use allegro: http://www.allegro.cc

      It has built-in functions for loading images, making GUIs, et al.
      I wondered if I was the only Allegroite on this forum.


      Can you see me now?

    12. #12
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Allegro is good, but it's largely high level, you can't optimize it to the same level as OpenGL.

      OpenGL isn't a language, it's a library, you use with with C++ or C.

    13. #13
      Member Achievements:
      1 year registered Veteran First Class 5000 Hall Points

      Join Date
      Sep 2004
      Gender
      Location
      Seattle, WA
      Posts
      2,503
      Likes
      217
      To just get into C/C++ programming, check out http://cprogramming.com/

      For basic 2D sprite stuff, I recommend SDL http://www.libsdl.org/ (you can also set up OpenGL through it).

      For openGL, you can go to NeHe like linked earlier, HOWEVER: His code tends to look like crap. But that's for a reason (I don't actually know what the guy's actual production code looks like).

      That's something important to be aware of when reading random/any tutorial online. They write hacky, poorly-laid-out code because they're there to demonstrate how the library works. However, you should never confuse tutorial code for well-designed, scalable, high-quality code. It's usually some piece of shite that is NOT meant to be expanded upon as is.

      Sooooo, to remedy that, don't do what most people do. Most people do this:

      1) Learn language basics (enough to write something that takes input, and prints basic output)
      2) Start learning openGL through NeHe or whatever other tutorial
      3) Decide that they will code a "game engine" laughable

      Instead, do realistic, small projects that you can drive all the way through to completion. When you're more comfortable with code, and moving it around and stuff, read up on design patterns so you start having a better idea of how this stuff should be laid out.

      Also, if you're serious about C++, look up "Effective C++", "More Effective C++" and "Effective STL" by Scott Meyers, who will also give you some fantastic tips on how not to write shitty-ass code.

      Same goes for Java - you should not be doing any serious Java work without skimming through "Effective Java" first.

      (note: all my advice above is more for the point of view where you'll be eventually doing work that you'll distribute and others will have to update, so don't feel discouraged or anything - just know how deep the rabbit hole goes, and don't be too ambitious with your projects too early)
      Last edited by Replicon; 09-02-2009 at 04:06 PM.

    14. #14
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4
      Ok well, so far, I've managed to draw my own background.

      Next I'm going to learn how to make a person on the screen and move him around with the arrow keys.

      Then I'm going to try to add blocks with collosion and then add gravity.

      Edit: Yay I made a square :3

      How would I make the square tile across the bottom of my screen?
      Last edited by slayer; 09-02-2009 at 08:21 PM.

    15. #15
      Member Needcatscan's Avatar
      Join Date
      Sep 2005
      Gender
      Posts
      602
      Likes
      0
      Quote Originally Posted by slayer View Post
      Ok well, so far, I've managed to draw my own background.

      Next I'm going to learn how to make a person on the screen and move him around with the arrow keys.

      Then I'm going to try to add blocks with collosion and then add gravity.

      Edit: Yay I made a square :3

      How would I make the square tile across the bottom of my screen?
      Did you decide on a language?

      BTW, easiest collision detection if you are using C# is using the Rectangle Struct and the IntersectsWith function.
      Quote Originally Posted by Photolysis
      If rational arguments worked on people who were religious, there'd be no religion.

      Trying to reason with dogma is not renowned for its results.

    16. #16
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Pixel collisions is easiest.

    Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •