• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Mining Game Mouse Function

v20.1 Mining Game Mouse Function 2023-03-30

This resource pertains to version 20.1 of Pokémon Essentials.
Pokémon Essentials Version
v20.1 ➖

Just what it says on the tin!​

Can be downloaded as a plugin here or added directly to the scripts.
Find this line in Minigame_Mining -
Ruby:
if Input.trigger?(Input::UP) || Input.repeat?(Input::UP)
And replace it with this:
Ruby:
      if System.mouse_in_window
        if Input.mouse_x.between?(0,BOARD_WIDTH*32) && Input.mouse_y.between?(64,64+BOARD_HEIGHT*32) #Mouse is on board
          x = Input.mouse_x/32
          y = Input.mouse_y/32
          y -= 2
          newpos = x + y*BOARD_WIDTH
          @sprites["cursor"].position = newpos
          pbHit if Input.trigger?(Input::MOUSELEFT)
        elsif Input.mouse_x.between?(428,508) #mouse is by tool icons
          if Input.mouse_y.between?(98,216) #mouse is by hammer
            if Input.trigger?(Input::MOUSELEFT)
              pbSEPlay("Mining tool change")
              newmode = 1
              @sprites["cursor"].mode = newmode
              @sprites["tool"].src_rect.set(newmode * 68, 0, 68, 100)
              @sprites["tool"].y = 254 - (144 * newmode)
            end
          elsif Input.mouse_y.between?(242,360) #mouse is by pick
            if Input.trigger?(Input::MOUSELEFT)
              pbSEPlay("Mining tool change")
              newmode = 0
              @sprites["cursor"].mode = newmode
              @sprites["tool"].src_rect.set(newmode * 68, 0, 68, 100)
              @sprites["tool"].y = 254 - (144 * newmode)
            end
          end
        end
      elsif Input.trigger?(Input::UP) || Input.repeat?(Input::UP)
Credits
Credit to TechSkylander1518, please!
  • Like
Reactions: MickTK and -FL-
Author
TechSkylander1518
Downloads
528
Views
1,774
First release
Last update
Rating
5.00 star(s) 2 ratings

More resources from TechSkylander1518

Back
Top