Search:

Type: Posts; User: godlynom

Search: Search took 0.07 seconds.

  1. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    I have figured it out, the snake game is up and running, everything works, all the collides and all, now to customize it how i want, thanks so much for your help both times Norm and anyone else who...
  2. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    yea, i tested it out, the problem is in my follow method, what i do is i set the x and y of the bodyparts to the x and y of the snake, so now i need to make it so that it appears behind the snake,...
  3. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    I think it is this code

    if(go)
    {
    int i=0;
    for(SnakeBody s: snake)
    {
    if(snake.indexOf(s)>=1)
    {
    temp1=s;
  4. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    they are drawn separately, with different x's and y's, but then the next time they move they all become the original snake's x and y and then are drawn upon each other, so it is all the bodyparts in...
  5. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    okay, yea, my assumption was correct, they do draw, but then their x and y are changed to that of the original snake, thus merging back into one snake
  6. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    no, they still disappear, are the coordinates getting changed to the first snake's, or is the SnakeBody not being actually drawn, it says it is, trying to figure this out now
  7. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    well i put the debugger here
    for(SnakeBody s: snake)
    {
    s.draw(g);
    System.out.println(s);
    }
    and each time i got a food it created a new SnakeBody, and then also was drawing them...
  8. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    well i debugged the paintComponent, and whenever i collide with a food, a new SnakeBody is created and read every single tick, however, it is not being drawn
  9. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    as an update, i worked on my class and now the snake body parts get created and drawn, but only for a second, so you see the body part and then it disappears, any help?
    Snake class:

    import...
  10. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    So if I were to make many snake objects, would i just create an:


    ArrayList <SnakeBody> snake = new ArrayList <SnakeBody>();

    and then call them one by one in a for loop based on that?
    ...
  11. Replies
    21
    Views
    2,226

    [SOLVED] Re: more help with snake game

    The food class did not copy all over, here is the code again


    import java.awt.*;

    public class Food
    {
    double x = 0, y = 0;
    private double myX; // x and y coordinates of center
    ...
  12. Replies
    21
    Views
    2,226

    [SOLVED] more help with snake game

    Hello all, this is godlynom again, thanks to those who helped me last time. Everything is working, now I just need the body parts to be added after I collide with the food. Essentially everytime you...
Results 1 to 12 of 12