Enforce max speed (new extension)
Limit the maximum speed an object will move from forces or from the physics behavior.
How to use:
- Add the behavior that matches the method you use to move the object (forces or physics)
- Set the maximum speed value in the behavior properties
Tips:
- This only affects movement from forces or physics
- This does not effect movement from other behaviors (platformer, top-down, draggable, etc)
Playable game
https://liluo.io/victrisgames/extension-enforce-max-speed
Project files
Extension - Enforce max speed.zip
Video
https://user-images.githubusercontent.com/8879811/194789391-1fe7f622-027c-4a6a-bd63-e805e236773b.mp4
Errors were detected in this submission:
❌ 1 Error found in extension 'EnforceMaxSpeed':
⟶ ❌ (🔧) [Dots in sentences]: Field 'shortDescription' of the extension description misses a dot at the end of the sentence!
❌ 1 Error found in extensions - please fix it before generating the registry.
I think I'm going to add a Minimum speed to this extension also. This way users can simply add acceleration and deceleration controls and let this extension handle the limits.
What should I call this extension, then? "SpeedRestrictions"
I think I'm going to add a Minimum speed to this extension also. This way users can simply add acceleration and deceleration controls and let this extension handle the limits.
An object with a speed = 0 doesn't have any direction. It could make it difficult to do and I guess a minimum speed won't be very useful.
I think I'm going to add a Minimum speed to this extension also. This way users can simply add acceleration and deceleration controls and let this extension handle the limits.
An object with a speed = 0 doesn't have any direction. It could make it difficult to do and I guess a minimum speed won't be very useful.
I would set up the minimum speed to only apply when the current speed is > 0 (it's the only way to know the direction).
I agree this is not going to be commonly used, but it could be useful in some cases. For instance, a weapon that pushes back enemies at different rates. The weapon could stop a small enemy, but the stronger ones would only be slowed (yes, this could be done in other ways).
It will only take me a minute to implement.
It will only take me a minute to implement.
Oh, how silly I was. :)
I am not going to add MinimumSpeed to this PR, but perhaps I should change the name to SpeedRestrictions so that more restrictions could be added in the future?
I renamed this to "Speed Restrictions" and added "Max rotation speed".
Playable game: https://liluo.io/victrisgames/extension-enforce-max-speed
Project files: Extension - Enforce max speed.zip
I gave a quick look, it looks good. A max speed = 0 could be a valid use-case to stop the object.
I gave a quick look, it looks good. A max speed = 0 could be a valid use-case to stop the object.
I agree, I removed that condition.
I used it as an optimization for when the user didn't set the max speed, but I think it's more important to have the flexibility you described.