Question: Hello, I have a code using processing IDE that shows a woman running with a scrolling background of mountains. I want to change this code
Hello, I have a code using processing IDE that shows a woman running with a scrolling background of mountains. I want to change this code so that it is able to be a game. I would like you to keep most of the code the same as much as you can because it works perfectly. I just want the running sprite woman to be able to jump and I want you to implement a soundfile called runningmp Remainder that this is processing code:
ArrayList mountain new ArrayList;
ArrayList mountain new ArrayList;
ArrayList mountain new ArrayList;
float my my my;
float ms ms ms ;
PImage runFrames new PImage;
int frameIndex ;
int frameDelay ; Controls the speed of the frame update
int frameCounter ; Frame counter to manage animation timing
void setup
size;
my height ;
my height ;
my height ;
generatemountain my ms;
generatemountain my ms;
generatemountain my ms;
noStroke;
Load sprite images
for int i ; i runFrames.length; i
runFramesi loadImageruni png;
void draw
background;
Move mountains
movemountain my ms;
movemountain my ms;
movemountain my ms;
Show mountains
fill;
showmountain;
fill;
showmountain;
fill;
showmountain;
Animate sprite
if frameCounter frameDelay
frameIndex frameIndex runFrames.length;
Display sprite centered
imagerunFramesframeIndex width runFramesframeIndexwidth height runFramesframeIndexheight;
void moveArrayList mountain, float speed, float y float size
for int i ; i mountain.size; i
mountain.getix speed;
if mountaingetx
mountain.remove;
while mountaingetmountainsizex width size
mountain.addnew PVectormountaingetmountainsizex size randomsize size y randomsize, size;
void generateArrayList mountain, float y float size
mountain.addnew PVector y randomsize, size;
while mountaingetmountainsizex width
mountain.addnew PVectormountaingetmountainsizex size randomsize size y randomsize, size;
void showArrayList mountain
beginShape;
vertexwidth height;
vertex height;
for int 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
