|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
billiard table
Hi, I'm a university student and a begginer java user in a CSC course. First 5 or 6 assignments were very easy, so I started slacking a bit I suppose, but now it's caught up with me because I have no idea what I'm doing for this assignment. The assignment is to create an applet in which a billiard ball bounces against the walls of a 2D billiard table. This might seem simple to some of you, but is a big step up from the other programs such as printing out a list of prime numbers or drawing a checkerboard which we have been assigned.
In the assignment description it gives us this hint to get started: public class BilliardTable { private Color tc; private int tx, ty, tw, th; public BilliardTable (Color tc, int tx, int ty, int tw, int th); public void draw (Graphics g) public Color getTableColor () public int getTablex () public int getTabley () public int getTablew () public int getTableh () } //BilliardTable class And I'm thinking that we're supposed to create a BilliardTable class, a BilliardBall class and a Billiards Applet. I tried: public class Billiards extends Applet { public void paint { this.tc = tc; this.tx = tx; this.ty = tx; this.tw = tw; this.th = th; g.setColor(tc); g.fillRect(tx, ty, tw, th); } //paint } // Billiard Applet As you can probably see, I really don't know what I'm doing, which would explain the 10-15 compiler errors... So I'm wondering, do I draw my table in the Applet part? or the "public void draw (Graphics g)" part from the hint? Anything would help and would be greatly appreciated, and thankyou for having patience with a beginner. ![]() |
|
#2
|
|||
|
|||
|
there's no one who can help? I'm not asking anyone to do my assignment for me, just a hint or anything to get me started, thanks.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > billiard table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|