I need help creating a grid map overlay with movement restrictions

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Jezzy
Regular
Posts: 30
Joined: Wed Jun 21, 2017 2:18 pm
Contact:

I need help creating a grid map overlay with movement restrictions

#1 Post by Jezzy » Wed Feb 13, 2019 10:14 pm

Hello,

I am planing a new ambitious Renpy project and I am trying to figure out how to create an interactive semi transparent grid map overlay that would go over a background image of a city. This grid would allow my character to move on the map using a click on any gray box located next to her current position (see attached pictures). I don't know where to start, I know I need a screen and I need to use grid but I cannot find any clear tutorial about how I want to create my grid map and how to only activate the case around my current position. Anyone can help me? ^.^
Attachments
start.jpg
Starting position of the character
direction.jpg
Desired direction
after_movement.jpg
After clicking or using a arrow key, whatever is simplier.

philat
Eileen-Class Veteran
Posts: 1853
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: I need help creating a grid map overlay with movement restrictions

#2 Post by philat » Wed Feb 13, 2019 11:09 pm

This isn't really a ren'py question so much as a python question. The issue of how to SHOW the location (using grid as a screen element) is secondary to how you're going to create a system to track the location (for instance, storing the player's location as x, y coordinates and then checking if the player can move in a particular direction). As such, it's hard to give advice. Googling for python grid-based examples might be helpful (e.g., along the lines of https://codereview.stackexchange.com/qu ... ent-engine -- although I just skimmed this).

Post Reply

Who is online

Users browsing this forum: Google [Bot]