We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I'm trying to get the images of these apples to appear at random across the screen but they only seem to be appearing in one section when I run it. I think its something to do with the random() function but can't figure it out - any help would be appreciated :)
PImage appleImg = loadImage("http://" + "i.imgur.com/p9E3sqS.png");
void setup(){
size(800,600);
background(250, 250, 150);
}
void draw() {
frameRate(2);
for (int i = 0; i < 1; i++) {
int x = int(random(800));
int y = int(random(600));
image(appleImg, x, y);
}
}
Thank you!
Answers
frameRate 2 --- try without it first
http://forum.Processing.org/two/discussion/8045/how-to-format-code-and-text
println(appleImg.width, appleImg.height); // 300 259
Same result when eliminating frameRate...
Ahh it's because of the actual size of the original image..! Got it. Thank you :))