Question: Hello, I have a code for processing of a code that shows a scrolling bacground of mountains. I have 8 sprite pose files and I
Hello, I have a code for processing of a code that shows a scrolling bacground of mountains. I have sprite pose files and I need help adding them in the code. they are called runpng runpng runpng runpng runpng runpng runpng runpng The sprite should run in the middle on the same spot as the background moves with them. It is better if the code is long and functional than short and has syntax errors and does not run. This is processing software for creating sketches, it uses java not java script. I will leave the code of my scrolling background:
ArrayList mountain new ArrayList;
ArrayList mountain new ArrayList;
ArrayList mountain new ArrayList;
float my;
float my;
float my;
float ms ;
float ms ;
float ms ;
void setup
size;
my height;
my height;
my height;
generatemountain my ms;
generatemountain my ms;
generatemountain my ms;
noStroke;
void draw
background;
movemountain my ms;
movemountain my ms;
movemountain my ms;
fill;
showmountain;
fill;
showmountain;
fill;
showmountain;
void moveArrayList mountain, float speed, float y float size
forint i ; i mountain.size; i
mountain.getix speed;
ifmountaingetx
mountain.remove;
whilemountaingetmountainsizex width size
mountain.addnew PVectormountaingetmountainsizex size randomsize size y randomsize, size;
void generateArrayList mountain, float y float size
mountain.addnew PVector y randomsize, size;
whilemountaingetmountainsizex width
mountain.addnew PVectormountaingetmountainsizex size randomsize size y randomsize, size;
void showArrayList mountain
beginShape;
vertexwidth height;
vertex height;
forint i ; i mountain.size; i
vertexmountaingetix mountain.getiy;
endShapeCLOSE;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
