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