# What is happening? (Sprite sheet)

**URL:** <https://discourse.processing.org/t/what-is-happening-sprite-sheet/40784>\
**Category:** Libraries\
**Created:** [February 1, 2023, 5:20pm UTC](https://discourse.processing.org/t/what-is-happening-sprite-sheet/40784 "2023-02-01T17:20:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![FelixBrooks](https://avatars.discourse-cdn.com/v4/letter/f/90ced4/32.png) [@FelixBrooks](https://discourse.processing.org/u/FelixBrooks)\
**Post date:** [February 1, 2023, 5:20pm UTC](https://discourse.processing.org/t/what-is-happening-sprite-sheet/40784/1 "2023-02-01T17:20:28Z")

</div>

PVector pos = new PVector(650, 0);  
PVector vel = new PVector(0,0);  
PVector acc = new PVector(0,9.8);

//import gifAnimation.\*;  
//Gif Sprite;

//import processing.sound.\*;  
//SoundFile file;  
//PImage Background;  
PImage Walking;  
PImage cutWalking = new PImage[6];  
color c = color(0);  
int frameWalking = 0;  
int xcoordWalking = Walking.width/6;  
int ycoordWalking = Walking.height;

void setup() {  
fullScreen();  
background(c);  
noStroke();  
fill(c);

Walking = loadImage(“Walking-Animation.png”);  
for (int i=0; i\<6; i++) {  
cutWalking[i] = Walking.get( i \* xcoordWalking, 0,xcoordWalking, ycoordWalking);  
}  
//Sprite = new Gif(this, “skye-mcclure-walkingperson.gif”);  
//Background = loadImage(“House.png”);  
//Loads a file from the /data folder of the sketch and plays it back.  
//SoundFile file = new SoundFile(this, “Monkeys-Spinning-Monkeys.WAV”);  
[//file.play](https://file.play)();  
}

void draw() {  
display();  
//image(Background, 0, 0);  
image(cutWalking[frameWalking], pos.x, pos.y);  
}  
//image(cut, pos.x, pos.y);  
//image(Sprite, pos.x, pos.y);

void display() {  
background(c);  
move();  
}  
//This is the beginning of the next tab

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [February 2, 2023, 11:11am UTC](https://discourse.processing.org/t/what-is-happening-sprite-sheet/40784/2 "2023-02-02T11:11:12Z")

</div>

(post deleted by author)

---

<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:** [February 2, 2023, 11:29am UTC](https://discourse.processing.org/t/what-is-happening-sprite-sheet/40784/3 "2023-02-02T11:29:41Z")

</div>

it’s best to post a runable version, so post all tabs in one go please.

Also upload your sprite sheet here (use the button with the landscape)

**Remark**

This line  
` PImage cutWalking = new PImage[6];`  
must be  
` PImage[] cutWalking = new PImage[6];`  
because cutWalking is seen as an array

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [February 2, 2023, 11:32am UTC](https://discourse.processing.org/t/what-is-happening-sprite-sheet/40784/4 "2023-02-02T11:32:35Z")

</div>

Hello @FelixBrooks,

Please read these:

- [Processing FAQ - Frequently asked questions](https://discourse.processing.org/faq)
- [Guidelines - Asking Questions](https://discourse.processing.org/t/guidelines-asking-questions/2147/4)
- [Guidelines - Answering Questions](https://discourse.processing.org/t/guidelines-answering-questions/2145/1)

`:)`
