Stencyl 3.4.0 is now out. Get it now!

Smooth Actor Motion

rob1221

  • *
  • Posts: 8866
Due to the jitter reported in this thread, I added some code in the engine to support smoother (but less accurate) actor motion, and now I've made an extension for it.

Enable Smooth Motion for %0
Turn smooth motion on.

Set Move Multiplier of %0 to %1
Using smooth motion, drawX/Y and realX/Y are separated.  This block sets how much closer to move drawX/Y to realX/Y.  The default is 0.33.  Decrease the number for smoother movement (but even less accuracy).

Set Min Move of %0 to %1
The actor will always move at least this amount.  The default is 3 (pixels).  Decrease for smoother movement, but the actor will take longer to slow down.

Set Max Move of %0 to %1
The actor will snap to realX/Y when it is farther than this number.  The default is 99999, effectively disabled.

Enable Position Snapping for %0
Enable this option so when using the setX/Y block, the actor will snap to that position.  Do not enable this option for actors that move by tweening.

« Last Edit: January 01, 2015, 10:02:29 am by rob1221 »

1MrPaul1

  • *
  • Posts: 1119
Probably you need to teach how to use this blocks.
for me, all blocks except first makes errors when compiling.

rob1221

  • *
  • Posts: 8866
Can you post a screenshot of what you're doing?

1MrPaul1

  • *
  • Posts: 1119
placing in when creating the block "enable smooth motion" and than, if I place any block like max or min move it is not compiling

rob1221

  • *
  • Posts: 8866
Do you have an up to date beta (OpenFL) version?

1MrPaul1

  • *
  • Posts: 1119
I have not last Stencyl build. My version with OpenFl 1.1. Do I need very last?

rob1221

  • *
  • Posts: 8866
As long as it's from December 2 or later it should be fine.  If you're still having problems then I'll deal with it after I'm done with my Ludum Dare game.

johnnyk022181

  • Posts: 75
How do I install this extension?

rob1221

  • *
  • Posts: 8866
Settings > Extensions > Install Extension

johnnyk022181

  • Posts: 75
I tried numerous times on two different computers and nothing.  Are you sure your zip file contains all needed data? 

rob1221

  • *
  • Posts: 8866
It should.  What OS and what Stencyl version are you using?

johnnyk022181

  • Posts: 75
Windows 8 and Stencyl 3

johnnyk022181

  • Posts: 75
I found an article that said the following things are included in an Extension:

1.blocks.xml - Defines custom blocks. More powerful than the in-editor custom blocks.
2.icon.png - 32x32 PNG icon
3.include.nmml - Specifies stuff for native extensions. If it’s a cross-platform (pure Haxe) extension, leave it as-is.
4.info.txt - Various metadata for the extension. All fields are required.
5.Source files and DLL’s - the meat of the extension

Your zip file doesn't include #5.

rob1221

  • *
  • Posts: 8866
Quote
Stencyl 3
From which download date?

I don't know why the import option isn't working, but you can drag the folder into plaf/haxe/extensions.

Quote
Your zip file doesn't include #5.
That isn't needed.

johnnyk022181

  • Posts: 75
That worked.  I enabled it.  Now what?  lol..  sorry, i'm new at the extension stuff...  How do I use it?  I am desperate to see if it works, because nobody can seem to help me with the glitchy movement of my actor.