95 mini game Renpy

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
bambino358
Regular
Posts: 26
Joined: Sat Apr 27, 2019 7:17 am
Contact:

Re: 14 mini games

#31 Post by bambino358 »

Hi,
I'm trying to use minigame Fable 2 and I have a question. How to make a point move faster?
The basic move is too slow for me so I would like to make it faster but have no idea how to do it.

This is my script:

Code: Select all

init 15 python:
    fable_minigame_bar = 0
    fable_minigame_score = 0
    fable_you_press_button = 0
init:
    transform fable_point_move(frp):
        subpixel True
        rotate_pad True
        align(0.5,-0.53)
        rotate frp
        
screen fable_2_minigame1:
    add "minigame/Fable_bar.png" align(0.5,0.5)
    add "minigame/Fable_point.png" at fable_point_move(fable_minigame_bar)
    text "[fable_minigame_score]" align(0.5,0.1)
    text "[fable_minigame_bar]" align(0.5,0.2)
    text "[fable_you_press_button]" align(0.5,0.3)
    
    if fable_minigame_bar >= -14 and fable_minigame_bar <= 14:
        key "K_SPACE":
            if fable_you_press_button == 0:
                if fable_minigame_score < 14:
                    action [SetVariable("fable_minigame_score", fable_minigame_score + 1), SetVariable("fable_you_press_button", fable_you_press_button + 1), Show("you_press_button_good")]
                else:
                    action Jump("end")
            elif fable_you_press_button == 1:
                action SetVariable("fable_minigame_score", fable_minigame_score + 0)
    else:
        key "K_SPACE" action [SetVariable("fable_minigame_score", 0), Show("you_press_button_bad")]
    
screen fable_timer_left:
    timer 0.00001 repeat True action [If(fable_minigame_bar >= -90, SetVariable("fable_minigame_bar", fable_minigame_bar - 1)),If(fable_minigame_bar == -90, Hide("fable_timer_left"), Show("fable_timer_right")), If(fable_minigame_bar == -90, SetVariable("fable_you_press_button", 0))]
screen fable_timer_right:
    timer 0.00001 repeat True action [If(fable_minigame_bar <= 90, SetVariable("fable_minigame_bar", fable_minigame_bar + 1)),If(fable_minigame_bar == 90, Hide("fable_timer_right"), Show("fable_timer_left")), If(fable_minigame_bar == 90, SetVariable("fable_you_press_button", 0))]
    
screen you_press_button_good:
    text "{color=#1e8e00}Good Work!{/color}" at fable_move_good
    timer 1.0 action Hide("you_press_button_good")
screen you_press_button_bad:
    #hbox at fable_move_bad:
    text "{color=#950000}Ups...\nTry Again.{/color}" at fable_move_bad
    timer 1.0 action Hide("you_press_button_bad")
transform fable_move_good:
    align(0.5,0.5)
    linear 0.05 zoom 1.3
    linear 0.5 zoom 1.0 alpha 0.0
transform fable_move_bad:
    align(0.5,0.5)
    linear 0.04 xalign 0.5
    linear 0.06 xalign 0.495
    linear 0.06 xalign 0.515
    linear 0.06 xalign 0.5
    linear 0.5 alpha 0.0
I tried to change the Timer but it doesn't seem to work...

Thank you

User avatar
Andredron
Miko-Class Veteran
Posts: 776
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: 14 mini games

#32 Post by Andredron »

Code: Select all

screen fable_timer_left:
    timer 0.00001 repeat True action [If(fable_minigame_bar >= -90, SetVariable("fable_minigame_bar", fable_minigame_bar - 1)),If(fable_minigame_bar == -90, Hide("fable_timer_left"), Show("fable_timer_right")), If(fable_minigame_bar == -90, SetVariable("fable_you_press_button", 0))]
screen fable_timer_right:
    timer 0.00001 repeat True action [If(fable_minigame_bar <= 90, SetVariable("fable_minigame_bar", fable_minigame_bar + 1)),If(fable_minigame_bar == 90, Hide("fable_timer_right"), Show("fable_timer_left")), If(fable_minigame_bar == 90, SetVariable("fable_you_press_button", 0))]
    


Speed

Code: Select all


screen fable_timer_left:
    timer 0.00001 repeat True action [If(fable_minigame_bar >= -100, SetVariable("fable_minigame_bar", fable_minigame_bar - 1)),If(fable_minigame_bar == -100, Hide("fable_timer_left"), Show("fable_timer_right")), If(fable_minigame_bar == -100, SetVariable("fable_you_press_button", 0))]
