Python Forum
how to make the movement humanized
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to make the movement humanized
#1
this code makes the mouse move using mouse_event for certain angles, but the movement is very robotic, I would like to make the movement humanized, how can I do that?
weapons = [
        {
            "name":"XSW",
            "rpm":600,
            "magazine": 30,
            "img_name":"t_ak.png",
            "img": None,
            "x":1,
            "y":1,
            "pattern":[ (0,0),(0,28),(1,38),(3,47),(8,57),
                        (16,57),(13,53),(0,33),(-24,24),(-38,12),
                        (-34,6),(-25,10),(-18,4),(-18,2),(10,8),
                        (33,4),(41,10),(47,10),(42,0),(28,-5),
                        (8,1),(-4,5),(-1,9),(4,8),(5,6),
                        (-2,3),(-27,-2),(-51,-12),(-58,-14),(-56,-15) ]
        },
Reply
#2
What is being done with the numbers in "pattern"? Are they added to something or are they coordinates?
Reply
#3
is coordinates
Reply
#4
By "humanized" do you mean jerky? sloppy? erratic? Do you just want the mouse to move smoothly from point to point instead of jumping from point to point to point. Do you want the mouse movement to have rounded corners?

If you want smooth motion between points you just need more points you should look at scipy interp1d. If you want interpolation with smoothed corners look at scipy spline interpolation. Both are discussed here:

https://docs.scipy.org/doc/scipy/tutoria...olate.html
Reply
#5
I've used pytweening in the past when I was following a tutorial. I learned from it. Look at this video for visual explanation of interpolation/tweening and see if that suits you.

https://www.youtube.com/watch?v=5WWvqOgQTcY
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to get continuous movement whilst using State Machine cjoe1993 2 1,818 Dec-10-2020, 06:36 AM
Last Post: cjoe1993
  Moving mouse so that games can detect movement SheeppOSU 2 1,944 Jun-09-2020, 07:23 PM
Last Post: SheeppOSU
  need help on solving and movement Tankey2630 1 1,678 Jan-09-2020, 11:04 AM
Last Post: Tankey2630
  Count to movement according to the time pressed button noartist 1 2,512 Feb-27-2019, 01:33 PM
Last Post: noartist
  movement in a zigzag in a 2d array ShakeDat53 1 2,850 Aug-17-2018, 08:22 PM
Last Post: ichabod801
  Can't change Right to left id spawning/ movement to top to bottom Kingrocket10 3 3,801 Dec-14-2017, 11:05 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020