Simple minigames (Screen Language only).

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Message
Author
User avatar
Alex
Eileen-Class Veteran
Posts: 1998
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Simple minigames (Screen Language only).

#61 Post by Alex » Thu Jun 14, 2018 2:53 pm

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?

LiveTurkey
Regular
Posts: 99
Joined: Tue Dec 27, 2016 10:50 pm
Location: Brooklyn
Contact:

Re: Simple minigames (Screen Language only).

#62 Post by LiveTurkey » Mon Jul 16, 2018 12:16 pm

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?

User avatar
Alex
Eileen-Class Veteran
Posts: 1998
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Simple minigames (Screen Language only).

#63 Post by Alex » 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.

LiveTurkey
Regular
Posts: 99
Joined: Tue Dec 27, 2016 10:50 pm
Location: Brooklyn
Contact:

Re: Simple minigames (Screen Language only).

#64 Post by LiveTurkey » Mon Jul 16, 2018 12:40 pm

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.

User avatar
Alex
Eileen-Class Veteran
Posts: 1998
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Simple minigames (Screen Language only).

#65 Post by Alex » Mon Jul 16, 2018 12:45 pm

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...))

LiveTurkey
Regular
Posts: 99
Joined: Tue Dec 27, 2016 10:50 pm
Location: Brooklyn
Contact:

Re: Simple minigames (Screen Language only).

#66 Post by LiveTurkey » Tue Jul 17, 2018 1:50 pm

Are we allowed to use this code in commercial projects? Any specific attribution required?

User avatar
Alex
Eileen-Class Veteran
Posts: 1998
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Simple minigames (Screen Language only).

#67 Post by Alex » Tue Jul 17, 2018 3:40 pm

Yes, this code samples are free to use (as is or modified) for any project (comercial or not).

Rakuran
Newbie
Posts: 5
Joined: Fri Aug 10, 2018 9:16 pm
Contact:

Re: Simple minigames (Screen Language only).

#68 Post by Rakuran » Wed Aug 15, 2018 11:58 am

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).

Rakuran
Newbie
Posts: 5
Joined: Fri Aug 10, 2018 9:16 pm
Contact:

Re: Simple minigames (Screen Language only).

#69 Post by Rakuran » Wed Aug 15, 2018 4:49 pm

Nevermind, solved it using an extra list :3

User avatar
Alex
Eileen-Class Veteran
Posts: 1998
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Simple minigames (Screen Language only).

#70 Post by Alex » Wed Aug 15, 2018 5:33 pm

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).

Rakuran
Newbie
Posts: 5
Joined: Fri Aug 10, 2018 9:16 pm
Contact:

Re: Simple minigames (Screen Language only).

#71 Post by Rakuran » Wed Aug 15, 2018 7:31 pm

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]} )

User avatar
enrohk
Newbie
Posts: 11
Joined: Tue Jun 19, 2018 6:32 pm
Location: Spain
Contact:

Re: Simple minigames (Screen Language only).

#72 Post by enrohk » Wed Sep 12, 2018 11:52 pm

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 !
Do I live in a friendly or a hostile universe? Which is it? Is it a universe that is filled with hostility and anger and people wanting to hate each other and people wanting to kill each other, is that what you see?Because when you see the world that way that’s exactly what you will create for yourself in your life.

User avatar
Alex
Eileen-Class Veteran
Posts: 1998
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Simple minigames (Screen Language only).

#73 Post by Alex » Thu Sep 13, 2018 5:26 pm

I'm glad it was useful for you. Good luck with you project...;)

Post Reply

Who is online

Users browsing this forum: No registered users