Asking about corner (where you change direction) in snake-like game. Nimble quest clone
So i'm trying to clone the game Nimble Quest on Android to learn Unity2D. (A little describe of the game below) I have been stuck with the problem about changing direction of the body -> tail characters. The idea I came up with is make 2 list. One contains the position where the Leader makes a turn, I call it "corner". The other one contains the direction of the Leader is moving, I call it "moving". So when the Leader makes a turn left, all other characters add that position to "corner" and "left" to "moving. I don't use Tile system, so I can't compare position directly. The algorithm I use is : When the Vector3 distance between a character and that position ( corner[0]) is below a number (I'm using 0.03), that character Move = moving[0], then I erase corner0 and move0. The problem is that, the character goes to the point of 0.03 in distance and turns left, it gets farther a little, and after 2-3 character in line and some 5-10 turns, they can't get the distance 0.03 anymore and can not change direction. I saw it go 0.045 -> 0.043 -> 0.046. It turns too soon and get farther after each turn. Can you help me some way to workaround with this algorithm, or an other algorithm I could use. Thanks. Please help :< . . . [P/S]: Nimble quest is a game that you start with a character, moving only in 4 way, like snake game, it's the head, or Leader, then after something a character is drop somewhere in the map, if you make a contact between the Leader and Drop, the Drop is added to the line.
Your answer
Follow this Question
Related Questions
Network Transport Layer API does not work with iOS to PC???? 0 Answers
[UNET] Rigidbody physics sync 0 Answers
Uploading to Photobucket 0 Answers
Unet: How can I know the percentage of packets lost? 1 Answer
starting host and creating match 1 Answer