PyNBoids icon indicating copy to clipboard operation
PyNBoids copied to clipboard

How would I make them follow the mouse?

Open LtqxWYEG opened this issue 3 years ago • 6 comments

Hi :)

I would love to borrow your code to use in my program that I write for learning purposes only. There, stuff is following the mouse cursor on screen.
You implementation of boids looks very nice and seems also very performant. Now, your code isn't the easiest to read. Much math. Very complex. Variables have names like: "tAvejAng". What's that? Time-average-junction-angle? xD Edit: Well I know have "targetAverage_j_Angle" and that basically represents my understanding of your code.

I like the new stuff I learn from your code: self.boidSize = 22 if isFish else 17 and if (neighborCount := len(neighborBoids)) > 1: I didn't know about that.. :)

I generally know how to get and use the mousecursor postion and speed. The only issue is that it seems like the movement is all random, that there is no destination I could hijack. The destination is some ephemeral "where the most boids are", I guess. Maybe... it's so hard to read xD

Can you give me a hint where to start?

I hope you'll see this in due time. But if not, thenn I have to figure it out. Maybe I start by changing variable names. Thank you

LtqxWYEG avatar Jun 03 '22 12:06 LtqxWYEG

Discord would be nice. I don't have one, but there's always the Python discord. (Sorry for some reason I'm not getting notifications here. Need to check github settings.) edit: Yes, now I'll get notifications.

LtqxWYEG avatar Jun 10 '22 14:06 LtqxWYEG

Well, I've actually considered doing that in the past.. Although at the time, I figured it'd be a little tricky to do with my code, tho probably possible, and could require a little re-working of things. Sorry for my lack of comments in the code, and my variables being a little oddly named.. I'll certainly have to do another update soon, to try and clean things up, and put in more detailed comments. It's been about a year since I've worked on this in much detail, so I may be a little rusty with my explanations, tho if you'd like to chat over Discord sometime, my username is: Nikorasu#2462 And FYI, I'm not sure who Darius17TARS is.. lol

Nikorasu avatar Jun 10 '22 17:06 Nikorasu

Hi, im just a Random, i used your code as a sort of base/Inspiration for a school project of mine. I just wanted to help ;D

Nik @.***> schrieb am Fr. 10. Juni 2022 um 7:47 PM:

Well, I've actually considered doing that in the past.. Although at the time, I figured it'd be a little tricky to do with my code, tho probably possible, and could require a little re-working of things. Sorry for my lack of comments in the code, and my variables being a little oddly named.. I'll certainly have to do another update soon, to try and clean things up, and put in more detailed comments. It's been about a year since I've worked on this in much detail, so I may be a little rusty with my explanations, tho if you'd like to chat over Discord sometime, my username is: Nikorasu#2462 And FYI, I'm not sure who Darius17TARS is.. lol

— Reply to this email directly, view it on GitHub https://github.com/Nikorasu/PyNBoids/issues/1#issuecomment-1152597482, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWUHLP3DUCCS2OWM5URBKUDVON5UPANCNFSM5XYNA62A . You are receiving this because you commented.Message ID: @.***>

Darius17TARS avatar Jun 13 '22 07:06 Darius17TARS

Wdym? Did you do that already? I'm still trying.

LtqxWYEG avatar Jun 13 '22 09:06 LtqxWYEG

I did other thing but I think I could help you to make your project, if you and the original creator don’t mind. My discord is: T A R S#3070 I have some ideas

LtqxWYEG @.***> schrieb am Mo. 13. Juni 2022 um 11:20 AM:

Wdym? Did you do that already? I'm still trying.

— Reply to this email directly, view it on GitHub https://github.com/Nikorasu/PyNBoids/issues/1#issuecomment-1153681451, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWUHLP7BNMADXIKALMJR6CTVO34PJANCNFSM5XYNA62A . You are receiving this because you commented.Message ID: @.***>

Darius17TARS avatar Oct 11 '22 08:10 Darius17TARS