Quick code snippet for making the car ride animations in RE:H and DMR.
Car bump animation
Just a small repeating loop that moves the y axis of the image at a pseudo-random interval to simulate riding across the bumpy road.
image bg train:
# contains:
"images/extras/dark_train.jpg" # the background image
size (2100, 1180) # make the size slightly bigger than the game window, which is at (1920,1080), so that when we move the background image, we don't run off the edge of the background
pause (renpy.random.randint(0,1))
easein 0.15 ypos 1140 #move the bg down a little
easein 0.15 ypos 1100 # move the bg back up to the default location
pause 0.4 # wait a little between bumps
easein 0.15 ypos 1110
easein 0.15 ypos 1100
pause 0.1 # wait a different amount between each bump
easein 0.15 ypos 1115
easein 0.15 ypos 1100
pause (renpy.random.randint(1,3))
easein 0.15 ypos 1120
easein 0.15 ypos 1100
pause 0.5
pause (renpy.random.randint(1,2))
easein 0.15 ypos 1110
easein 0.15 ypos 1100
pause 0.1
easein 0.15 ypos 1122
easein 0.15 ypos 1100
repeat
Questions or Comments?
Feel free to send in any SCU or AG-related questions! Our Ask Box is always open.
Thanks so much for all of your amazing support, and stay safe out there!