Search:

Type: Posts; User: cjburkey01

Page 1 of 2 1 2

Search: Search took 0.05 seconds.

  1. Re: Variable Is Set, Works, But Then In Void, Returns 0

    I'm not entirely aware of what a static variable is, but if I'm using the same code I was 2 days ago, and it worked then, why doesn't it work now?
  2. Re: Variable Is Set, Works, But Then In Void, Returns 0

    I actually made a file like this:


    Boss at life
    6
    1
    0 1 2 3 4 5

    And it gives 5 for all the things, it returns 5 5 5 5 5 and makes the block looks like a flag(id 5)
  3. Re: Variable Is Set, Works, But Then In Void, Returns 0

    I'm not complaining about that. I'll just rewatch the tutorial in which I got this mechanism from, and rewrite it.
  4. Re: Variable Is Set, Works, But Then In Void, Returns 0

    OK, I tried it with a block that has a different shape, and it looks like it does receive it, but it still has the samr texture.
  5. Re: Variable Is Set, Works, But Then In Void, Returns 0

    It's only getting 0, which means 1 to this thing
  6. Re: Variable Is Set, Works, But Then In Void, Returns 0

    It's only getting the same value, it should be getting a few 1's, a few 0s, and a 5. It's only getting 1/0
  7. Re: Variable Is Set, Works, But Then In Void, Returns 0

    The block class still recieves 0 for everything, and that makes the level look like a block, not a line with a flag. somewhere the id is not sent
  8. Re: Variable Is Set, Works, But Then In Void, Returns 0

    UPDATE: It does read the file right...


    an ID [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5]
    an ID [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

    WHERE IS THIS MESSING UP D': D': D':
  9. Re: Variable Is Set, Works, But Then In Void, Returns 0

    it's the same, I'll do that print method you said.
  10. Re: Variable Is Set, Works, But Then In Void, Returns 0

    Level 1 - It's easy
    15
    2
    0 0 0 0 0 0 0 0 0 0 0 0 0 0 5
    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1


    That's what it reads from
  11. Re: Variable Is Set, Works, But Then In Void, Returns 0

    it's not that problem anymore, I don't think, it's not reading the maps correctly. Value 1 is where the value is sent to the Block class from the map file. Value 2 is in the block constructor,...
  12. Re: Variable Is Set, Works, But Then In Void, Returns 0

    Ok, but I did it, and this is what came out:


    Value 2: 0
    Value 1: 0
    Value 2: 0
    Value 1: 0
    Value 2: 0
    Value 1: 0
    Value 2: 0
  13. Re: Variable Is Set, Works, But Then In Void, Returns 0

    Oh, I get it, I'll post it in a sec
  14. Re: Variable Is Set, Works, But Then In Void, Returns 0

    I gave you the map reader, which reads the map file, returning the id's, it's the second to last code block, or:


    package com.cjburkey.games.boxee.mapping;

    import java.awt.Graphics;
    import...
  15. Re: Variable Is Set, Works, But Then In Void, Returns 0

    I don't understand
  16. Re: Variable Is Set, Works, But Then In Void, Returns 0

    Ok, this is the entire thing, Constructor is the constructor, and DrawVoid is the public void draw method:


    Success
    /Users/CJ/Boxee/maps/level1.map
    /Users/CJ/Boxee/maps/level2.map...
  17. Re: Variable Is Set, Works, But Then In Void, Returns 0

    That's what I did, that's how I found out it was the right value until it hits the draw method, it is 0 in that method
  18. Re: Variable Is Set, Works, But Then In Void, Returns 0

    I don't think I've changed anything, if you want I can post ALL my classes, or at least any that involve Block classes. Do you want me to?
  19. Re: Variable Is Set, Works, But Then In Void, Returns 0

    No, that's the thing, it only seem to happen with this, and it wasn't doing this before, I've changed nothing, and this started happening :(
  20. Re: Variable Is Set, Works, But Then In Void, Returns 0

    I had it printing out, and the
    [code]
    Images.blocks[Block.id - 1] = picks the very first value every time
    [/code
  21. Variable Is Set, Works, But Then In Void, Returns 0

    The id variable is the problem


    package com.cjburkey.games.boxee.objects;

    import java.awt.Graphics;
    import java.awt.Rectangle;
    import com.cjburkey.games.boxee.GameState;
    import...
  22. Replies
    9
    Views
    256

    Re: Weird NullPointerException Error

    Go it!!!!
    replace


    File[] listOfMaps = blablabla;

    with


    listOfMaps = blablabla;
  23. Replies
    9
    Views
    256

    Re: Weird NullPointerException Error

    Ok, I got it working:


    if(listOfMaps == null) {
    JOptionPane.showMessageDialog(null, "ERROR");
    } else {
    gsm.states.push(new Level1(gsm, listOfMaps[list.getSelectedIndex()].toString()));...
  24. Replies
    9
    Views
    256

    Re: Weird NullPointerException Error

    Well, I can't check the value, when I use an if statement, it crashes saying the line with the if statement is a NullPointer
  25. Replies
    9
    Views
    256

    Weird NullPointerException Error

    So I have this code:


    package com.cjburkey.games.boxee.state;

    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.Font;
    import java.awt.Graphics;
    import...
Results 1 to 25 of 45
Page 1 of 2 1 2