Eternity Angel
03-20-2008, 07:48 PM
I use PHP, HTML & JavaScript to make games... well, all my newest ideas would be performed better if they had a way to load, store, and alter graphics on the fly. I looked into Flash, and besides it being expensive for the development software, I just could not make it work (a friend gave me an install awhile back, but if I could have made it work, I would have bought my own). So, I turned to Java.
What I need is a VERY basic guide for explaining everything, or some help here for it.
My questions so far are very basic;
1.) I am used to FUNCTIONS - I can have as many functions per document as I want. When I try to compile hello world examples, they work only if the .java file is named the exact same as the "class" declaration inside it. Does this mean that I can only have one 'class' per file? And if so, how would that even work? Are classes not like functions?
2.) What are all the (what seems to be) unnecessary keywords in classes and stuff? "public class SomeClass extends Applet" -- what is "public"? "extends"? "Applet"? Inside the class, "public void init()" -- what would the 'void' be for?
3.) Is the first class (or if you can only have one per file, the only one) the one that is called when the applet loads...? I don't understand a class being called without me putting something like "$blah = SomeClass(para,meters);"
4.) For the hello world example I have, this is used: "public void paint(Graphics g)" -- is "Graphics" a type or something? Is "paint" something that I can change, like a function within a function?
To be honest, I feel like giving up and working out some sort of JS thing instead, since all of these things are stopping me from understanding what is going on and what I am doing enough to move on and learn more. I rarely can just accept that you need to do X for Y to work -- I need to know WHY you need to do X.
I have never worked with any form of REAL programming language, so if these things are standard across programming languages, then I'm sorry for being naive. Maybe I am just too used to PHP and JS babying me.
What I need is a VERY basic guide for explaining everything, or some help here for it.
My questions so far are very basic;
1.) I am used to FUNCTIONS - I can have as many functions per document as I want. When I try to compile hello world examples, they work only if the .java file is named the exact same as the "class" declaration inside it. Does this mean that I can only have one 'class' per file? And if so, how would that even work? Are classes not like functions?
2.) What are all the (what seems to be) unnecessary keywords in classes and stuff? "public class SomeClass extends Applet" -- what is "public"? "extends"? "Applet"? Inside the class, "public void init()" -- what would the 'void' be for?
3.) Is the first class (or if you can only have one per file, the only one) the one that is called when the applet loads...? I don't understand a class being called without me putting something like "$blah = SomeClass(para,meters);"
4.) For the hello world example I have, this is used: "public void paint(Graphics g)" -- is "Graphics" a type or something? Is "paint" something that I can change, like a function within a function?
To be honest, I feel like giving up and working out some sort of JS thing instead, since all of these things are stopping me from understanding what is going on and what I am doing enough to move on and learn more. I rarely can just accept that you need to do X for Y to work -- I need to know WHY you need to do X.
I have never worked with any form of REAL programming language, so if these things are standard across programming languages, then I'm sorry for being naive. Maybe I am just too used to PHP and JS babying me.