I'm making a cardgame and I'm stuck at something that seemed easy in my head (and is probably, for most of you).
Basically, I want 6 cards to be aligned so the player can choose 3 so reveal their values. Once he chose those, the other 3 become unclickable and he must pick one of the 3 cards he revealed.
Here, an example with 3 cards.
I have several problems :
- 1 - I want those imagebuttons to appear one after the other. The only solution I found is to put them in different screens, which I know is not ideal. I then "show" the screens one after the other with "pause" in between.
Code: Select all
label start:
e "start"
show screen card_malus with dissolve
pause 0.5
show screen card_malus_2 with dissolve
pause 0.5
show screen card_malus_3 with dissolve
pause
e "end"
return
- 2 - Using several screens, I can't use the "call" command, as only the 1st screen would appear before I click on it. So using "show", the buttons appear and are useable, except the game doesnt care if the player use the buttons or not and jump to the next line of dialogue if they click somewhere else.
I suppose the solution would be to call a screen with all the buttons but
==> I have no idea how to make them appear one after the other and
==> I tried it first and the screen obviously disappeared after clicking on 1 single button.
Last thing, is it possible to explain how I can make the buttons unclickable once the player clicked on 3 of them ?
Sorry to bother. I don't think my code will be useable at all, as it's very barebone and I'm myself ashamed of it, but here's the full thing :
Code: Select all
default card_malus_1 = False
default card_malus_2 = False
default card_malus_3 = False
default card_malus_count = 0
label start:
e "start"
show screen card_malus with dissolve
pause 0.5
show screen card_malus_2 with dissolve
pause 0.5
show screen card_malus_3 with dissolve
pause
e "end"
return
screen card_malus:
if not card_malus_1:
imagebutton:
focus_mask True
xpos 200
ypos 100
idle "cardgame/card_poison_recto.png"
action [SetVariable("card_malus_1", True), SetVariable("card_malus_count", card_malus_count + 1)]
else:
imagebutton:
focus_mask True
xpos 200
ypos 100
idle "cardgame/card_poison_verso_1.png"
screen card_malus_2:
if not card_malus_2:
imagebutton:
focus_mask True
xpos 400
ypos 100
idle "cardgame/card_poison_recto.png"
action [SetVariable("card_malus_2", True), SetVariable("card_malus_count", card_malus_count + 1)]
else:
imagebutton:
focus_mask True
xpos 400
ypos 100
idle "cardgame/card_poison_verso_2.png"
screen card_malus_3:
if not card_malus_3:
imagebutton:
focus_mask True
xpos 600
ypos 100
idle "cardgame/card_poison_recto.png"
action [SetVariable("card_malus_3", True), SetVariable("card_malus_count", card_malus_count + 1)]
else:
imagebutton:
focus_mask True
xpos 600
ypos 100
idle "cardgame/card_poison_verso_3.png"