BramVandenbon
Oct 3rd, 2004, 06:00 AM
Hi
I am new to java.
That is I had 3 lessons so far.
- I know what Swing is and can make swing windows, ...
- I have a big C# background
For a schoolproject I will make a Super Mario game clone.
I do not have the time to use special classes like Direct Draw, OpenGL, ... The project needs to be finished within about 2-3 weeks
I have not started yet and I am allready stuck with 4 questions.
My vision:
I need a level: small images in a kind of table.?!
and
I need a player class:
public class Player extends ?...? {
public Player(){
...loadimages in array;
}
left {
...change the position in the frame that contains this object;
... change image;
... change it back;
}
right{
}
jump{
}
crough{
}
}
Note that the Player visual object needs to move on top of the level ...
So here are my 4 questions:
(1) What class should I extend with my Player class. Should I extend the JPanel class?
(2) What is the best way to load my images. (depends on the answer of question 1 I guess)
(3) How do I change the position of a class in the containing class.
(4) What about my level images ... is there a kind of table class in Swing ?
Can anybody give me a clear answer on my questions ?
(please do not post codelistings of more than 50 lines ^^.)
Thank you in advance
I am new to java.
That is I had 3 lessons so far.
- I know what Swing is and can make swing windows, ...
- I have a big C# background
For a schoolproject I will make a Super Mario game clone.
I do not have the time to use special classes like Direct Draw, OpenGL, ... The project needs to be finished within about 2-3 weeks
I have not started yet and I am allready stuck with 4 questions.
My vision:
I need a level: small images in a kind of table.?!
and
I need a player class:
public class Player extends ?...? {
public Player(){
...loadimages in array;
}
left {
...change the position in the frame that contains this object;
... change image;
... change it back;
}
right{
}
jump{
}
crough{
}
}
Note that the Player visual object needs to move on top of the level ...
So here are my 4 questions:
(1) What class should I extend with my Player class. Should I extend the JPanel class?
(2) What is the best way to load my images. (depends on the answer of question 1 I guess)
(3) How do I change the position of a class in the containing class.
(4) What about my level images ... is there a kind of table class in Swing ?
Can anybody give me a clear answer on my questions ?
(please do not post codelistings of more than 50 lines ^^.)
Thank you in advance