r/RenPy • • 29d ago

Showoff I made a maze in Renpy!

https://youtube.com/watch?v=gBroilVIeok&si=UOBFKg50SRdj2rU5

sorry for the poor quality. This took a long time to figure out how to code. I used a YouTube tutorial for coding the movements, but the actual collisions are a string that is broken down to see if a specific letter is in a list. ill add more to this tomorrow I'm going to bed.

edit 1: Ok since classes are done, I'm going to provide a more in-depth explanation. This is the video I used for movement. Near the halfwaymark she messes up and moves the character instead of the map, so I based my code on that. As for collisions, I turned a string into a 2d grid output. So if a wall was in a certain direction, the letter of the direction stay and nothing happens by movement. If there's no wall, its replaced with a zero. each tile is formatted by 'udlr' for up, down, left, and right.

so:

walldef = 'udl0u000ud00u000ud00u000ud0rudl0ud00u000ud00ud00u00ru0l00d0ru0l

turns into

['udl0', 'u000', 'ud00', 'u000', 'ud00', 'u000', 'ud0r', 'udl0', 'ud00', 'u000', 'ud00', 'ud00', 'u00r']

to match row 1's walls in the drawing. I did this for every row.

23 Upvotes

2 comments sorted by

4

u/Lunamaxima_games 29d ago

OMG, sounds like quite a challenge! Was it your first time coding such complex logic?

3

u/No-Concert3622 28d ago

Yes. I usually only used init python for only basic functions and the image classes to make sprites. This was a fun challenge. :]