I
ineedyourluvin1
Hello ! I've been programming in Java for about a month now and
have made much progress. Especially with Applets. So my
goal is to become a internet game programmer. You know, games
on the browser and the cellphone. In any case I've got lots of
programming experience in general with C++, VB, etc... The
thing that is hardest for me to understand is as follows :
1.) Base classes
2.) Base class implementation
3.) Derived classes from the base classes
4.) Polymorphism (does'nt that deal with the Base Class +
Implementations ? ?)
That is the first thing. The second thing is finding good examples
on the internet . I've been hacking at it for a couple days now.
I just want to make a circle appear on the screen and move it.
I make a Base Class :
///////////////////////////////////////////////////////////////////////////////////
import java.awt.*;
import java.awt.event.*; // I add many more imports anyway
import java.util.*; // by habbit......
public abstract class shape {
public abstract void setColor(Color c);
public abstract Color getColor();
public abstract move(Integer x, Integer y);
public abstract void draw(Graphics g);
}
OK ! So there is my abstract base class .
So, how would I implement something like this ??? There is a
Graphics and a Color object that caused problems while I was
hacking and this whole thing is stalling me out ! If someone can
show me a clean way to do this with 1,2,3, and 4 listed above,
I'd love it
Then I'd be able to get this show on the road with developing
games........... I can already write Applets and make them
work in my browser. They seem dirty in a way and I KNOW
better programming techniques are being used more commonly.
Like the list above (1,2,3, and 4) most likely!
I've gotta clean it up and make my Applets more extensible.
Thanks Much ! ;-)
have made much progress. Especially with Applets. So my
goal is to become a internet game programmer. You know, games
on the browser and the cellphone. In any case I've got lots of
programming experience in general with C++, VB, etc... The
thing that is hardest for me to understand is as follows :
1.) Base classes
2.) Base class implementation
3.) Derived classes from the base classes
4.) Polymorphism (does'nt that deal with the Base Class +
Implementations ? ?)
That is the first thing. The second thing is finding good examples
on the internet . I've been hacking at it for a couple days now.
I just want to make a circle appear on the screen and move it.
I make a Base Class :
///////////////////////////////////////////////////////////////////////////////////
import java.awt.*;
import java.awt.event.*; // I add many more imports anyway
import java.util.*; // by habbit......
public abstract class shape {
public abstract void setColor(Color c);
public abstract Color getColor();
public abstract move(Integer x, Integer y);
public abstract void draw(Graphics g);
}
OK ! So there is my abstract base class .
So, how would I implement something like this ??? There is a
Graphics and a Color object that caused problems while I was
hacking and this whole thing is stalling me out ! If someone can
show me a clean way to do this with 1,2,3, and 4 listed above,
I'd love it
Then I'd be able to get this show on the road with developing
games........... I can already write Applets and make them
work in my browser. They seem dirty in a way and I KNOW
better programming techniques are being used more commonly.
Like the list above (1,2,3, and 4) most likely!
I've gotta clean it up and make my Applets more extensible.
Thanks Much ! ;-)