Search:

Type: Posts; User: Montario

Search: Search took 0.10 seconds.

  1. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    oh yes, I see exactly what you mean Norm. I never called it in the board.class! Thank you very much for your help, it works! Sorry I wasted your time not to notice that little detail I forgot.
  2. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    I don't understand. I thought I have called the getImage() method of the cobblestone class. Isn't it right here or am I getting mixed up:
    public Image getImage() {
    return image;
    }
    }
  3. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    I call it in my Cobblestone class here:
    private String cobblestone = "/images/cobblestone.png";

    private Image image;


    public Cobblestone() {
    ImageIcon ii = new...
  4. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    Yes, exactly. I don't know where I have gone wrong with the cobblestone image drawing though.
  5. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    Sorry, I meant my class which CONTAINS and image. The following is person.java


    package outrun;

    import java.awt.Image;
    import java.awt.event.KeyEvent;

    import javax.swing.ImageIcon;
  6. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    I understand more now but it is still a tad bit hazy. How do I alter my Cobblestone Class so that it IS an image? I am a bit confused as it worked perfectly fine for my other class which is an image....
  7. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    This is where I'm creating my image:
    private String cobblestone = "/images/cobblestone.png";

    private Image image;


    public Cobblestone() {
    ImageIcon ii = new...
  8. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    Ah ok, sorry that will be much easier:
    g2.drawImage(cobblestone, currentX, currentY,this);

    This code belongs to Board.class

    Error Message: The method drawImage(Image, int, int,...
  9. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    Yes, it has a method that returns an image for getImage(). I renamed getImage() to drawImage() but the error is still there. Is there something still wrong with the way I have drawn the image or...
  10. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    Thanks Giggas! I understand now. I have taken both your ideas and altered it to suit my situation. Now however, when I try to compile and run the program the images do not show. I think it must be an...
  11. Replies
    22
    Views
    2,374

    [SOLVED] Re: Help Generating a level

    Thanks so much for your reply aussiemcgr, I have a greater understanding of what I need to do. I still do not understand however what 'maxX' and 'maxY' are representing exactly. Please can you expand...
  12. Replies
    22
    Views
    2,374

    [SOLVED] Help Generating a level [SOLVED]

    Hey Everyone :)

    So I am basically creating a simple 2D game which will consist of a maze/level. I need to print out multiple images without having to print out the same line hundreds of times...
Results 1 to 12 of 12