# Move image around screen

**URL:** <https://discourse.processing.org/t/move-image-around-screen/9066>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [March 7, 2019, 12:46pm UTC](https://discourse.processing.org/t/move-image-around-screen/9066 "2019-03-07T12:46:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rose](https://avatars.discourse-cdn.com/v4/letter/r/91b2a8/32.png) [@rose](https://discourse.processing.org/u/rose)\
**Post date:** [March 7, 2019, 12:46pm UTC](https://discourse.processing.org/t/move-image-around-screen/9066/1 "2019-03-07T12:46:31Z")

</div>

- The first task will be to get the images to appear on the screen and to give the interface a screen size that works with the background image.
- Once this is complete, try to get the image object to move around the screen.
- As this is a fictional exercise, the starting position can be random, while the starting trajectory can be fixed.
- The interface will be restriction to a bounded 2D space, for this reason the object should bounce off the sides of the containing window and return in the opposite direction.
- The object only needs to move in 4 directions, North-East, South-East, South-West and North-West.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 7, 2019, 4:59pm UTC](https://discourse.processing.org/t/move-image-around-screen/9066/2 "2019-03-07T16:59:41Z")

</div>

That’s a task that has been given to you

That’s not how the forum works

Instead please write some  
code and then tell us where you are stuck

Hints: go to reference page and check `PImage` and `loadImage`…

[https://www.processing.org/reference/](https://www.processing.org/reference/)

Also check example section on website and check “Motion”

[https://www.processing.org/examples/](https://www.processing.org/examples/)

Chrisir 😉

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 10, 2019, 5:49pm UTC](https://discourse.processing.org/t/move-image-around-screen/9066/3 "2019-03-10T17:49:27Z")

</div>

Browse the reference and examples to get started:

[https://processing.org/reference/](https://processing.org/reference/)  
[https://processing.org/examples/](https://processing.org/examples/)

Examples includes a simple example of bouncing:

[https://processing.org/examples/bounce.html](https://processing.org/examples/bounce.html)

…and the reference shows how to load an image and display it in a location:

[https://processing.org/reference/loadImage\_.html](https://processing.org/reference/loadImage_.html)  
[https://processing.org/reference/image\_.html](https://processing.org/reference/image_.html)  
[https://processing.org/reference/PImage.html](https://processing.org/reference/PImage.html)
