Was collecting scripts and came across Glitchfinder's keyboard and mouse input systems.
Difficulty: easy
Engines: XP, VX
Scripts required:
Keyboard Input,
Mouse input.
Switches: none
Variables: none
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.
Concept:
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:
CODE
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.
CODE
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>
else
<what happens when you miss it>
branch end
else
<leave this empty, otherwise it'll always run since you probably aren't clicking your mouse>
branch end
Examples:
When you click on the event, you receive 1000 gold. If you miss, you exit the map.