code: pastebin.com/L... the icon of the timer at 3:45 : www.svgrepo.co... svgrepo is a place to download free SVG vectors and icons for commercial use, check them out!
An additional check for testing whether an input is a tap is to test how far the mouse is moved from the point of the initial press. That is, only consider an input to be a tap if the release was close to the initial press. This way, players who are just trying to play the game very quickly won't be annoyed by the game thinking they did a tap when they already moved the card halfway over the scene to where they wanted it to go.
just a thought: what if you just set object to picked at the button down event right away in any case, and just ignore any button up events before timer runs out this way if you hold it and release button after timer, its working, and if you tap it and tap again after timer runs out, the second tap button up event will trigger release you can't drop the object during timer anyway
Wildfrost was made in Unity, Unity has built in interfaces for checking if a UI element was clicked or dragged so that's how they would have achieved this
I've been a Unity dev for 5 years and the recent events surrounding the engine have me looking into Godot as an alternative, so far its been relatively smooth transitioning to the new engine but I do wish Godot had more UI features, your video has given me some ideas for implementing a similar UI event system that Unity has into Godot
I would assume Wildfrost is using 2D assets in 3D space, so they are “actually” being flipped. But you can accomplish a similar effect in 2D by animating a card back sprite’s scale.x to 0 and a card front sprite’s scale.x to 1. I do something like that in Godot using Tween methods to get the timing right, it’s pretty effective.
I think it work to remove the 0.1s lag func _on_pressed() -> void: if not picked_up : picked_up = true $Timer.start() await mouse_released if $Timer.is_stopped() : picked_up = false else : picked_up = false
An additional check for testing whether an input is a tap is to test how far the mouse is moved from the point of the initial press. That is, only consider an input to be a tap if the release was close to the initial press. This way, players who are just trying to play the game very quickly won't be annoyed by the game thinking they did a tap when they already moved the card halfway over the scene to where they wanted it to go.
Clever construct. Thanks for the ideas.
I liked this tutorial very good explained and I will implement it in my card game
thanks this was a great help to me :D
High quality video, Thanks
just a thought:
what if you just set object to picked at the button down event right away in any case, and just ignore any button up events before timer runs out
this way if you hold it and release button after timer, its working, and if you tap it and tap again after timer runs out, the second tap button up event will trigger release
you can't drop the object during timer anyway
hey that sounds good, i should try that out
Treasure channel!
excellent tutorial well made and vary informative. going to work this into my game 🙂
Wildfrost was made in Unity, Unity has built in interfaces for checking if a UI element was clicked or dragged so that's how they would have achieved this
ah i thought the devs did this themselves lol, thanks for telling!
I've been a Unity dev for 5 years and the recent events surrounding the engine have me looking into Godot as an alternative, so far its been relatively smooth transitioning to the new engine but I do wish Godot had more UI features, your video has given me some ideas for implementing a similar UI event system that Unity has into Godot
Nice Sulotion, Thank you!
Please make a complete course for a card game!!
I want that swinging thing so badly
me : haha babies are so silly, amused by things being dangly
me when the game has visual feedback : me want shiny dangly NOW
Woah, how did you do those flip effects at 0:09? I thought you couldn't flip in 2d?
thats a game called WildFrost im playing, i didnt make it
I would assume Wildfrost is using 2D assets in 3D space, so they are “actually” being flipped. But you can accomplish a similar effect in 2D by animating a card back sprite’s scale.x to 0 and a card front sprite’s scale.x to 1. I do something like that in Godot using Tween methods to get the timing right, it’s pretty effective.
Regarding the tap to drag, why not just use the built-in Toggle Mode? does it have a downside or something?
going to try that out. will get back to you
couldnt think of a way to make it adaptable, maybe if tap/hold is an explicit option in the settings of the game it would work?
l like it!that's very helpful.Can l share your video to other web with link?
sure! may i ask where?
@@ciosai_tw The website in China is called Bilibili😀
@@cq7743 沒問題,不過華語區真的有人要看godot嗎?
@@ciosai_tw 有的。在國內的網站上,關於Godot的資源不多,有時找不到想要的訊息,所以我選擇自己學習的同時搬運視頻,幫助更多的人解決他們的問題
I think it work to remove the 0.1s lag
func _on_pressed() -> void:
if not picked_up :
picked_up = true
$Timer.start()
await mouse_released
if $Timer.is_stopped() :
picked_up = false
else :
picked_up = false
oh that looks good!