I’m a tabletop game dev and hobbyist programmer; I spend some of my coding free time making prototypes and tutorials for how to digitize card and board games.
I’ve been looking into Defold for a long time now (coming from Phaser/JS and Unity/C#), and curious about a few things as I get my feet wet:
Would Defold-Input be the optimal library for handling simple drag-and-drop operations of cards and board tokens? And if so, is there a way to import the Git examples into my project in addition to the scripts? I’m currently only able to import the “in” folder as a dependency.
Is there an example of a “dropzone” that one could use to detect whether a card or board token is over a particular set of coordinates, and therefore droppable? I found this thread but am unsure whether something like this has already been created.
Is using Nakama the preferred workflow for implementing multiplayer in Defold? I’ve been using Socket.IO in tandem with Phaser, and Mirror in Unity, and it would be nice to use something that has a similar feature set.
Defold-input can definitely be used as a starting point for card games with picking of cards, dragging and dropping etc.
If you want to add the examples as well you need to manually copy those files to your project. If you add it as a dependency you only get the exported “in” folder.
I would create the drop zone using a collision objects of the type “trigger” and use it while dragging a card to detect when a dragged card is over the drop zone.
I can create an example of this is you like. Please create a ticket on GitHub in the Defold-input repository.
Nakama is great for quickly setting up match making and launching a game. Once a match is established you can either use client authoritative multiplayer or use for instance Lua server code for server authoritative multiplayer.
I’m getting blurry textures on cards as their resized upon creation, and followed the steps in this thread: Blurry sprites depending on scale - #7 by Pkeod. This seems to work, but I’m not able to save the texture profile for some reason (the default.texture_profiles tab name has an asterisk in front of it no matter how I save). What might I be doing wrong?
Is there a way, while using the cursor to drag, to keep the dragged game object on top of all others? I’ve tried changing the z position within the cursor.DRAG block:
elseif message_id == cursor.DRAG then
print("Drag", message.id, message.group, message.x, message.y, message.dx, message.dy)
local p = go.get_position(message.id)
go.set_position(vmath.vector3(p.x, p.y, 1), message.id)
end