Open Diarandor opened 7 years ago
In other words, my request is to remove that bouncing effect from the engine part, and allow to script it (a default effect that can be coded in some metatable(s), which can be overriden for other different behaviors in particular cases).
Another option (if you want to keep the default built-in bouncing bahavior) is just to display the default animation of the carried item in case the "stopped" and/or "walking" animations are not defined instead of displaying nothing in that case.
The customization of the bouncing should be possible too with events (and will be possible when the new code for carried entities is done, which should include some method "hero:get_carried_entity()"; the rest is just scripting some events).
Display bug and enhancement request for carried objects:
-Bug: if you lift a built-in destructible (pot, rock, plant,...) without releasing the arrow commands, when the hero starts walking with the carried object, the object does not move up-down (the built-in bouncing movement), and it happens even if you change the direction of the movement of the hero. If you release the arrow commands at some instant, it does not happen and the bouncing movement is correctly displayed.
-Enhancement: for a destructible entity that can be lifted (and other types of entities that will be liftable in future versions of the engine), I suggest that, instead of using the "stopped" and "walking" animations when the entity is being carried, the engine should use the default image (without any bouncing effect as default), which would allow us to get rid of the "walking" and "stopped" animations each time we create a destructible object. On the other hand, the engine should have several optional custom events (like "on_throw", "on_lifting", "on_lifted", etc) that are called if they are defined. Some of these events could be "on_hero_frame_changed" and "on_hero_animation_changed", which could be used to code the custom bouncing effect to display the sprite with the correct vertical shift (no matter how many frames the hero walking animation has, and also we would be able to do even more things). Well... it is not really necessary to make the engine automatically call the events "on_hero_frame_changed" and "on_hero_animation_changed" because these can be called from a script from the corresponding events of the hero tunic (so maybe it is better not to make the engine to call them). A default (custom) bouncing effect can be coded from some script and defined at some metatable (and overriden when necessary). This would make all more customizable and simpler for carried entities.