SFML community forums
Help => General => Topic started by: Cyraxx on April 23, 2014, 12:01:25 pm
-
Hello!
I'm fairly new to Spine, well and SFML itself and I was wondering if any of the more experienced programmers here could help me out.
So my problem is that I have no clue how to move characters/animations made with Spine. Nor am I able to figure out how could I get a hitbox for it. (we are making a sidescroller platformer game)
We already made a decent collision detection and some basic physics using sprites but we just can't do it with Spine. Please help us! :)
-
There've only been very few people using Spine with SFML, not sure if anyone is hanging around here.
If you want concrete help, you need to ask specific questions.
The only thing I can provide at the moment is the official example (https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/example/main.cpp#L61).
-
Thanks for the quick reply. I'd already checked the example you linked (it is a walking animation for a goblin and a 'spineboy') and using that example I managed to replace the character in our game with the same goblin (it's going to be the goblin until we manage to solve the collision detection etc).
So my concrete question is: I have the goblin displayed in the SFML window. I'd like to move it, let's say I hold the Right arrow key then it moves right with X speed utill the key is not released. Same with left and jumping.
I just don't know hot to change it's position.
It was easy using sf::Sprite, but I think it's type is sf::Drawable now. (SkeletonDrawable wich is an extension of sf::Drawable)
-
The SkeletonDrawable is getting (https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/src/spine/spine-sfml.cpp#L128) its position information from the Skeleton, so all you need to do, it seems, is changing the skeleton position.