# Increase speed using the same sprite--- DIFFERENT MODES

**URL:** <https://forum.code.org/t/increase-speed-using-the-same-sprite-different-modes/38914>\
**Category:** CS Discoveries\
**Created:** [January 18, 2024, 2:44pm UTC](https://forum.code.org/t/increase-speed-using-the-same-sprite-different-modes/38914 "2024-01-18T14:44:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dajanim](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@dajanim](https://forum.code.org/u/dajanim)\
**Post date:** [January 18, 2024, 2:44pm UTC](https://forum.code.org/t/increase-speed-using-the-same-sprite-different-modes/38914/1 "2024-01-18T14:44:43Z")

</div>

Hello everyone,

One of my students is working on a two player ping pong game. The player who reaches 100 points wins, but my student wants the ball to move faster every 10 or 20 points

any ideas?

> **[Check out what I made](https://studio.code.org/projects/gamelab/96-WxZcIeeaZjrrGNbFWBhZIbuOlwZra0DCGi7IIArM)**
>
> I wrote the code myself with Code.org

---

<div class="post-metadata">

**Author:** ![melynn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/melynn/32/4925_2.png) [@melynn](https://forum.code.org/u/melynn)\
**Post date:** [January 19, 2024, 4:00am UTC](https://forum.code.org/t/increase-speed-using-the-same-sprite-different-modes/38914/2 "2024-01-19T04:00:01Z")

</div>

Hi @dajanim,

A fun game! Changing velocity would make it even more challenging. It seems simple enough but the change in velocity depending on the direction it is going adds a little to the difficulty. My suggestion is pretty simple. I created variables for x and y speed and then variables that kept track of whether it was going up or down. Then created if statements for change in score. I have a [sample here.](https://studio.code.org/projects/gamelab/tHY-H19ZPGimR0zXpavA8iD-MzkEcUFQVBXt2mmeQc0) It changes speed every 5 points for PlayerOne. It does not also adjust velocity for X so that would need to be added.

I’m sure others will have suggestions as well.

Good luck!  
~Michelle
