Search:

Type: Posts; User: Edmacelroy

Page 1 of 2 1 2

Search: Search took 0.21 seconds.

  1. Re: Getting moving rectangles to attach to each other

    That's what we're are trying to do in our code. As of right now there is no code that would attach these together except for what we are trying in the moveRectangle method which is obviously wrong...
  2. Getting moving rectangles to attach to each other

    So basically this is the snake game. We want the head to create another body part that attaches to it after it eats the piece of food. We are having troubles with this, we can get the the body part...
  3. [SOLVED] Re: How to use Arraylist for my snake game??

    Ah thank you much
  4. [SOLVED] How to use Arraylist for my snake game??

    Hi everyone,

    I will try the getting help somewhere else instead. Thanks anyway don't know how to delete
  5. [SOLVED] Re: Back again with problems in my Snake Game

    Yup needed to use the intersects() method. Thank you that solved the issue
  6. [SOLVED] Re: Back again with problems in my Snake Game

    OK, finally got both the rectangles to show up. Now the problem is with my if statement in the snake frame. It seems when I try to match up the two Food_X + Food_Y coordinates to the Box_X and Box_Y...
  7. [SOLVED] Re: Back again with problems in my Snake Game

    No never used a debugger for java. I'm going in tonight for some help to see if the SI can help me figure it out. I'm just not understanding why it's not showing up if the other rectangle shows up...
  8. [SOLVED] Re: Back again with problems in my Snake Game

    Isn't the paintComponent() of the food item being called when I return food in the getRectangle method and than call the getRectangle Method in public snakeFood() as seen here in this code

    food...
  9. [SOLVED] Re: Back again with problems in my Snake Game

    Ah yes that is a great idea, in fact an SI showed me this trick with my keypressed listener and I forgot about it. I will give that a shot and let you know what I figure out.

    --- Update ---

    Ok...
  10. [SOLVED] Re: Back again with problems in my Snake Game

    Yeah I think you're right about the infinite recursion and think it was probably put in on accident and I removed it. I put in the super.paintComponent(g) and that didn't seem to work. I understand...
  11. [SOLVED] Back again with problems in my Snake Game

    I'm having trouble getting the program to randomly display the food. Right now I'm just trying to get a rectangle box to randomly display in some x,y coordinates and the program is doing this and...
  12. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    Nice, only took me like three days and almost gave up. Finally got it working. Huge Thank you to KevinWorkman for helping me out most of the way and Norm that was it just had to do exactly what you...
  13. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    Ok so I declared the boolean variables in the RectangleFrame3 class so they can be accessed through that entire class. I tested it and they seem to work somewhat. So I can now get it to automatically...
  14. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    I'm still not getting it.. Do i just have to declare the boolean variables in both the key listener and timer listener classes. I guess the examples I'm just not following because I'm working with...
  15. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    Yes exactly, I want the user to press down the key and when release the rectangle should automatically keep moving in the direction of the arrow key the user pressed and released.

    In your Timer...
  16. [SOLVED] Re: How to get the arrow keys to move rectangle automatically

    Ok here is what I did so far. I guess now that I've created the boolean values, I'm confused now how to determine the keys pressed in the timer event.

    With this code my rectangle moves the...
  17. [SOLVED] How to get the arrow keys to move rectangle automatically

    Hi everyone,

    I'm creating a snake game and I need some help getting the rectangle to move automatically when a arrow key is pressed by a user. I got it right now that it will move the amount in...
  18. Replies
    6
    Views
    209

    Re: Need help with ActionListener Error

    Yeah I've read about 11 chapters in my Big Java book and Chapter 10 was all about this. I just don't understand what is going wrong when applying this class to the array and why it won't find that...
  19. Replies
    6
    Views
    209

    Re: Need help with ActionListener Error

    It's supposed to be an inner class within the main method here is the code for it


    class ClickListener implements ActionListener
    {
    public void actionPerformed(ActionEvent event) ...
  20. Replies
    6
    Views
    209

    Re: Need help with ActionListener Error

    Thanks for the quick response, I thought that would be the case just wasn't sure. So loop through each JButton in the array and add the ActionListener to them. This is what I did and I'm getting...
  21. Replies
    6
    Views
    209

    Need help with ActionListener Error

    Here is my code. It's for a tic tac toe program and i'm trying to get my Listener to work so it knows what to display but it's throwing me an error.

    Code first here it is:



    import...
  22. Replies
    5
    Views
    168

    Re: Help getting current time to start

    How do I continually update the GUI exactly ?? That is exactly what I'm trying to do.
  23. Replies
    5
    Views
    168

    Help getting current time to start

    My issue is I can't get the current time to start counting by seconds for example 22:17:51 - 22:17:52 - 22:17:53. Any help will be greatly appreciated and here is my code so far. I can get the time...
  24. Replies
    7
    Views
    358

    Re: Homework Help Java Beginner

    This code seems to work well

    Now I really just have to study this code because I did so much wrong. I can't thank you enough for all of your help and taking the time to walk me through this so...
  25. Replies
    7
    Views
    358

    Re: Homework Help Java Beginner

    ok, here is what i have got done so far. I tried to get the name of the highest calorie item to display but still get the last item displayed. Everything else seems to be working, still struggling a...
Results 1 to 25 of 37
Page 1 of 2 1 2