# Sprite code not working, please help

**URL:** https://discourse.processing.org/t/sprite-code-not-working-please-help/28817
**Category:** Coding Questions
**Created:** [March 25, 2021, 1:39am UTC](https://discourse.processing.org/t/sprite-code-not-working-please-help/28817 "2021-03-25T01:39:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DrAwesomeSauce2000](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@DrAwesomeSauce2000](https://discourse.processing.org/u/DrAwesomeSauce2000)
#### Post date: [March 25, 2021, 1:39am UTC](https://discourse.processing.org/t/sprite-code-not-working-please-help/28817/1 "2021-03-25T01:39:04Z")

</div>

import sprites.utils._;  
import sprites.maths._;  
import sprites.\*;

Sprite sonic;  
StopWatch sw= new StopWatch ();

void setup() {  
size(1280, 720);  
sonic = new Sprite (this, “pngjoy.com\_sonic-sprite-modern-sonic-advance-sprites-transparent-png\_10029178.png”, 9, 10, 0);  
sonic.setXY(width/2, height/2);  
sonic.setFrameSequence(84, 89, 0.1);  
sonic.setScale(2);  
registerMethod(“pre”, this);  
noSmooth();  
}

public void pre() {  
float elapsedTime=(float)sw.getElapsedTime();  
S4P.updateSprites(elapsedTime);  
}

void draw() {  
background(32);  
S4P.drawSprites();  
}

This is what it looks like when I run it

 ![Screen Shot 2021-03-24 at 8.37.58 PM](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/44400ba884fe35a3c7e21f97d55ecd1eb493b1e9.png)
