I keep getting an error about semi colons, and certain choices not applicable fo
ID: 3759670 • Letter: I
Question
I keep getting an error about semi colons, and certain choices not applicable for the arguments.
I dont know what I'm doing wrong. This is what I need, and below is what I have tried already.
In processing load at least 5 images and compose a nice scene. It is Java based. We were using processing.org in class.
Example: you could use a beach background image, a cloud image, a boat image, a surfer image etc. and show in every frame the background and animate the cloud to move to the right, and the boat to move to the left, and the surfer to move to the right maybe faster than the boat.
Example 2: you could use a country scene background and have a bird fly to the left, an airplane fly to the right, a car move in the road to the left etc.
REQUIREMENTS:
Use at least 5 images.
The size of each image should be no higher than 800x800.
The size of the window should be no more than 1200x800 (in the class I use 800x600).
At least 3 images should move in different directions/speed (for example: -1, +1, +3)
Looking for the code for the pde file.
_________________________________________________________
// Declare PImage type variables
PImage nwimg;
PImage twinbirds;
PImage jetplane;
PImage passingcloud;
PImage bee;
float pos
// Code to create a instance and load the images
void setup()
{
size(1200,800);
// Create new instance of a PImage
nwimg = loadImage("walebeach.jpg");
twinbirds= loadImage("twinbirds.jpg");
jetplane= loadImage("jetplane.jpg");
passingcloud= loadImage("passingcloud.jpg");
bee= loadImage("bee.jpg");
}
// Code to display the image
void draw()
{
background(0);
// Draw the image to the screen at coordinate (0,0)
image(nwimg,pos,0,500,500);
pos-=0.01;
image(twinbirds,pos,50,0);
pos+=0.05;
image(jetplane,pos,100,0);
pos-=0.1;
image(passingcloud,pos,150,0);
pos+=0.1;
image(bee,pos,200,0);
pos-=0.01;
}
Explanation / Answer
PImage nwimg;
PImage twinbirds;
PImage jetplane;
PImage passingcloud;
PImage bee;
float pos
// Code to create a instance and load the images
void setup()
{
size(1200,800);
// Create new instance of a PImage
nwimg = loadImage("walebeach.jpg");
twinbirds= loadImage("twinbirds.jpg");
jetplane= loadImage("jetplane.jpg");
passingcloud= loadImage("passingcloud.jpg");
bee= loadImage("bee.jpg");
}
// Code to display the image
void draw()
{
background(0);
// Draw the image to the screen at coordinate (0,0)
image(nwimg,pos,0,500,500);
pos-=0.01;
image(twinbirds,pos,50,0);
pos+=0.05;
image(jetplane,pos,100,0);
pos-=0.1;
image(passingcloud,pos,150,0);
pos+=0.1;
image(bee,pos,200,0);
pos-=0.01;
}