Was collecting scripts and came across Glitchfinder's keyboard and mouse input systems.
Engines: XP, VX
Scripts required: Keyboard Input
, Mouse input
Common events: none
Note that these values are based on a minimalistic design.
If you're making a mini-game that is contained in a single map, consider using map variables
. That way, you can copy it into another project and not have to worry about variable conflicts.
There's an event on the map. When you click on the event, something will happen.
It's a very general idea with plenty of applications.
The key idea behind these events is to use the following script in a conditional branch:
Mouse.press?(1) and Mouse.tile_pos == [$game_map.events[@event_id].x, $game_map.events[@event_id].y]
That just means when you click the left button on the event (specifically, it checks whether the position of your cursor is the same as the position of the event). I'm not sure if there's an easier way to get the x,y position of an event.
If it's true, you would just fill in what's supposed to happen when you click on the event successfully.
Additionally, you can separate it into nested conditional branches if you want to specify what happens if you miss the target.
Conditional Branch: Script: Mouse.press?(1)
Conditional Branch: Script: Mouse.tile_pos == [$game_map.events[@event_id].x, $game_map.events[@event_id].y]
<what happens when you click on it>
<what happens when you miss it>
<leave this empty, otherwise it'll always run since you probably aren't clicking your mouse>
When you click on the event, you receive 1000 gold. If you miss, you exit the map.