Page 5 of 9

Re: Simple minigames (Screen Language only).

Posted: Thu Jun 14, 2018 2:53 pm
by Alex
Hello~
Hm, so what's the problem with timer? Is it work at all, if so then what it did wrong? And what's the code you have?

Re: Simple minigames (Screen Language only).

Posted: Mon Jul 16, 2018 12:16 pm
by LiveTurkey
I have strange bug where only something like 5-10% of my clicks register for the memory game. I will keep clicking and clicking random cards and eventually one of them will turn over. It seems to be completely random.

This problem doesn't occur when I do text mode. The game works perfectly in text mode. But in image mode, it seems to completely break down. Any idea why this is happening?

EDIT: I read through the thread and it turned out someone else has my exact same problem
Xerofit51 wrote: Sun Oct 08, 2017 10:11 am Thanks, however I'm experiencing a weird issue with the memory game, if I use images, I need to click the very top part of the card for the card to be selected, if I click the middle or the bottom area the card isn't selected?
So it turns out it isn't random but when I was randomly clicking all over the cards, it only activated when I clicked the very top.

They solved it by changing the gui.button height.
Xerofit51 wrote: Tue Oct 10, 2017 10:36 pm
Edit : it seems to have something to do with the new GUI since when I used the legacy one it turned out to work fine. All I had to do was change the gui.button height. Thanks anyway!
Where is the gui.button height variable, do you know? I found 10 or so lines with "gui.button_properties()" in the screens file but which do I change and how do I change the height specifically? Also, do you happen to know what the implications of this bug is / why it's happening?

Re: Simple minigames (Screen Language only).

Posted: Mon Jul 16, 2018 12:36 pm
by Alex
Oh, well while I tried to quote Xerofit51's post you've found it yourself. Try to set height property for the buuton in memo_scr screen.

Re: Simple minigames (Screen Language only).

Posted: Mon Jul 16, 2018 12:40 pm
by LiveTurkey
Alex wrote: Mon Jul 16, 2018 12:36 pm Oh, well while I tried to quote Xerofit51's post you've found it yourself. Try to set height property for the buuton in memo_scr screen.
I found it. In gui.rpy I changed

Code: Select all

define gui.button_height = 54
to

Code: Select all

define gui.button_height = None
That fixed the problem. Now everything works perfectly. Man I spent a lot of time wondering what I was doing wrong.

Re: Simple minigames (Screen Language only).

Posted: Mon Jul 16, 2018 12:45 pm
by Alex
LiveTurkey wrote: Mon Jul 16, 2018 12:40 pm I found it.
Glad you solve this.
Hee-hee, now I could quote both of you...))

Re: Simple minigames (Screen Language only).

Posted: Tue Jul 17, 2018 1:50 pm
by LiveTurkey
Are we allowed to use this code in commercial projects? Any specific attribution required?

Re: Simple minigames (Screen Language only).

Posted: Tue Jul 17, 2018 3:40 pm
by Alex
Yes, this code samples are free to use (as is or modified) for any project (comercial or not).

Re: Simple minigames (Screen Language only).

Posted: Wed Aug 15, 2018 11:58 am
by Rakuran
Hi Alex! Thanks for the codes!
My question is: can I make Memoria game match two images, which are different? (for example: there is a card with an image of something and the corresponding card would be with what is this thing called, so there is a need of two separate images for one pair of cards).

Re: Simple minigames (Screen Language only).

Posted: Wed Aug 15, 2018 4:49 pm
by Rakuran
Nevermind, solved it using an extra list :3

Re: Simple minigames (Screen Language only).

Posted: Wed Aug 15, 2018 5:33 pm
by Alex
Rakuran wrote: Wed Aug 15, 2018 4:49 pm Nevermind, solved it using an extra list :3
Not sure about extra list, but you can add another key (like 'c_img') for card description in a 'cards_list', so cards with the same 'c_value' might have different images set by 'c_img'. Then show the cards images in 'memo_scr' screen using this new key 'c_img'.
Like

Code: Select all

image apple:
    "apple.png"
image pear:
    "pear.png"
in 'memo_scr'

Code: Select all

add card["c_img"]    # will show image

Code: Select all

label memoria_game:
    $ cards_list = [
{"c_number":0, "c_value": 'A', 'c_img":'apple', "c_chosen":False},
{"c_number":1, "c_value": 'A', 'c_img":'pear', "c_chosen":False},
]
should work (I hope).

Re: Simple minigames (Screen Language only).

Posted: Wed Aug 15, 2018 7:31 pm
by Rakuran
Yup yup, I used another key in there too. And a sort-of-case (match_names), to help with creating name list after shuffling the value one. Everything works fine c:

Code: Select all

    $ values_list = cards_shuffle(values_list)
    $ name_list = []

    python:
        for i in range (0, len(values_list)):
            name_list.append(match_names(values_list[i]))
    $ cards_list = []
    python:
         for i in range (0, len(values_list) ):
             cards_list.append ( {"c_number":i, "c_value": values_list[i], "c_chosen":False, "c_name": name_list[i]} )

Re: Simple minigames (Screen Language only).

Posted: Wed Sep 12, 2018 11:52 pm
by enrohk
Your 1v1 battle game lead me to a full 1v1 combat system. Based on movements and some simple stats (Str, Dex and Def). I got tons of headaches trying to find a battle system and was really simple doing one using your template.

Thanks for those examples !

Re: Simple minigames (Screen Language only).

Posted: Thu Sep 13, 2018 5:26 pm
by Alex
I'm glad it was useful for you. Good luck with you project...;)

Re: Simple minigames (Screen Language only).

Posted: Mon Jan 14, 2019 6:48 am
by Bryy
Alex wrote: Sat Dec 12, 2015 8:25 pm Group battle game.
Thanks. We're currently doing a team based RPG combat system (with skills and such), but this framework will be a big help in figuring stuff out!

Re: Simple minigames (Screen Language only).

Posted: Wed Jun 26, 2019 6:50 pm
by bubski_sketches
Hey Alex!

I was wondering, how can I space out the cards so they don't overlap on the number game?

Thanks a bunch for making these by the way, your a lifesaver!