Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

booping commenced #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

booping commenced #1

wants to merge 2 commits into from

Conversation

ventorvar
Copy link

This is not intended to actually be merged, as it's not a complete build environment

This is showcasing how you can quickly get some boop action by updating a few scripts

@krux702
Copy link

krux702 commented Aug 28, 2023

I noticed that the chaser function tended to lock up after a bit.. looking at the code, I think it's due to the time.ticks_ms() function wraps the counter after a period of time. Changing it to the following may be a better way of that part of the code, unsure if that's the actual cause or fix:

        if time.ticks_diff(self.next, time.ticks_ms()) <= 0:
            colour = self.badge.pallet[int(1024*random())][0]
            speed = (0.5-((random()-0.5)**2))*1.2*(1 if (random()>0.5) else 0)

            #                      0      1               2            3            4         5
            #                   colour  speed           position    life_rate      life      record 
            self.traces.append([colour, speed, float(random()*46), (random()*0.07), 1.0,  array.array("f", [0]*46)])
            self.next = time.ticks_add(time.ticks_ms(), int(random()*3500))

Also noticed one pixel on the badge's right ear also blushes with the boop feature. Changing the range from range(15) to range(1,15) fixes that.

@krux702
Copy link

krux702 commented Aug 28, 2023

Fix with the chaser function ended up being depending on the random number chose in the traces.append line, you could have traces which had exceptionally long lives. The fix is adding this after the append.

            # if traces are not dying off increase life_rate decay
            if len(self.traces) > self.max_traces:
                for i in range(len(self.traces)):
                    self.traces[i][3] += 0.01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants