This site requires JavaScript, please enable it in your browser!
Greenfoot back
Zweeg
Zweeg wrote ...

2018/2/21

How do I pixelate my background in Greenfoot?

Zweeg Zweeg

2018/2/21

#
Here are the directions: Write a method that will pixelate an image to make it look more like it belongs on an old Nintendo system. To accomplish this, you will need to pause on a single pixel and change all surrounding pixels to the same color as the current pixel. Let's define a surrounding pixel to be any pixel within 5 x/y of the current one in a box. So, create your standard two loops to go from one pixel to another. However, x++ and y++ will not be good enough, you will need to skip farther (by 10). At each (x, y) coordinate, now write another set of nested loops that go from (x-5 to x+5) and (y-5 to y+5). Change each of these pixels to the same color as the original (x, y).
Super_Hippo Super_Hippo

2018/2/21

#
The instructions are pretty clear. What is the problem? What did you try?
Zweeg Zweeg

2018/2/23

#
I don't know how to write the code to pixelate it.
Vercility Vercility

2018/2/23

#
Zweeg wrote...
I don't know how to write the code to pixelate it.
Your post literally explains it step to step 2 For Loops with x/y as counters and x/y+10 instead of x/y++ And within those another 2 loops that set the color of each pixel
You need to login to post a reply.