#After making snake head that able to intersect with food, how do I use arrays to make the body part

3 messages · Page 1 of 1 (latest)

sinful tinsel
#

I have snake class and food class that works properly. The most confusing part is how do I make a method that make the body grows. What I've done so far are: public Rectangle[] bodyPoints = new Rectangle[100]; , public BufferedImage body and along with other variables like size, tail, and head . I am using a .png with a Rectangle hitbox to detect intersection for the snake head, so I was thinking for doing the same thing for the body.

I found it's hard to find tutorials on YouTube that explains clearly on body parts logic.

drifting daggerBOT
#

This post has been reserved for your question.

Hey @sinful tinsel! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.