This site requires JavaScript, please enable it in your browser!
Greenfoot back
lonely.girl
lonely.girl wrote ...

2012/11/28

Urgent help

1
2
danpost danpost

2012/11/28

#
It would be very easy! and your collision checking does not have to be for each class individually; you can use 'null' instead of a class name to include all classes (thereby only requiring one check). You order of checks should be (1) world edge checking (2) food checking (3) null (anything else or obstacle) checking
lonely.girl lonely.girl

2012/11/28

#
No problem, no worries at all it was fantastic helpful and detailed reply, really awesome :) thx Thank you for the advice regarding the keyboard, I'll worry about that once I finish adding obstacles.... I used this code to make the effect to the snake when it hits the obstacle, which I "manually" put in the world just to try and it worked
 Actor obstacle = getOneObjectAtOffset(speedX, speedY, Obstacle.class);
        if (obstacle != null)
            endl();
Next step is the have these "obstacles" randomly added into the world so should I do that in the world class?
lonely.girl lonely.girl

2012/11/28

#
Aha after I posted I read that reply about null ........... yeah it's less complicated thx
Spilli Spilli

2012/11/28

#
I know this is irrelevant to your question, but I was just wondering why you use a String to identify which piece of the snake is which?
Game/maniac Game/maniac

2012/11/28

#
Ha I managed to make a snake game without complicated stuff and there is very little code. Don't believe me!? Look at the code yourself: Snake time
jabirfatah91 jabirfatah91

2012/11/29

#
Hi, may be I can give you a better explanation for the question Okay, just think that we have a snake which is consist of 10 body segments(including the “head”). The “head” is always in the position 0. That means, we store the “head” at the index . Now, if we start counting from the right side, then our Mr. Snake’s tail (or the last body segment) will be at the index . So, Mr. Snake will have to move with all of his body segments. Assume that right now Mr. Snake is sleeping in a big house and the house has the following rooms; In every room has a body segment. Only the “head” is located in the room . Now If we want to move the whole snake, then we will start moving from the room . Look at the mathematical operation for a while: -1= 8; segment 9 is moving to the room 8. -1=7; segment 8 is moving to the room 7. -1=6; segment 7 is moving to the room 6. -1=5; segment 6 is moving to the room 5 . -1=4; segment 5 is moving to the room 4. -1=3; segment 4 is moving to the room 3. -1=2; segment 3 is moving to the room 2. -1=1; segment 2 is moving to the room 1. -1=0; segment 1 is moving to the room 0. For each step it is decrementing . And that’s why we wrote “i--“ Finally, the whole snake body will move one step forward.
Spilli Spilli

2012/11/29

#
Wouldnt it be more simple to have a parent and child system where the child takes the last position of its parent?
lonely.girl lonely.girl

2012/12/26

#
Hello Danspot, just wanted to check & ask to see if you have any demo for Mario game??? Thx alot
danpost danpost

2012/12/26

#
@lonely.girl, without being more specific as to what kind of class(es) you are looking for, I could not say.
lonely.girl lonely.girl

2012/12/29

#
it's a game with multiple levels, mushrooms, 2 players maybe, score, timer for each level and so
danpost danpost

2012/12/29

#
I do have quite a few demos and support classes available. Just click on my member icon and on the lower right of the page you will see my collections (the 'Support Classes' and 'Demos' are the one you would be interested in). Some of the ones you would probably be interested in are as follows:
  • Crayon Babies (for world changing )
  • Scrolling SuperWorld (for scrolling and a counter)
  • Bar Subclasses (for healthbars, timers and counters)
lonely.girl lonely.girl

2012/12/29

#
Thank you so much for your help :)
You need to login to post a reply.
1
2