File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,13 +380,41 @@ namespace microcode {
380380 control . onEvent (
381381 ControllerButtonEvent . Pressed ,
382382 controller . up . id ,
383- ( ) => this . context [ 0 ] = Math . min ( this . context [ 0 ] + 10 , this . maximum )
383+ ( ) => {
384+ let tick = true ;
385+ control . onEvent (
386+ ControllerButtonEvent . Released ,
387+ controller . up . id ,
388+ ( ) => tick = false
389+ )
390+
391+ // Control logic:
392+ while ( tick ) {
393+ this . context [ 0 ] = Math . min ( this . context [ 0 ] + 10 , this . maximum )
394+ basic . pause ( 100 )
395+ }
396+ control . onEvent ( ControllerButtonEvent . Released , controller . up . id , ( ) => { } )
397+ }
384398 )
385399
386400 control . onEvent (
387401 ControllerButtonEvent . Pressed ,
388402 controller . down . id ,
389- ( ) => this . context [ 0 ] = Math . max ( this . context [ 0 ] - 10 , this . minimum )
403+ ( ) => {
404+ let tick = true ;
405+ control . onEvent (
406+ ControllerButtonEvent . Released ,
407+ controller . down . id ,
408+ ( ) => tick = false
409+ )
410+
411+ // Control logic:
412+ while ( tick ) {
413+ this . context [ 0 ] = Math . max ( this . context [ 0 ] - 10 , this . minimum )
414+ basic . pause ( 100 )
415+ }
416+ control . onEvent ( ControllerButtonEvent . Released , controller . down . id , ( ) => { } )
417+ }
390418 )
391419 }
392420
You can’t perform that action at this time.
0 commit comments