Need help with MiniGame

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Post Reply
Message
Author
creativechaos
Newbie
Posts: 9
Joined: Wed Apr 29, 2020 3:27 pm
Contact:

Need help with MiniGame

#1 Post by creativechaos »

Hi,
i have started a project in Renpy and i am really stuck and this part. I am trying to make a minigame (sorting garbage), so far i added to object and they are draggable.
My idea is to do it like this:
  • When a object is placed in the wrong container you get minus points and if its placed in the right container you will get points.
    When the object is placed in a container it should be gone
    After placing a object in the container the should be a scene on how its placed in the container.
It would be soooo nice if someone could help with this.
Thanks a lot in advanced

Code: Select all

init python:
    fieldMetal = "false"
    fieldGlass = "false"

    def product_dragged(drags, drop):

        if not drop:
            return

        store.product = drags[0].drag_name
        store.container = drop.drag_name

        if product == "beerbottle" and container == "fieldGlass":
            fieldGlass = "true"

        else:
            fieldGlass = "true"

        if product == "bigbag" and container == "fieldMetal":
            fieldMetal = "true"
        else:
            fieldMetal = "true"

        if fieldGlass == "true" and fieldMetal == "true":
            return True

        else:
            pass

screen send_product_screen:

    # A map as background.
    add "camp_garbage_day.png"

    # A drag group ensures that the products and the cities can be
    # dragged to each other.
    draggroup:

        # Our products.
        drag:
            drag_name "beerbottle"
            child "beerbottle.png"
            droppable False
            dragged product_dragged
            xpos 0 ypos 0
            #action Call("putaway_candles_return")
        drag:
            drag_name "bigbag"
            child "bigbag.png"
            droppable False
            dragged product_dragged
            xpos 1050 ypos 800

        # The cities they can go to.
        drag:
            drag_name "fieldGlass"
            draggable False
            child "fieldGlass.png"
            xpos 400 ypos 440
        drag:
            drag_name "fieldMetal"
            draggable False
            child "fieldMetal.png"
            xpos 1415 ypos 438

label send_product:
    "We need to investigate! Who should we send, and where should they go?"

    call screen send_product_screen

    "Okay, we'll send [product] to [container]."
    if fieldMetal == False:
        jump fieldMetal_true

    jump send_product

Post Reply

Who is online

Users browsing this forum: No registered users