@@ -142,6 +142,14 @@ function menu_menu () {
142142 }
143143 move_till_not_touching ( sprite_cursor_pointer , sprite_menu_button , 0 , - 1 )
144144}
145+ function sprite_overlapping_kind ( sprite : Sprite , kind : number ) {
146+ for ( let value of sprites . allOfKind ( kind ) ) {
147+ if ( sprite . overlapsWith ( value ) ) {
148+ return true
149+ }
150+ }
151+ return false
152+ }
145153function buy_asic_menu ( ) {
146154 local_menu_options = [ "Cancel" ]
147155 if ( asic_count > 0 ) {
@@ -408,6 +416,8 @@ function enable_cursor (en: boolean) {
408416 } else {
409417 controller . moveSprite ( sprite_cursor_pointer , 0 , 0 )
410418 }
419+ sprite_cursor_pointer . setFlag ( SpriteFlag . Invisible , ! ( en ) )
420+ sprite_cursor . setFlag ( SpriteFlag . Invisible , ! ( en ) )
411421}
412422function make_menu_button ( ) {
413423 sprite_menu_button = sprites . create ( assets . image `menu_button` , SpriteKind . Shop )
@@ -525,6 +535,18 @@ game.onUpdate(function () {
525535 sprite_cursor . top = sprite_cursor_pointer . top
526536 sprite_cursor . left = sprite_cursor_pointer . left
527537} )
538+ game . onUpdate ( function ( ) {
539+ if ( controller . A . isPressed ( ) ) {
540+ sprite_cursor . image . replace ( 1 , 8 )
541+ sprite_cursor . image . replace ( 9 , 8 )
542+ } else if ( sprite_overlapping_kind ( sprite_cursor_pointer , SpriteKind . Thing ) || sprite_overlapping_kind ( sprite_cursor_pointer , SpriteKind . Shop ) ) {
543+ sprite_cursor . image . replace ( 1 , 9 )
544+ sprite_cursor . image . replace ( 8 , 9 )
545+ } else {
546+ sprite_cursor . image . replace ( 9 , 1 )
547+ sprite_cursor . image . replace ( 8 , 1 )
548+ }
549+ } )
528550game . onUpdateInterval ( 1000 , function ( ) {
529551 hash_per_sec = hash_count_per_sec
530552 hash_count_per_sec = 0
0 commit comments