# How to make a "compass"-system in your game

#1

Hello comrads! I want to talk you about simple symple “compass”-system, which you can use in you own game.

1. First of all you must create variables:

*create n_s “entrance”
*create v_n_s 0
*create e_w “entrance”
*create v_e_w 0

Clarification: n_s - north_south and e_w - east_west. v - visited.

1. Line, where you give the player information about where is he located now.

Compass: the number of transitions from the entrance to the cave (south-west: {n_s}; east-west: {e_w}).

1. Code in button, if player make step to the north direction.

#Go to the north.
*set v_n_s +1
*if v_n_s > 0
*set n_s “{v_n_s} transitions to north" *if v_n_s = 0 *set n_s "entrance" *if v_n_s < 0 *set v_n_s (v_n_s -(v_n_s * 2)) *set n_s "{v_n_s} transitions to south”
*set v_n_s (v_n_s -(v_n_s * 2))

If player walk to the south just replace set v_n_s +1 with set v_n_s -1

Code in button, if player make step to the east direction.

#Go to the east.
*set v_e_w +1
*if v_e_w > 0
*set e_w “{v_e_w} transitions to east" *if v_e_w = 0 *set e_w "entrance" *if v_e_w < 0 *set v_e_w (v_e_w -(v_e_w * 2)) *set e_w "{v_e_w} transitions to west”
*set v_e_w (v_e_w -(v_e_w * 2))

If player walk to the west just replace set v_e_w +1 with set v_e_w -1

This method is very stupid and simple, but if you want to add to you game cave or labirinth, like in old-style game-book, it may be usefull ))))

#2

*Edit made it home and going to redo this

I am not a master coder but I would approach it a little simpler.

*create north false
*create northwest false
*create west false
*create southwest false
*create south false
*create southeast false
*create east false
*create northeast

There are three doors you can choose to go through
*choice
#East
*comment just copy and paste the following
*set north false
*set northwest false
*set west false
*set southwest false
*set south false
*set southeast false
*set east false
*set northeast false
*comment set direction
*set east true
#West
*comment just copy and paste the following
*set north false
*set northwest false
*set west false
*set southwest false
*set south false
*set southeast false
*set east false
*set northeast false
*comment set direction
*set west true
#North
*comment just copy and paste the following
*set north false
*set northwest false
*set west false
*set southwest false
*set south false
*set southeast false
*set east false
*set northeast false
*comment set direction
*set north true

*choice
#Compass
*gosub compass

*label compass
*if (north)
*return
*if (northwest)
*return
*if (west)
*return
*if (southwest)
*return
*if (south)
*return
*if (southeast)