Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit) (+1)

There are a number of ways you might go about doing this, with varying degrees of complexity. Here's one approach:

I start by making my map background, a field widget (which can be made invisible) to store the player's coordinates on the map called "location", a small canvas that can serve as a repositionable colored dot called "indicator", and a grid of buttons whose name corresponds to their coordinates:

In the "view" event handler for the card, I'll reposition the indicator and then update the .show state for all the buttons: the neighbors of the player's location should be "solid" and the rest should be "none":

on view do
 indicator.pos:card.widgets[location.text].pos
 loc:0+"," split location.text
 neighbors:(list "%i,%i")format flip loc+(list -1,1,0,0),(list 0,0,-1,1)
 each name in (list "%i,%i")format 4 cross 4
  card.widgets[name].toggle["solid" name in neighbors]
 end
end

Then you can give the buttons an appropriate script. (Note: you can select multiple widgets at once and use Widgets -> Script... to modify their scripts at the same time) For example, if the destination cards followed the same naming convention:

on click do
 location.text:me.name
 go[me.name]
end

As for tracking visited locations, the easiest approach might be to place an invisible checkbox widget on each location and use the view[] event on those cards to mark it visited. There's a similar question in this thread with more detail.

Does that point you in the right direction?