How to implement a trail behind a motorcycle

Hi all !

I am a new JMonkey user and i’m trying to implement a Tron game like GLtron and i was wondering how to do the trail behind the moving motorcycle?

thank you for your help!

Saw this somewhere, ah here it is http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/i-accidentally-created-tron/

1 Like

Thanks for your answer !

That was actually my first idea and i did this, placing a cube where the motorcycle goes but as the time goes, the scene gets slower and slower :confused:

Did you place a new cube each step or did you stretch the old one and only add a new one when the motorcycle turns a corner?

1 Like

You could also combine the trails with a batchnode, to reduce the object count.

1 Like
@zarch said:
Did you place a new cube each step or did you stretch the old one and only add a new one when the motorcycle turns a corner?


i wanted to do that but how do i strech juste one side of the cube? because when i do it , the cube streches on both sides :/
thanks for your help!

@EmpirePhoenix said:
You could also combine the trails with a batchnode, to reduce the object count.


i'm gonna take a look at the batchnode definition :)
thanks for your help!

Why stretch just one side? I’m not sure what you are trying to do there.



What I meant was stretch the whole cube.



Create a long thing cuboid the hight of the trail, width and length both being the width of the trail.

As the bike moves expand the cuboid in the correct direction using the appropriate scale function.