Yup needed to use the intersects() method. Thank you that solved the issue
Type: Posts; User: Edmacelroy
Yup needed to use the intersects() method. Thank you that solved the issue
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...
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...
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...
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...
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...
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...