import 'package:dartterm/algorithms/dijkstra.dart'; import 'package:dartterm/algorithms/geometry.dart' as geo; import 'package:dartterm/algorithms/shadowcasting.dart'; import 'package:dartterm/colors.dart'; import 'package:dartterm/skreek.dart'; import 'package:dartterm/terminal.dart'; import 'package:dartterm/world/level.dart'; import 'dart:math' as math; part 'camera.dart'; part 'player.dart'; part 'fov.dart'; Future sitemode(Level level) async { await SiteMode(level).start(); } class SiteMode { Level level; late geo.Offset playerPosition; bool playerTookAutomatedAction = false; List playerIntendedPath = []; late geo.Offset camera; late Set fovVisible; late Set fovMovable; Set fovMemory = {}; SiteMode(this.level) { playerPosition = level.spawn; init(); maintain(); } void init() { cameraInit(); } void maintain() { playerMaintain(); fovMaintain(); cameraMaintain(); } void draw() { clear(); cameraDraw(); } Future start() async { while (true) { maintain(); draw(); // take automated actions, otherwise receive input if (playerTookAutomatedAction) { await zzz(0.1); } else { await waitMenu(); } } } }