screen fable_timer_right:
    timer 0.00001 repeat True action [If(fable_minigame_bar <= 100, SetVariable("fable_minigame_bar", fable_minigame_bar + 1)),If(fable_minigame_bar == 100, Hide("fable_timer_right"), Show("fable_timer_left")), If(fable_minigame_bar == 100, SetVariable("fable_you_press_button", 0))]
    /code]
   
  
  90 and - 90 speed bar
 
 +1 - 1  size bar delit
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Sawa - a game of the Drow Nation

Honest Critique

Poses in visual novels, or how to hold a character properly in the frame

Help save articles to the webarchive. [/color]

Please save your projects on github, you would know how hard it is to find projects after 7 years...

bambino358
Regular
Posts: 26
Joined: Sat Apr 27, 2019 7:17 am
Contact:

Re: 14 mini games

#33 Post by bambino358 »

Thank you. Now I feel like an idiot :).

Anyway... It works. Great!

User avatar
sonictoad
Regular
Posts: 30
Joined: Tue Mar 12, 2019 10:39 pm
Projects: It's Different When It's Your Own
Organization: Sonic Toad Media LLC
itch: nyhcmaven84
Location: Bronx, NY
Contact:

Re: 16 mini game Renpy

#34 Post by sonictoad »

This is going to sound like a stupid question but--

I want to use that "Search for Items" minigame, first one in the list. Except that there's no "game.rpy" file in my directory. I have the latest version of the engine and I'm using Editra, is this only in Atom or something?

User avatar
Andredron
Miko-Class Veteran
Posts: 776
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: 16 mini game Renpy

#35 Post by Andredron »

sonictoad wrote: Thu May 23, 2019 3:52 pm This is going to sound like a stupid question but--

I want to use that "Search for Items" minigame, first one in the list. Except that there's no "game.rpy" file in my directory. I have the latest version of the engine and I'm using Editra, is this only in Atom or something?

It is not necessary to have this file, just see how in the example to call the game, and in your project, where you also need to call.
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Sawa - a game of the Drow Nation

Honest Critique

Poses in visual novels, or how to hold a character properly in the frame

Help save articles to the webarchive. [/color]

Please save your projects on github, you would know how hard it is to find projects after 7 years...

User avatar
sonictoad
Regular
Posts: 30
Joined: Tue Mar 12, 2019 10:39 pm
Projects: It's Different When It's Your Own
Organization: Sonic Toad Media LLC
itch: nyhcmaven84
Location: Bronx, NY
Contact:

Re: 16 mini game Renpy

#36 Post by sonictoad »

Andredron wrote: Fri May 24, 2019 6:14 am
sonictoad wrote: Thu May 23, 2019 3:52 pm This is going to sound like a stupid question but--

I want to use that "Search for Items" minigame, first one in the list. Except that there's no "game.rpy" file in my directory. I have the latest version of the engine and I'm using Editra, is this only in Atom or something?

It is not necessary to have this file, just see how in the example to call the game, and in your project, where you also need to call.
Oh ok! So would this just go in the script.rpy file where virtually all of the game's code is? Or should I make a whole new script file (let's call it game.rpy to keep it simple) then call it from script.rpy when the player reaches the appropriate jump?

User avatar
Andredron
Miko-Class Veteran
Posts: 776
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: 16 mini game Renpy

#37 Post by Andredron »

sonictoad wrote: Wed May 29, 2019 9:51 am
Andredron wrote: Fri May 24, 2019 6:14 am
sonictoad wrote: Thu May 23, 2019 3:52 pm This is going to sound like a stupid question but--

I want to use that "Search for Items" minigame, first one in the list. Except that there's no "game.rpy" file in my directory. I have the latest version of the engine and I'm using Editra, is this only in Atom or something?

It is not necessary to have this file, just see how in the example to call the game, and in your project, where you also need to call.
Oh ok! So would this just go in the script.rpy file where virtually all of the game's code is? Or should I make a whole new script file (let's call it game.rpy to keep it simple) then call it from script.rpy when the player reaches the appropriate jump?
The code of the game, for example, is written in a separate game.rpy file and is completely thrown into the project. You look then the code in script.rpy there mini game is called so

call screen minigame
Or
show screen minigame

And variables, they start with $ or python, don't forget to add first
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Sawa - a game of the Drow Nation

Honest Critique

Poses in visual novels, or how to hold a character properly in the frame

Help save articles to the webarchive. [/color]

Please save your projects on github, you would know how hard it is to find projects after 7 years...

