Page 1 of 3 123 LastLast
Results 1 to 20 of 50
  1. #1
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default I'm not sure how to get started here...game

    so my final project for my java class, has been set to make a game. I thought that something like a question and answer type game would be cool....the generalize version of it...


    "Math Doors"

    -have a window
    -window has 4 doors placed at specific places based on windows height and width
    -textbox above the doors that holds a question (equation/ symbol etc...)
    -***maybe a clock in the upper right hand corner that animates "ticking" ...30 second time limit***
    -Doors each hold an answer choice (1 correct, 3 wrong ) that corresponds to the question that was asked in the textbox.
    -mouse is used to choose door
    -when mouse passes over the door, it highlights the door
    -when clicked on the door, next frame shows door open
    -if door with correct answer is chosen, there will be a gem behind it
    -gem = 100 points, wrong answer = -50 points, 1 chance per round.


    So I'm not too sure where to get started here, and am not very comfortable with my learned programming skills (kind of rushed through some topics) I've looked through tutorials and other codes, but it's somewhat confuses me because I'm mainly trying to relate it to this.


    so my layout

    -have a window
    (check, window made with height 1200, width 750)


    -window has 4 doors placed at specific places based on windows height and width
    (I'm not sure if I can literally just DRAW these doors (which I have done as:

    g.setColor(Color.WHITE); //outline of door
    g.drawRect (20, 371, 200, 350); //Door 1 placed at 20, 371 and has width 200, height 350
    g.setColor(Color.red); //Make color red
    g.fillRect(20, 371, 200, 350); //Fill Door1 with that red color

    Would this be what I need to do? or would I need to specifically make objects named Door1, door2 etc...and set their parameters to exact coordinates? and If so, how can I do that?

    I'm just going to start with this topic, take it step by step....Hopefully I can get some help here, and then continue on.

    Thanks in advance :)

  2. #2
    Join Date
    Apr 2013
    Posts
    41
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Are you allowed to use external library's?
    I mean you dont need to.. but if you can then use slick and lwjgl. it will make it much easier.
    I think it would be easier to use Images, then when clicked you just switch to the other image.
    All you would need is 4 images; a door, a door open with nothing, a door open with a gem and a yellow rectangle that goes around the door when mouse is over top.

  3. #3
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by leeroijenkiins View Post
    Are you allowed to use external library's?
    I mean you dont need to.. but if you can then use slick and lwjgl. it will make it much easier.
    I think it would be easier to use Images, then when clicked you just switch to the other image.
    All you would need is 4 images; a door, a door open with nothing, a door open with a gem and a yellow rectangle that goes around the door when mouse is over top.
    slick2d? yeah I believe I can use that, but I have no idea how to work it. I remember my prof saying it was a bit confusing to get started...
    lwjgl..never heard of it, but I'll look that up. The easier the better! lol

  4. #4
    Join Date
    Apr 2013
    Posts
    41
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    go here and watch these tutorials; it will only take about an hr of your time and it will save you alot of time and frusteration.
    Java Game Development with Slick - 1 - Setting Up the Project

  5. #5
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Brought it up to my prof today, to no avail. He banned the used of slick2d because it would be "too easy" He said no slick2d and no applets...drat!

    So I guess I'm just stuck to using normal Java methods and gui's

    well...I'll post what I have here so far and see if you guys can help me out a bit more

    -have a window (check)


    Java Code:
    /**
     * @author John
     */
    public class Math_Doors extends JFrame{
    
        private int SCREEN_WIDTH = 950, SCREEN_HEIGHT = 750;
        
        Math_Doors(){
            initJFrame();
        }
        
        public void initJFrame(){
            add( new Board());
            setTitle ("Math Doors");
            setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
            setResizable(false);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setVisible(true);
            setLocationRelativeTo(null);
        }
        
        public static void main(String[] args) {
            
            new Math_Doors();
        }
    }

    -window has 4 doors placed at specific places based on windows height and width (check)

    Java Code:
    public void paint(Graphics g){
            super.paint(g);
            g.setColor(Color.WHITE);
            
    
        g.drawRect (20, 371, 200, 350);          //Door 1 RED!
        g.setColor(Color.red);
        g.fillRect(20, 371, 200, 350);
    
        g.setColor(Color.BLACK); //Doorknob 1
        g.drawOval(180, 533, 25, 25);
        g.setColor(new Color(255, 215, 0));
        g.fillOval(180, 533, 25, 25);
    
        g.setColor(Color.WHITE);
        g.drawRect(250, 371, 200, 350);            // Door 2 BLUE!
        g.setColor(Color.BLUE);
        g.fillRect(250, 371, 200, 350);
    
        g.setColor(Color.BLACK); //Doorknob 2
        g.drawOval(409, 533, 25, 25);
        g.setColor(new Color(255, 215, 0));
        g.fillOval(409, 533, 25, 25);
    
        g.setColor(Color.WHITE);
        g.drawRect(480, 371, 200, 350);             //Door 3 GREEN!
        g.setColor(new Color(34, 139, 34));
        g.fillRect(480, 371, 200, 350);
    
        g.setColor(Color.BLACK); //Doorknob 3
        g.drawOval(638, 533, 25, 25);
        g.setColor(new Color(255, 215, 0));
        g.fillOval(638, 533, 25, 25);
    
        g.setColor(Color.WHITE);
        g.drawRect(710, 371, 200, 350);             //Door 4 BLACK!
        g.setColor(Color.BLACK);
        g.fillRect(710, 371, 200, 350);
    
        g.setColor(Color.BLACK); //Doorknob 4
        g.drawOval(867, 533, 25, 25);
        g.setColor(new Color(255, 215, 0));
        g.fillOval(867, 533, 25, 25);
        }

    -textbox above the doors that holds a question (equation/ symbol etc...)

    I'm not really sure how to do a textbox type thing because everything I'm reading about is a table or a user input. So I was just thinking of making my String just appear up above my doors...like

    Java Code:
    String clue = ("These Will Be Your Clues");
    g.setColor(Color.BLACK);
    Font text = new Font("Serif", Font.PLAIN, 30);
    g.setFont(text);
    g.drawString(clue, 300, 150);
    So far is this looking good? I'll take any advice.....like better advice to do my doors, or better advice for a textbox.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: I'm not sure how to get started here...game

    Don't override paint().
    It should be paintComponent() you override...that's a basic Swing thing.
    Also, no point extending JFrame, just create a normal JFrame and extend JPanel so you can do your drawing as above...call it something sensible, like DoorPanel.

    Now, you can add the JPanel to the JFrame.

    For your doors, if you look at the code you'll see all your doors are identical except for their colour and x position. You may as well write a single piece of code (I'd suggest a Door class, but that's up to you) that does that work.
    Please do not ask for code as refusal often offends.

  7. #7
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by Tolls View Post
    Don't override paint().
    It should be paintComponent() you override...that's a basic Swing thing.
    Also, no point extending JFrame, just create a normal JFrame and extend JPanel so you can do your drawing as above...call it something sensible, like DoorPanel.

    Now, you can add the JPanel to the JFrame.

    For your doors, if you look at the code you'll see all your doors are identical except for their colour and x position. You may as well write a single piece of code (I'd suggest a Door class, but that's up to you) that does that work.

    Okay, just my prof in all his examples only overrode paint() rather than paintComponent()

    Java Code:
    public void paintComponent(Graphics g){
            super.paint(g);
            g.setColor(Color.WHITE);
    So theres that

    And you're saying to make a separate class for Doors...okay lets see...should I do something like

    Java Code:
    public class Doors {
    
        int x1 = 20;
        int x2 = 250;
        int x3 = 480;
        int x4 = 710;
        int placementY = 371;
        int wide = 200;
        int tall = 350;
        
        Doors Door1_ = new Doors(x1, placementY, wide, tall);
        Doors Door2_ = new Doors(x2, placementY, wide, tall);
        Doors Door3_ = new Doors(x3, placementY, wide, tall);
        Doors Door4_ = new Doors(x4, placementY, wide, tall);  
    
        g.setColor(Color.red);
        g.fillRect(x1, placementY, wide, tall);
        g.setColor(Color.BLUE);
        g.fillRect(x2, placementY, wide, tall);
        g.setColor(new Color(34, 139, 34));
        g.fillRect(x3, placementY, wide, tall);
        g.setColor(Color.BLACK);
        g.fillRect(x4, placementY, wide, tall);
    
    
    }

  8. #8
    Join Date
    Apr 2013
    Posts
    41
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Yes that is fine, it was really just a suggestion as it looks neater but really wont affect the outcome of your program.

  9. #9
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by leeroijenkiins View Post
    Yes that is fine, it was really just a suggestion as it looks neater but really wont affect the outcome of your program.
    That's fine as I want to get into the habit of being a *neat* programmer....I don't want my code all over the place....So okay...now I have my doors...next would be a textbox that displays my *clues/ math equation* to figure out the correct door.

    I was thinking about making arrays...1 array for the equation.....and 1 array each for each door that holds possible answers....for a total of 5 arrays

    I'm not sure if this would be a good way to go about it....I plan on making the game only have 10 *levels*

    So first things first...is there a way to make a box that displays my text questions? I've looked into a few options like JTextField, JTextPane and JTextArea....but none seem to work for me as in what I want....a box (clearly seen) with a clue in it..

    However I recently thought about just making a rectangle for my box...and just drawing the clues into the rectangle... Or should I literally just draw the clue with no box around it?

    Not sure what to do, so any input here?

  10. #10
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Okay, well I'm going to skip the text clues for the moment...I'm going to move on to the mouse with the door.


    So I would want to know when the mouse in in the door image.

    So for this I'm thinking I'll need a mouseMotionListener.....And make it some variables named mx = getX() and my = getY()

    so

    Java Code:
    if ( mx >= x1 && mx <= (x1 + wide) && my <= tall) {
    System.out.println("You are in door 1");
    }

    And then repeat that for the other doors....would this be a correct way of going about this?

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: I'm not sure how to get started here...game

    If you have a class representing a Door, and that Door knows where it is on the screen (not ideal, but trying a full-blown MVC setup here is probably a stretch), then I would give the Door class a method that takes the mouse coordinates and checks whether the mouse is inside the area of the door. Similar to the code you have shown.
    Then just cycle over each Door whenever you get a mouse motion event.
    Please do not ask for code as refusal often offends.

  12. #12
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by Tolls View Post
    If you have a class representing a Door, and that Door knows where it is on the screen (not ideal, but trying a full-blown MVC setup here is probably a stretch), then I would give the Door class a method that takes the mouse coordinates and checks whether the mouse is inside the area of the door. Similar to the code you have shown.
    Then just cycle over each Door whenever you get a mouse motion event.
    So basically put the mouseMotionListener in my door class? So here is what my full code looks like so far, just a main class and a door class

    Main Class

    Java Code:
    import javax.swing.*;
    /**
     * @author John
     */
    public class Math_Doors extends JFrame{
    
        private int SCREEN_WIDTH = 950, SCREEN_HEIGHT = 750;
        
        Math_Doors(){
            initJFrame();
        }
        
        public void initJFrame(){
          //  add (new Board());                         
            setTitle ("Math Doors");
            setSize(SCREEN_WIDTH, SCREEN_HEIGHT);
            setResizable(false);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setVisible(true);
            setLocationRelativeTo(null);
        }
        
        public static void main(String[] args) {
            
            new Math_Doors();
        }
    }
    I'm believe I'm going to have to make a new class (as you can see, will be named Board() ) because I cannot // add ( new Doors()); because Doors() has (int x, int y, int w, and int h)

    Door Class


    Java Code:
    public class Doors extends JPanel{
       
       
        Doors(int x, int y, int w, int h){
           
        int x1 = 20;
        int x2 = 250;
        int x3 = 480;
        int x4 = 710;
        int placementY = 371;
        int wide = 200;
        int tall = 350;
        
        Doors Door1_ = new Doors(x1, placementY, wide, tall);
        Doors Door2_ = new Doors(x2, placementY, wide, tall);
        Doors Door3_ = new Doors(x3, placementY, wide, tall);
        Doors Door4_ = new Doors(x4, placementY, wide, tall);   
           
        addMouseListener( new Doors.MListener());
        addMouseMotionListener( (MouseMotionListener)this.getMouseListeners()[0]);
    }
        
         private class MListener extends MouseAdapter {
            public void mouseMoved( MouseEvent e){
                int mx; 
                int my;
                
                mx = e.getX();
                my = e.getY();
                  System.out.println("x = " + mx + " y = " + my);
             }
    }
            
         
             public void mouseClicked(MouseEvent e){
                 int cx;
                 int cy;
                switch(e.getID()){
                    case MouseEvent.MOUSE_CLICKED:
                        
                        cx = e.getX();
                        cy = e.getY();
                        
                        System.out.println("You've clicked here " + cx + " " + cy);
                        break;
                }
         
            }
        public boolean mouseInDoor( int mx, int my){
        int x1 = 20;
        int x2 = 250;
        int x3 = 480;
        int x4 = 710;
        int wide = 200;
        int tall = 350;
        
        if ((mx>= x1 && mx<=(x1 + wide))&&
           (my>= tall)){
            
            System.out.println("You are in door 1");
        }
            
        return ((mx>= x1 && mx<=(x1 + wide))&&
           (my>= tall));
            
        }
        
        
    
    }
    I'm not too sure if I did that last part correctly

    Java Code:
    public boolean mouseInDoor( int mx, int my){
        int x1 = 20;
        int x2 = 250;
        int x3 = 480;
        int x4 = 710;
        int wide = 200;
        int tall = 350;
        
        if ((mx>= x1 && mx<=(x1 + wide))&&
           (my>= tall)){
            
            System.out.println("You are in door 1");
        }
            
        return ((mx>= x1 && mx<=(x1 + wide))&&
           (my>= tall));
            
        }
    I was just kind of guessing what to do here. I did the Boolean, but I was also thinking about doing a public void

    Java Code:
    public void mouseInDoor( int mx, int my){
        int x1 = 20;
        int x2 = 250;
        int x3 = 480;
        int x4 = 710;
        int wide = 200;
        int tall = 350;
        
        if ((mx>= x1 && mx<=(x1 + wide))&&
           (my>= tall)){
            
            System.out.println("You are in door 1");
        }
         
    }
    Just not too sure about what to do there,


    Now Clearly this isn't showing anything other than a blank window, and I get that's because I need to do that add( new ....()); But I cannot do that just yet and am not too clear on doing that. CAN I just add (new Doors());?

  13. #13
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: I'm not sure how to get started here...game

    Well, I was just suggesting a Door (not plural) class that simply holds data.
    Not as an extension of a JPanel.
    Trying (within reason) to detach the Door from the GUI.
    At the moment you have far to many Doors...in fact it looks to me like you'll have a stack overflow:
    Java Code:
    public class Doors extends JPanel {
        Doors(int x, int y, int w, int h){
            Doors Door1_ = new Doors(x1, placementY, wide, tall);
            Doors Door2_ = new Doors(x2, placementY, wide, tall);
            Doors Door3_ = new Doors(x3, placementY, wide, tall);
            Doors Door4_ = new Doors(x4, placementY, wide, tall);    
        }
    }
    In the above, when you create a Doors object it creates another Doors object, which creates another Doors object...etc etc.

    A Doors class that extends JPanel is fine...but you need a Door class that represents a single door and simply draws to a Graphic object and can check mouse positions.
    Please do not ask for code as refusal often offends.

  14. #14
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by Tolls View Post
    Well, I was just suggesting a Door (not plural) class that simply holds data.
    Not as an extension of a JPanel.
    Trying (within reason) to detach the Door from the GUI.
    At the moment you have far to many Doors...in fact it looks to me like you'll have a stack overflow:
    Java Code:
    public class Doors extends JPanel {
        Doors(int x, int y, int w, int h){
            Doors Door1_ = new Doors(x1, placementY, wide, tall);
            Doors Door2_ = new Doors(x2, placementY, wide, tall);
            Doors Door3_ = new Doors(x3, placementY, wide, tall);
            Doors Door4_ = new Doors(x4, placementY, wide, tall);    
        }
    }
    In the above, when you create a Doors object it creates another Doors object, which creates another Doors object...etc etc.

    A Doors class that extends JPanel is fine...but you need a Door class that represents a single door and simply draws to a Graphic object and can check mouse positions.
    Okay, well lets do it your way because like I said, I'm not 100% sure of my programming abilities with my knowledge, just a few months of java means I'm open to ALL suggestions.

    So lets forget the "extends JPanel" part here

    and only using 1 door in the class so lets put

    Java Code:
    public class Doors {
        Doors(int x, int y, int w, int h){
        int x1 = 20;
        int x2 = 250;
        int x3 = 480;                             //just to keep the variables here for now
        int x4 = 710;
        int placementY = 371;
        int wide = 200;
        int tall = 350;
    
            Doors Door = new Doors(x1, placementY, wide, tall);
    }
    }
    so this is a class that says any door made has an x position, y position, a width and a height. Then I made a door that has some x, some y, some width, and some height. is this what you meant but just a class that stores the data of the door?

  15. #15
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: I'm not sure how to get started here...game

    First off, you should name a class by what it represents.
    That is a Door...not a collection of Doors.

    Second, you are still creating a Door(s) object inside the Door(s) constructor...why?
    You will get a stack overflow.
    Please do not ask for code as refusal often offends.

  16. #16
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by Tolls View Post
    First off, you should name a class by what it represents.
    That is a Door...not a collection of Doors.

    Second, you are still creating a Door(s) object inside the Door(s) constructor...why?
    You will get a stack overflow.
    gotcha, renaming my class now.

    Now, it's just that it's not clicking in my head really. I'm thinking that just the door constructor is the blueprint of what all doors will be, I feel like I need to make a door inside that blueprint in order to have the actual object, rather than just a blueprint of what that object would be. But thank you for pointing out it will give a stack overflow. So basically I just have an empty class now...well with a few variables. And I guess that does make sense, I'm not going to be wanting to make a new door here, that will come later when I'm ready to draw/use one.

    Java Code:
    public class Door {
        
        
            Door(int x, int y, int w, int h){
    
        int x1 = 20;        //will be the x position of door 1
        int x2 = 250;       //will be the x position of door 2
        int x3 = 480;       //will be the x position of door 3
        int x4 = 710;       //will be the x position of door 4             //putting these here to keep track of them
        int placementY = 371;      //will be the y position of all doors
        int wide = 200;            //will be the width of all doors       
        int tall = 350;              //will be the height of all doors
    
            }
    }
    Last edited by johnweldon1993; 05-15-2013 at 03:27 PM. Reason: cut off sentence

  17. #17
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: I'm not sure how to get started here...game

    A class is usually created to represent something.
    That representation includes data (ie attributes) that describe an instance of that class, and methods that describe what the class can do.
    At the moment your Door has no attributes.
    The stuff coming into the constructor is usually used to populate attributes.
    Please do not ask for code as refusal often offends.

  18. #18
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by Tolls View Post
    A class is usually created to represent something.
    That representation includes data (ie attributes) that describe an instance of that class, and methods that describe what the class can do.
    At the moment your Door has no attributes.
    The stuff coming into the constructor is usually used to populate attributes.
    Last bit of information here, my prof emailed me and said for my specific project to use the same portion of code *shown below* we had used to make our snake game in lab one day


    This class was called Vec2

    Java Code:
    /**
     * @author John
     */
    public class Vec2 {
    
        public int x_, y_;
    
        Vec2( int x, int y){
          x_ = x;
          y_ = y;
        }
    
        @Override
        public boolean equals( Object otherObj){
            if(this == otherObj)
                return true;
            if(otherObj == null || !(otherObj instanceof Vec2))
                return false;
            Vec2 other = (Vec2)otherObj;
            return(other.x_ == x_)&&(other.y_ == y_);
        }
    
        @Override
        public String toString(){
            return(x_ + " , " + y_);
        }
        public Vec2() {
        }
    
    }
    So I attributed this to my Door class

    Java Code:
    /**
     * @author John
     */
    public class Door{
        
        public Vec2 corner_ , dim_;
        
        Door(){
            corner_ = new Vec2(0,0);
            dim_ = new Vec2(0,0);
        }
        
        Door(int x, int y, int w, int h){
            corner_ = new Vec2(x,y);
            dim_ = new Vec2(w,h);
        }
        
            int lox = corner_.x_;
            int loy = corner_.y_;
            int hix = corner_.x_ + dim_.x_;
            int hiy = corner_.y_ + dim_.y_;
            
            public boolean mouseInRectangle( int mx, int my){
            return(mx>= corner_.x_ && mx<=(corner_.x_+dim_.x_))&&
                  (my>= corner_.y_ && my<=(corner_.y_+dim_.y_));
    }
    }
    So I believe that this basically says my door(s) will have an X corner and a Y corner and also have Dimensions W and H.

    I added this for my mouse intersecting the door...

    Java Code:
    public boolean mouseInRectangle( int mx, int my){
            return(mx>= corner_.x_ && mx<=(corner_.x_+dim_.x_))&&
                  (my>= corner_.y_ && my<=(corner_.y_+dim_.y_));
    }
    This will show if the mouse crosses into the "plane" of the door, though I haven't added the mouse part of the game yet. I cannot add it here however can I? Can't the mouseListener and mouseMotionListener only be used in a class that extends JPanel?

    I eagerly await your view on this way of looking at it and advice!

  19. #19
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: I'm not sure how to get started here...game

    That looks better. The 'lo' and 'hi' attributes should be calculated in the constructor, or in a method called by the constructor. If you tested the above code as-is you'll probably find that it throws a NullPointer as the two Vec attributes won't actually be initialised by that point (if I remember my ordering of construction correctly).

    The JPanel that uses your Door objects to draw the screen is the one that will have the mouse listener.
    It can then call each of the Door objects to check whether the mouse is in that door.
    Please do not ask for code as refusal often offends.

  20. #20
    Join Date
    May 2013
    Posts
    27
    Rep Power
    0

    Default Re: I'm not sure how to get started here...game

    Quote Originally Posted by Tolls View Post
    That looks better. The 'lo' and 'hi' attributes should be calculated in the constructor, or in a method called by the constructor. If you tested the above code as-is you'll probably find that it throws a NullPointer as the two Vec attributes won't actually be initialised by that point (if I remember my ordering of construction correctly).

    The JPanel that uses your Door objects to draw the screen is the one that will have the mouse listener.
    It can then call each of the Door objects to check whether the mouse is in that door.
    Okay so I move the 'hi' and 'lo' attributes into the constructor, done *and yes correct on the NullPointer error*

    So am I done here for the time being?

    Now I'm thinking of making my new class, names Board *just because it makes sense (drawing board = where things are done)*

    And this new class Board() will extend JPanel

    And in this class I can make my new Doors (ie Door door1 = new Door(coordinates);) correct?

Page 1 of 3 123 LastLast

Similar Threads

  1. How do I Get Started with Java Game Development?
    By gogonimago in forum New To Java
    Replies: 16
    Last Post: 03-01-2012, 01:54 PM
  2. Getting Started
    By SuperPokeunicorn in forum New To Java
    Replies: 3
    Last Post: 09-10-2011, 06:39 AM
  3. Need help getting started on a lab!
    By abatakji74 in forum New To Java
    Replies: 3
    Last Post: 01-30-2011, 01:30 AM
  4. Getting started
    By hornsby in forum NetBeans
    Replies: 1
    Last Post: 03-12-2009, 07:47 AM
  5. How do I get started?
    By programmer-in-training in forum New To Java
    Replies: 4
    Last Post: 01-11-2008, 07:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •