# Sprite Demo from Valter Buccina

**URL:** <https://forum.castle-engine.io/t/sprite-demo-from-valter-buccina/47>\
**Category:** News\
**Created:** [February 20, 2019, 12:17pm UTC](https://forum.castle-engine.io/t/sprite-demo-from-valter-buccina/47 "2019-02-20T12:17:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [February 20, 2019, 12:17pm UTC](https://forum.castle-engine.io/t/sprite-demo-from-valter-buccina/47/1 "2019-02-20T12:17:09Z")

</div>

| [![Sprite Demo](https://forum.castle-engine.io/uploads/default/original/1X/d5bd2856a03122bae5c721ebdcd0223fdd458bf4.jpeg)](https://castle-engine.io/wp/wp-content/uploads/2019/02/DemoImg.jpg "Sprite Demo") |

_Valter Buccina_ made a demo application using sprites in _Castle Game Engine_.

The demo is available on [https://github.com/valterb/sprite-demo-castle-engine](https://github.com/valterb/sprite-demo-castle-engine).

Citing from the README:

Demo is divided into two parts:

1. Goniometer
2. Road demo

The first shows with extreme precision the direction of the sprite in degrees. Using mouse click coordinates and Player position I apply the arctangent formula and I convert the value obtained in degrees. This way I get the requested direction.

The second one is a demo with a road background where you can move the sprite that is sized according to the distance from the observation point. One click to walk, double click to run. Run animation is divided into three actions, short initial walk, run, short final walk but it is not perfect.

See the [forum post](https://sourceforge.net/p/castle-engine/discussion/general/thread/0aca91fdd8/) for details. (This post was on an old forum — please use [new forum](https://forum.castle-engine.io/) for comments.)

Thank you!
