Déc 032013

In previous article, I have regularly used either a rotating sprite (a car, a rocket, a tank, etc) OR an animated sprite (a walking character).

Here below these 2 classes.
You can use them in as a quick start for a game so that you dont have to bother with this part.

To use it the animated class :
declare it Dim animated As Animated
load it animated = New Animated(mTexture, 1, position, 0, 28, 32)
update it animated.Update(position, direction_)
draw it animated.Draw(spriteBatch)

Same goes with the rotating class :
declare it Dim rotated As rotated
load it rotated = New rotated(texture, _scale, New Vector2(50, 50), New Vector2(0, 0), _rotation, _speed)
update it rotated.Update(_rotation, _speed)
draw it rotated.Draw(SpriteBatch)

The animated class here : clsRotated .
The rotating class here : clsAnimated .

 Posted by at 19 h 38 min

Poster un Commentaire


Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.

Notifier de