mattocean
Newbie
Posts: 2
Joined: Fri Dec 11, 2020 10:52 am
Contact:

Re: 16 mini game Renpy

#38 Post by mattocean »

Hello,

first, thank you for creating the Find items mini game. I wanted to use it but I get error message. I would like to ask you to help me. Please be so kind. Why do I get the error message when running the game with your script.

"Invalid syntax maxLen + = 1"

I did put the code in the game folder and calling like this

$ InitGame("bg_room", 5.0, True, (735, 300), "figure1", (640, 226), "figure2", (288, 38), "figure3", (115, 260), "figure4")
$ StartGame()

I hope to get an answer from you soon.

User avatar
_ticlock_
Miko-Class Veteran
Posts: 910
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: 16 mini game Renpy

#39 Post by _ticlock_ »

Hi, Andredron,

Thank you for your time and effort in making this selection. It is very useful.

User avatar
Renpie
Newbie
Posts: 14
Joined: Sat Jul 11, 2015 9:49 am
Contact:

Re: 16 mini game Renpy

#40 Post by Renpie »

Fable minigame is nice,

I added variable for min and max values of that area where you have to push so it's easy to change it, also added variable to change the speed of the ball. Also combined them to one screen as there was something weird going on with the variables, somehow changes made in one screen didn't update on another.

User avatar
MoonByte
Regular
Posts: 173
Joined: Thu Mar 24, 2016 9:18 pm
Completed: Shine (RPG Maker), Heroes (RPG Maker), Lantern Bearer (RPG Maker), Loop the Loop (Unity), Other Stars (Unreal), Sky Eye (RPG Maker), WIN Delivery & Fateful (Ren'Py)
Projects: Weird Is Normal (Ren'Py)
Location: Germany
Contact:

Re: 16 mini game Renpy

#41 Post by MoonByte »

All of these are amazing!
I have a small question in regard to the memory game though
I have two different characters that would play that game with the PC and I want each to use their own cards (like, Character A has you sort flowers, Character B has you sort animals).
Is there a way to tell set it up that I have 10 images in the folder and I set a certain variable or something that the game only uses either 1-5 or 6-10?

User avatar
Andredron
Miko-Class Veteran
Posts: 776
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: 16 mini game Renpy

#42 Post by Andredron »

MoonByte wrote: Thu May 27, 2021 11:27 am All of these are amazing!
I have a small question in regard to the memory game though
I have two different characters that would play that game with the PC and I want each to use their own cards (like, Character A has you sort flowers, Character B has you sort animals).
Is there a way to tell set it up that I have 10 images in the folder and I set a certain variable or something that the game only uses either 1-5 or 6-10?
Honestly, I would have suggested to you, but for a long time I haven’t sat down for a python, and I have already forgotten a lot, when a major one took up the project as a translator and scriptor, and not as a programmer.
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Sawa - a game of the Drow Nation

Honest Critique

Poses in visual novels, or how to hold a character properly in the frame

Help save articles to the webarchive. [/color]

Please save your projects on github, you would know how hard it is to find projects after 7 years...

Feleven
Newbie
Posts: 10
Joined: Tue Jun 01, 2021 10:23 am
Contact:

Re: 16 mini game Renpy

#43 Post by Feleven »

Any chance someone could reupload "3 in 1 row"?
Link is dead so obviously all images etc. are gone.

User avatar
Andredron
Miko-Class Veteran
Posts: 776
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: 16 mini game Renpy

#44 Post by Andredron »

Feleven wrote: Sat Jun 19, 2021 2:56 am Any chance someone could reupload "3 in 1 row"?
Link is dead so obviously all images etc. are gone.
https://vk.com/wall-7553243_41708?post_add#post_add
Renpy textbook (in Russian). https://disk.yandex.ru/i/httNEajU7iFWHA (all information is out of date) Update 22.06.18

Sawa - a game of the Drow Nation

Honest Critique

Poses in visual novels, or how to hold a character properly in the frame

Help save articles to the webarchive. [/color]

Please save your projects on github, you would know how hard it is to find projects after 7 years...

Feleven
Newbie
Posts: 10
Joined: Tue Jun 01, 2021 10:23 am
Contact:

Re: 16 mini game Renpy

#45 Post by Feleven »

Thanks for the reply but unfortunately the link found there is dead as well. When you click on "Kri2.rar" it sends you there: https://vk.com/doc28338738_463390421?ha ... dc674af1dd

Post Reply

Who is online

Users browsing this forum: No registered users