Do not know were to start!

Apprentice
Posts: 16
Joined: 2008.09
Post: #16
None what so ever!
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #17
Brody McCrone Wrote:None what so ever!

You will want to start with the basics then. The hardest part of getting into programming is understanding how computers like to think and the proper syntax for code. You will learn about things like variables, loops, functions, ect.

Any programming language works great for this. Personally I have a strong belief that people should start with some form of C. Everyone here will have a different opinion of what languages you will want to learn.

No one can tell you exactly where to start we can only point you in the right direction. I hope you have taken a lot away from this thread. I also hope that you stick around, way to often we see people come on ask how to start then we never hear from them again.

Let us know if you have any questions. It is great to have you here.

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2008.09
Post: #18
Can someone give me a link for Open gl and Open al that wont just result in me downloading some wierd stuff that I need an "application to open". Oh , and can you also tell me how to start using Xcode to program the language "C".

Dogs
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #19
You can't use OpenGL or OpenAL until you've learned C -- it'll just be gibberish otherwise. I keep recommending Learn C on the Mac but I don't know how up to date it is. C isn't easy to learn as a beginner, but there isn't anything wrong with taking a stab at it if you'd like to take the dare.
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2008.09
Post: #20
Well how do I get images into my script then? Also I have got xcode and I am board so I am reading a tutorial and doing the examples. How do I "compile" my script? The tutorial says to type gcc (filename) but that does not work!

Dogs
Quote this message in a reply
Member
Posts: 715
Joined: 2003.04
Post: #21
You're in Terminal when you type gcc filename right?
And you are using the file's name? not 'filename'?

There is an extra step i thought to compile and get a binary someone can correct me in case I'm wrong..

lets see
Code:
gcc filename.c -o filename.app

will actually produce something that runs. gcc myfile.c only will just try to compile, giving you errors if it fails.

Again someone can correct me, I get as far as that with hello world in C and either sleep or bleed from the eyes while speaking in tongues.

Oh forgot if this is a command line app then you do
Code:
gcc filename.c -o filename
you should have already cd to the correct directory to accomplish this so all you have to do now is
Code:
filename
and your program should run, else find it and try double clicking, a new terminal window should open and run the program.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #22
That was almost all crap, iGame3D. Only this bit is correct:

igame3d Wrote:if this is a command line app then you do
Code:
gcc filename.c -o filename

after that you'd do
Code:
./filename
to run it.

If you know some C, http://blog.onesadcookie.com/2007/12/xco...orial.html might be enough to get you started with Xcode & OpenGL. If you don't know any C, you probably need to start with something more basic even than that.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2008.09
Post: #23
Hi Brody,

From what I've read you already have xcode installed, compiling using gcc through a terminal is nice and oldschool (I did all my C programming on Windows using text editors and make files for years, I hated the IDEs available) but since you're a beginner you may not want to get bogged down into that sorta thing.

Startup xcode, go to the menu file and then new project.
You get a whole list of options to start with a basic framework, from simple apps to almost working skeletons. Since you're learning the basics you should be trying out some text only apps to learn C. Select "Command Line Utility" and then "Standard tool" and hit choose.
You're now asked to select a directory and name for your project.

You now get the xcode overview window and it will have created some files for you. The only one you are interested in right now is called main.c, open that one.

It should contain something similar if not exactly like:
Code:
#include <stdio.h>

int main (int argc, const char * argv[]) {
    // insert code here...
    printf("Hello, World!\n");
    return 0;
}
This is your whole app, it does the following:

Code:
#include <stdio.h>
Tells the compiler to include the header file stdio.h which contains information that tells the compiler how to call some standard input output functions such as printf that we is used.

