Mouse support

201 views
Skip to first unread message

zaraw...@gmail.com

unread,
Sep 26, 2017, 4:19:53 PM9/26/17
to PuzzleScript
I've made a branch of the Puzzlescript code that adds mouse support.

branch if you want to test:
https://github.com/zarawesome/PuzzleScript/tree/mouse_action

instructions:

prelude command mouse_action enables mouse actions

clicking on a tile will turn on the flag ACTION on every object in that tile (player or not) and then run a turn of the game

so, for example, adding this rule to stephen's basic crate game will create crates wherever you click

[ action Background ] -> [ Background Crate ]

if the game is in realtime and throttle_movement is enabled, clicking will not create extra turns, it will wait for the next realtime turn

an example that is overly complicated because it's adapted from the keyboard version:
https://zaratustra.itch.io/candy-crunch-legend

Hand-E-Food

unread,
Sep 26, 2017, 8:42:56 PM9/26/17
to PuzzleScript
Very nice!

I found one small bug.  Clicking doesn't create a new undo state.  If you press undo, it undoes the last keyboard action.


You can use the editor directly on GitHub at:


zaraw...@gmail.com

unread,
Sep 27, 2017, 4:37:07 AM9/27/17
to PuzzleScript
Thanks for both items of information!

Will look at that, along with updated title screen info and support for mobile.
Message has been deleted

zaraw...@gmail.com

unread,
Sep 27, 2017, 4:17:43 PM9/27/17
to PuzzleScript
Changes:

- Fixed the undo issue Hand-E-Food found
- title screen has different text if mouse_action is added
- tentative mobile support that I haven't tested
- Added a "undo" action similar to "cancel" and "restart" - that way you can have a clickable undo button in the game if you so wish

Skalmantas Šimėnas

unread,
Sep 28, 2017, 8:10:56 AM9/28/17
to PuzzleScript
Pretty cool but I can't get the editor to work for me :/
The Candy Crunch thing works just fine but I can't seem to be able to make the clicks work in the editor even though I've added mouse_action and the title screen says "mouse or touch to play"

Skalmantas Šimėnas

unread,
Sep 28, 2017, 8:13:18 AM9/28/17
to PuzzleScript
Forgot to mention: pressing Share and opening the play window in an another tab with the same "htmlpreview" thing appended to the beginning also doesn't make it work. (it might be an htmlpreview thing, though)

zaraw...@gmail.com

unread,
Sep 28, 2017, 2:10:54 PM9/28/17
to PuzzleScript
Apologies, I submitted some fixes that broke things. Now I fixed the fixes.

Skalmantas Šimėnas

unread,
Sep 28, 2017, 2:39:24 PM9/28/17
to PuzzleScript
Yeah, that happens all the time for me.

Skalmantas Šimėnas

unread,
Sep 28, 2017, 7:23:55 PM9/28/17
to PuzzleScript
I am having way too much fun with this! I already had a small working game that could've used mouse input and now it feels much better, here it is: LMIO Arka

First and foremost, I have to report a bug: if flickscreen is set up, you will still be able to click tiles that are outside of the rendered area. This mostly affects the editor and not so much the playable build but I could reproduce it in both cases with my game.
One feature request would be being able to hold down mouse button to draw over several tiles. I know the level editor can do this so maybe the game could have the option, too?

Today I've also learnt that Background is an actual object in puzzlescript and that you can delete it and the background will just... disappear from that tile. I mean, this is expected for normal objects but I had no clue it also applies to the Background object.

Hand-E-Food

unread,
Sep 29, 2017, 12:18:10 AM9/29/17
to PuzzleScript
LMIO Arka doesn’t work for me on mobile. It doesn’t seem to respond no matter where I tap. I’ll try it on a Desktop later on.

Yeah, The Background object is interesting. If you remove some, they even respond to movement and action. I often use them to keep state in the middle of a turn. I always thought is was a bit odd that you could never put anything else in the Background layer, not even other background objects.



Skalmantas Šimėnas

unread,
Sep 29, 2017, 2:02:34 AM9/29/17
to PuzzleScript
It seems it does work for me on mobile but it's extremely zoomed out and there's no way I can hit the tile I want to hit, so yeah, maybe on a tablet but definitely not on a phone.
Reply all
Reply to author
Forward
0 new messages