How would I make them follow the mouse?
LtqxWYEG opened this issue · 5 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
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.
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
Wdym? Did you do that already? I'm still trying.