Code:
int main(int argc,const char *argv[]) {
Is how a function is defined, in this case the function called main, which every C application has and which is the function that is run when you start your application. This is thus where life of your application starts. argc and argv are parameters sent to this function from outside. Don't worry about them now but you'll need them at some point.

Code:
printf("Hello, World!\n");
Notice that I skipped the line starting with //, that line contains a comment and is ignored by C.
The printf function simply outputs whatever text is send to it to the screen.

Code:
return 0;
Exits the function with value 0, since we're in the main function this ends the program.

Finally there is a } character that matches the { character earlier in our application. Everything between { and } belongs together, in our case, all instructions between our { and } form our main function and thus our whole application at this point.

To run this application you need to compile the application and then execute it. As in the post before you can do this through GCC but with more complex applications this can get hairy and you need to look into makefiles. Luckely we are in xcode and xcode does this for us. Go to the menu Build and select "Build and Run". This compiles the application and runs it. (you can also press the build and go button in the editor window)

Note that if you do not see the output right away, it may have opened the console window in the background, or it isn't opened at all. The console window is where the standard output of an application is sent to. You can open it using the menu Run and selecting Console.

This is a good starting point, you should now have a working C application, a very very simple one, but a working one. You will find many tutorials on learning C programming that give you example code that you can simply paste into this application, build and run to test.

Once you get the basics and move onto actual game programming, then looking into open Gl is a good next step. You can do Open GL programming through a framework called Glut which is great for beginners, it takes away some complexities that you wouldn't want to get into right away.

On Mac you have to remember that you need different include files and add the opengl and glut frameworks, but other then that, there are loads of Glut examples and tutorials online that you can copy and paste into our little console application and they will work right away.

These are two links I found very useful for this:
About Glut and Xcode: http://cit.cs.dixie.edu/cs/cs3600/xcode-glut/
About Glut/OpenGL: http://www.lighthouse3d.com/opengl/glut/

The lighthouse3d contains some excelent tutorials once you've gotten the basics covered.
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #24
If you prefer to get immediately into graphics-games Download Processing, install it (i.e. double click on "Processing-0148.dmg" file, then a "Processing-0148" window will open with a Processing 0148 folder inside, drag that folder in your application folder), then open the folder, run (double click) the Processing 0148 application, then open the examples folder, basics folder, sprite folder, and double click Sprite.pde, a window should appear with some code, press the play button on the top left and you just might have run your first "game".

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Moderator
Posts: 679
Joined: 2002.11
Post: #25
This thread is getting confusing to me. I can only imagine what Brody must be thinking.

Someone mentioned PyGame. I strongly oppose this suggestion. It is harder to install, harder to use, and harder to distribute with your game. Pyglet has the same features (a few more in places, but no joystick support), an easier install/packaging process, and a community that is as helpful as PyGame's if not more so. Pyglet uses OpenGL directly instead of going through SDL, so rotating images doesn't result in lower quality. It is much faster in windowed mode. The programming guide is complete and easy to understand. The design is intuitive. It is essentially my ideal API.

The O'Reilly books on Python are good, but are aimed at people with more experience. The book I linked to earlier teaches both Python and general programming concepts at the same time. The concepts introduced in the book apply to most languages, not just Python, so you can easily change languages later. The first review on the page is a 5-star from John Lasseter, one of my CS idols - I'll paste a quote at the end of this post.

If you just want to "get images onto the screen," get Processing. Read a tutorial. You'll probably get something to work. But you'll be hunting around for bits of knowledge and asking questions instead of following a path that was laid down specifically for people like you.

John Lasseter Wrote:I just wrapped up teaching a semester CS1 course using Zelle's book. I hope I never have to use another book besides this, because this text is simply fantastic.

This was the third version of CS1 I've taught, and the first using Python instead of C. The use of Python definitely contributed to the smashing success of this class (as did an exceptionally strong group of students), but much of the credit must go to this book.

Honestly, Zelle just nailed it. The examples are illustrative and convincing: his is one of the few books that manages to avoid the trap of silly and unreal examples that therefore provide no context for a student. His writing is crystal clear and very well organized, replete with very helpful diagrams and illustrative examples (did I mention the examples?), and he has obviously paid a lot of attention to the aspects of programming that students find most difficult.

My web site - Games, music, Python stuff
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2008.09
Post: #26
This is my problem. It wont let me build and run it.

Dogs
Quote this message in a reply
Moderator
Posts: 3,570
Joined: 2003.06
Post: #27
diordna Wrote:This thread is getting confusing to me.

Not to me. This thread represents *exactly* how I see the situation. This is why it's so hard to get into game programming these days. What may be the best clear path to start from one person's point of view isn't necessarily shared by all.

Programming is a *vast* field and doesn't have one universal entry point. In the early eighties there was basically one practical choice, other than assembly: BASIC. Now you have 50 different forms of BASIC, Python, Ruby, Java, C#, Processing, C, C++, Lua, and on and on and on... As has already been stated: Choose one.

Some of the best ones have already been suggested here: Python, Processing, BASIC (and C when you're ready, or concurrently, if you dare). I think most of us here can agree that those are pretty good suggestions. It couldn't really be any less confusing than that IMHO.
Quote this message in a reply
Member
Posts: 53
Joined: 2007.08
Post: #28
Brody McCrone Wrote:This is my problem. It wont let me build and run it.

What happens when you build and run? Are you getting errors?
Quote this message in a reply
Apprentice
Posts: 16
Joined: 2008.09
Post: #29
When I click the drop down menu all the builds are grey.

Dogs
Quote this message in a reply
Member
Posts: 53
Joined: 2007.08
Post: #30
Are you trying to follow the steps Mux outlined? What kinds of files are you trying to compile?
Quote this message in a reply
Post Reply