Hello there!
As my first bubble project, I’m building a simple game.
First, the users choose between to categories of cards and after clicking on one category, they are being directed to another page where a rondaom card from this category is shown to them. As the game continues, the cards already used shouldn’t be shown again.
The game is over after 20 rounds.
I’ve set up a datatype for each category of cards with the card as image and a field “dealt y/n”.
I’m stuck at the point where I’m trying to insert the cards as dynamic data in a image element in the UI builder.
I’ve selected dynamic image> insert data > search for > (next dialogue) type: ctioncard > condition “dealt=no” > sort by “random sorting” (Screenshot 1)
After closing the sub-dialgoue, it wants me to add something more to the dynamic image field (see screenshot). If I don’t add anything, it shows me “dynamic data in text boxes must be prinatble text” - but I’ve actually used an image as a box… (see screenshot 2).
Could you assist me on how to solve this - how can I achieve what I’m describing above (incl. the workflow to set the field “dealt” to yes once a card has been used)?
Ideally also the counting the rounds part to determine the end.
Instead of doing the search for the image, you probably need to display the whole element on the screen in a group and then refer to the element that way. Then you can do more with it then just displaying the image like marking it as been ‘dealt’. Does that make sense? I might be able to give you an example.
It’s hard to tell what is missing if we can’t see everything. So in my example, the workflow is the part that does the ‘random sorting’ then first item. I can’t see what you have with the Search since I can’t see it in your screenshot.
Do you have anything showing up on your screen yet? Let me know.
It is just the way I chose to display it on the page. That is the one that is being displayed at the top of the page. You can do it a different way, that I just the way I decided to do it.
thanks!
I just figured out that the images I had uploaded to my database somehow “broke” - that was the reason why nothing was displayed… Hope this can be avoided in the future.
thank you so much @J805 ! that was very helpful
Do you maybe have a tip how i can integrate a counter / basically make a pop-up show up after 20 rounds asking whether they want to continue the game?
Hmm . Good question. I am sure there are many ways to do this. One way I was thinking, you can always do a count on how many cards have been dealt and then use modulo to detect if it is divisible evenly by 20.
... <- modulo -> ...
Returns the remainder when the first number is divided by the second number. For example, '5 <- modulo -> 2' becomes '1.'
Tip: Use this to figure out if a number is odd or even.
thank you! I’ll try that tomorrow.
I just cloned the page for the cards since I have a the exact same process to implement for another category of cards - I exchanged the respect names and checked if my data base is fine. Now, the card’s don’t show up on this page again. Strangely the first time, I saw a card shoing up for a second and then it broke and all is blank. strange
But this can’t have anything to do with me cloning the page, can it?