How to use the ninja.Opts.is_commander.value function in ninja

To help you get started, we’ve selected a few ninja examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adangert / JoustMania / ninja.py View on Github external
if sum(force_color) != 0:
            no_rumble_time = time.time() + 5
            time.sleep(0.01)
            move.set_leds(*force_color)
            move.update_leds()
            move.set_rumble(0)
            no_rumble = time.time() + 0.5
        #if we are not dead
        elif dead_move.value == 1:
            if move.poll():
                ax, ay, az = move.get_accelerometer_frame(psmove.Frame_SecondHalf)
                total = sum([ax, ay, az])
                if move_last_value is not None:
                    change = abs(move_last_value - total)

                    if move_opts[Opts.is_commander.value] == Bool.no.value:
                        warning = FAST_WARNING
                        threshold = FAST_MAX
                    else:
                        #if affected by overdrive, this could make the power better
                        warning = SLOW_WARNING
                        threshold = SLOW_MAX
                        

                    if change > threshold:
                        if time.time() > no_rumble:
                            move.set_leds(0,0,0)
                            move.set_rumble(90)
                            dead_move.value = 0
                            time_of_death = time.time()

                    elif change > warning:

ninja

Ninja is a small build system with a focus on speed

Apache-2.0
Latest version published 1 year ago

Package Health Score

83 / 100
Full package analysis