Forum

> > CS2D > Maps/Editor > Moving sprites
Forums overviewCS2D overview Maps/Editor overviewLog in to reply

English Moving sprites

2 replies
To the start Previous 1 Next To the start

old Moving sprites

HoOtix
User Off Offline

Quote
Hello. Today I'm here to ask the community a simple question.
Yes, simple. But I don't know it.... Anyways, How do you make the sprites move smoothly using... 'Trigger_Delay' Thank you.

old Re: Moving sprites

DC
Admin Off Offline

Quote
I think user GeoB99's answer is a bit confusing because he didn't go much into detail... so:

The short answer is: You can't do that. cs2d entity env_sprite entities are not designed to be moved at all during runtime.

There are two ways to achieve what you want to do:

• Use Lua map scripts and cs2d lua cmd image instead of cs2d entity env_sprite. cs2d lua cmd image has tween commands like cs2d lua cmd tween_move which do exactly what you want.

• If you REALLY don't want to use Lua you can use an ugly fallback solution with entities and triggering only but this one is a ton of annoying work (clearly not recommended): Create X env sprite entities with the same image and move every one a little bit further. Hide them all at start. Now you have to trigger them in a row with a ton of cs2d entity trigger_delay so that only one is shown at a time.

e.g.:
• sprites: A, B, C, D ..., all hidden at start except for A
• delays: 1, 2, 3, 4, ...
• trigger delay 1 to start fake movement. It triggers A, B and 2 (hides A, shows B and triggers next step)
• 2 triggers B, C and 3
• 3 triggers C, D and 4
• and so on

This way you create the illusion of movement. But: cs2d entity trigger_delay is currently restricted to second precision so it won't be smooth.
To the start Previous 1 Next To the start
Log in to reply Maps/Editor overviewCS2D overviewForums overview