Setup
Input
Movement
Minimap

Now that our input is being shown we can actually make something the player can control

In main.py add the following
	...
	
	input_status = input_handle.get_status()

	from Engine.engine import start_engine
	start_engine()


	while(not input_status["Exit"] ):
		
	
		terminal.clear()


		from Engine.engine import game_loop
		game_loop(input_status)



		display_input_status(input_status)


	...
	

Create a new folder called Engine with the following files (__init__.py, engine.py, Game.py, Menu.py, Enums.py)

Enums.py
from enum import Enum

class engineState(Enum):
	Menu = 1,
	Game = 2,

engine.py
	
from bearlibterminal import terminal

from Engine.Enums import engineState

class engine():
	player_x=0
	player_y=0
	engine_state = None

	def __init__(self):
		self.player_x = int(terminal.state(terminal.TK_WIDTH)/2)
		self.player_y = int(terminal.state(terminal.TK_HEIGHT)/2)
		self.engine_state = engineState.Game

	def update(self,input_status):
		from Engine.Game import game_update

		if(self.engine_state == engineState.Game):
			game_update(self, input_status)


	def render(self):
		from Engine.Game import game_render


		if(self.engine_state == engineState.Game):
			game_render(self)

		pass


	def game_loop(self,input_status):

		self.update(input_status)
		self.render()


Game.py
from Input.keyEnum import keyEnum

from bearlibterminal import terminal

def game_update(engine,input_status):
	move = {'x': 0, 'y': 0}

	if (input_status["KeyPress"][keyEnum.MOVE_UP]):
		move["y"] = move["y"] - 1

	if (input_status["KeyPress"][keyEnum.MOVE_DOWN]):
		move["y"] = move["y"] + 1

	if (input_status["KeyPress"][keyEnum.MOVE_LEFT]):
		move["x"] = move["x"] - 1

	if (input_status["KeyPress"][keyEnum.MOVE_RIGHT]):
		move["x"] = move["x"] + 1		
		
	if (input_status["KeyPress"][keyEnum.MOVE_UPLEFT]):
		move["y"] = move["y"] - 1
		move["x"] = move["x"] - 1

	if (input_status["KeyPress"][keyEnum.MOVE_UPRIGHT]):
		move["y"] = move["y"] - 1
		move["x"] = move["x"] + 1

	if (input_status["KeyPress"][keyEnum.MOVE_DOWNLEFT]):
		move["y"] = move["y"] + 1
		move["x"] = move["x"] - 1

	if (input_status["KeyPress"][keyEnum.MOVE_DOWNRIGHT]):
		move["y"] = move["y"] + 1
		move["x"] = move["x"] + 1

	engine.player_x = engine.player_x + move["x"]
	engine.player_y = engine.player_y + move["y"]

def game_render(engine):
	terminal.put(engine.player_x, engine.player_y, "@")