TfeServer

Blog de tfe, Perl, Web et Libre...?

Game creation: moving a simple character

PubliƩ le 29/09/2016 dans threejs

Here is the article 7 about my series of posts about the game creation.

If you missed it, check out the previous part.

We previously loaded a mesh with an animation, so now we will trigger this animation only when the "character" is moving.

There is nothing crazy here, we are just playing with the "EffectiveWeight" of the animation with:

  this.move_action.setEffectiveWeight(value);

Depending on the movement status, we put the value to 1 or 0.

Here is the final result:

You can get: the source code or View the demo directly.