Trails

Share your ZGE-development tips and techniques here!

Moderator: Moderators

Post Reply
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Trails

Post by Kjell »

Hi guys,

Although I'm pretty sure I already posted a similar example before ( could have been wireframe only though ), let me put together a simple solid trail example .. give me a couple of minutes :) I did have this "Samurai" variant lying around though.

K
Attachments
Samurai.zip
(40.16 KiB) Downloaded 612 times
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Voila ( updated )
Attachments
Trail.zgeproj
(2.55 KiB) Downloaded 751 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

sweetness

Post by jph_wacheski »

Yeah,. that's the ticket!

This will be some fun to play around with,. the 'samurai' example is quite nice! Are you going to do a hack'n slash game?! :shock:
I am sure we can design loads of variants on this kind of poly ribbon type effect,. big huge thanks again for helping with another math/logic puzzle.

You roc Kjell!
iterationGAMES.com
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

:?

I noticed that both examples don't run exactly as they should on every system. Might have to do with differences in framerate, or even video cards. If you want to take the safe route, instead of writing off the "new" value at the incremented index, push all array values down a cell so the newest value always resides at [0]. That way you don't have to do any trickery in the Render Component ( although it is a slightly slower approach ).

Here's what it should look like.

K
Attachments
Trail.jpg
Trail.jpg (74.38 KiB) Viewed 6658 times
User avatar
VilleK
Site Admin
Posts: 2355
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Very nice effect Kjell!

I also noticed it looked strange sometimes. After lots of debugging I found the problem. There is a problem in 1.9.5b where comparing integer values do not behave correctly.

In your render-expression:

if(TrailIndex < 0) TrailIndex += Mouse.SizeDim1-1;

TrailIndex and 0 are integers so the "(TrailIndex < 0)" is the problem. It seems to work most times on Windows anyway, but when trying it on Linux it crashed. I will fix this as soon as I can.
Post Reply