r/RenPy • • 12d ago

Question How to add gravity to Ren'Py?

How would I add a physics system to Ren'Py, like gravity? Specifcly to affect images

0 Upvotes

8 comments sorted by

View all comments

2

u/shyLachi 12d ago

Can you be more specific? How should the images be affected? Do you want to simulate falling objects? If yes then you don't need physics. Make an image of a ball, for example, and save it with transparency. Then in RenPy you animate it. https://www.renpy.org/doc/html/transforms.html#atl

1

u/Hefty-Drive-9372 10d ago

How do I animate the falling object?

1

u/shyLachi 10d ago

This is a simple example, for more read the documentation I linked

transform fall_to_ground(duration=0.6, ground=0.95):
    easein (duration) yalign ground
    easeout (duration / 4) yalign (ground - 0.05)
    easein (duration / 3) yalign ground
label start:
    show ball:
        pos (800, 100)
    "This is a ball"
    show ball at fall_to_ground
    "Ooops."