Final Project Bamboo Troops

Final Project Bamboo Troops
Published on May 04, 2020 by Jiaolyulu

I want to build something based on my previous p5js sketch. I want to make people be able to fight in a dizzy bamboo forest.

under structure


under structure


under structure


under structure


I am a big fan of WUXIA, which is Chinese Kongfu story. It seems that people just like to fight in bamboo forest. There is a story that someone has made a troop that people get into the bamboo forest will become dizzy and only people with strong inner power of KONGFU can get across the bamboo troops. I wanna study the movement of Kongfu.

I am classifying several gestures using the Gesture to Emoji example. I am classifying 6 gestures, up, down, right, left, clockwise, counter clockwise. I add 30 gestures to each genre.

I am trying to make it interactive not just by mouse. The bamboo troops look elegant but also stupid by just following the mouse movement. I want them to be deceiving. So I want to use the magic wand to let people to hold a bamboo and play with it.

up and down movement
for (let i = 1; i < number; i++) {
  targetY[i] = (height/2+(timeSpeed-1)*height)%height;
  targetX[i] = width *floor(i/number*2)+sin(t/5 +(i+actNum)+ cos(t*2.5))*40;
}

bamboo style



left and right movement
for (let i = 1; i < number; i++) {
  targetX[i] = (width/2+(timeSpeed-1)*width)%width;
  targetY[i] = 0.8*height*(floor(0.9*sin((i+6)/(number-1)*2*PI))+1)+sin(t/5 +(i+actNum)+ cos(5*2.5))*40;
}

bamboo style



drawing circle movement
for (let i = 0; i < number; i++) {
  targetX[i] = width / 2+sin( ((i+actNum)%number+1.5*cos(t/5))*6.28/8)*200*(sin(t)-0.5);
  targetY[i] = height / 2+cos(((i+actNum)%number+1.5*cos(t/5))*6.28/8)*200*(sin(t)-0.5);
}

bamboo style



bamboo style


bamboo style

bamboo style


This is the p5 js code