My First Computer Program!
giacomopoppi
Member, PRO Posts: 914
Hi guys! The past couple of days i have been learning C language and i have just finished my first computer program. well... really it is just a console program but i think i consider it a computer program... right?
Anyway, it is a simple game and the aim is to guess a number between 1 nd 1000 with the least tries possible. if you want to try it out it can be downloaded here:
http://www.2shared.com/file/2OLq3q1n/Guess_The_Number.html
I am only 14 so i think it is quite good!!
P.S. i know this post isnt related to GS it was just something i would like to share
Anyway, it is a simple game and the aim is to guess a number between 1 nd 1000 with the least tries possible. if you want to try it out it can be downloaded here:
http://www.2shared.com/file/2OLq3q1n/Guess_The_Number.html
I am only 14 so i think it is quite good!!
P.S. i know this post isnt related to GS it was just something i would like to share
Comments
do you think i should finish learning properly c language or pass directly to Obj-C (or another object orientated language)?
so it is a good idea to have a fairly solid understanding of it.
Objective-C is built on top of C. It is what is known as a "superset".
Cocoa is is a superset of Objective-C.
Cocoa Touch is a subset of Cocoa.
Then there's C++, another object-oriented superset of C.
It can all be pretty daunting!
I think what you are doing with this little game demo is great!
I think that is the best way to learn a new language.
I would keep on making little demos.
And eventually try to link a few together.
Learn these little building blocks.
Eventually you will be able to put things together into larger projects.
also:
:S i have never understood pointers tho.... i mean... why do we need them?
It has no standard routines for graphics, for example.
Making a full game with GameSalad and submitting it to the App Store, and then starting with C and making "Hello World", can certainly seem a little backwards and be frustrating!
You said that you are following along with a book. I think that is great. I think it is fine to start anywhere that interests you. Get some understanding, then delve deeper.
@arton: I actually can't program C or C++ or Obj-C. I understand the basics, and I have 200$ of books sitting here, but I actually haven't made anything yet. Just little stuff here and there.
I am generally what you would call a "scripter". I have been writing Actionscript in Flash for ten years now. I LOVE scripting.
Everything you do in GameSalad is considered scripting. It doesn't really matter if you type it or use drop-down menus.
It's all in how you look at it of course, but generally a programmer would create a program like GameSalad, and a scripter would make something WITH a program like GameSalad.
Flash is very similar.
In Flash I have a thing called a movieclip. In GameSalad I have a thing called an Actor.
I (and everybody else who uses gamesalad) scripts the game logic. We script the Actor's behaviors. How they move. What happens if I click on them, what if they collide with another Actor? etc. etc.
That is all called scripting.
How the Actor actually interprets the scripts that I write, how it manages memory, displays images, etc., How the Actor actually works, its guts - that is what programming is.
I love game design, art, and stuff like that. I do not care about frame buffers, blitting pixels, memory management, garbage collection, etc. etc. I HATE that stuff. My eyes glaze over when I think about it.
I just want to work on the gameplay!
It all comes down to what you enjoy.
It's just really hard to remember everything :S
It acts sort of like a bookmark.
But that is a shabby explanation. A programmer could probably give you a better answer.
Here is the wikipedia definition:
http://en.wikipedia.org/wiki/Pointer_(computing)
Those first couple of paragraphs are a perfect example of why I don't like programming!
(and that illustration is no help!)
I am much more interested if an Actor's rotation is correct, or if I'm using the correct trig calculation, or if an animation looks better at 12 frames per second vs. 13 frames per second...
I simply do not care if its memory allocation is correct!
http://mycodeteacher.com/
It is objective c for iphone and very friendly. I did this for 2 months prior to gamesalad and made half a childrens story book app (in retrospect the app is really crap).
The whole of mycodeteacher courses can be accessed for only $10, which is pretty good. You can download the source code to each lesson for xcode and they always try to teach you to actually make something in each lesson.
You have to repeat lessons over and over again until you understand them properly, no way you can watch them once and fully understand it. I got about a quarter of the way through in 2 months (with some actual understanding, I could have watched all the lessons in a couple of days). For me I gave up as I know I am quite results orientated, my results looked super crappy (to be expected) and I found it was like learning a foreign language in that I kept forgetting stuff from one day to the next. If I were to move on from gamesalad I would definitely not try to learn objective c.
My recommendation is that if you want to learn to program then maybe look at learning to use cocos2d for iphone, it is a game engine for 2d games that actually uses objective c instead of a scripting language. Fine to move on to after objective c, but why not learn it in connection with cocos2d. Personally I don't want to learn obj c that much and would look at learning corona or itorque 2d scripting.
MAYBE i have managed to understand it a bit better with your explanation Joe.... so what you need them for... is to save allocating space in the memory? or to have faster access to a variable?
The thing i dont understand is why on earth we have to point to the MEMORY of a computer?? why would i want a number like 1135476bit to be remembered?
I really dont like pointers.... could a programmer code without them???
http://publications.gbdirect.co.uk/c_book/chapter5/pointers.html
My games actually make more money than my regular job, which is nice!
I agree with what StusApps says above. Cocos2D is a nice collection of Cocoa Touch game programming libraries, written in Obj-C.
It's a nice middle ground between writing something from scratch or using something like GameSalad.
Games all basically need the same stuff. You need Scenes. You need Actors or sprites, You need animation. Sound. Collision. Physics. Logic. etc. etc.
You can either create all that yourself, or you can use libraries of code that other people have written.
It depends how much control you want.
In the old days (15 years ago!) you didn't have a choice. If you wanted something, you had to create it from scratch.
Now, with things like Flash, GameSalad, GameMaker, Unity, Corona, Torque, Director, RunRev, etc. etc. you are able to use high level scripting languages to create software. And computers and devices keep getting faster and faster.
These programs eliminate the barriers of entry for creative people. I think it is so awesome.
my brain is hurting.
stupid pointers....
Thanks for your help anyway Rob2 and Joe
@StusApps Yeah, that site could help eventually when i start to try out to program iphone apps, but right now i need to concentrate on the basics... thanks anyway
I strongly advise these books for learning:
http://www.amazon.com/Learn-C-Mac-Dave-Mark/dp/1430218096 - C language
http://www.amazon.com/Learn-Objective-ndash-Mac/dp/1430218150 - Obj-C
then there are other books of the series which teach different stuff (there is one also for programming for iphones and ipads.)
if anyone wants these books just ask and i will upload them (i have the ebooks). i am learning from these, they are for the "real beginners" :P
Personally I don't want to know about that stuff. I don't enjoy it as much as making the game logic.
I depend on people like Gendai to take care of that stuff for me. Because of that I am at their mercy. If the memory is leaking somewhere I cannot fix it. I have to wait for them.
On the other hand, I was able to make Danger Cats! in eleven days...
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
I started in 95 as a Lingo Programmer (Macromedia Director) and love scripting as well.
Thanks for the link. It was fun.
Jessica Leahy
http://CollectWealth.ws