예제 #1
0
        public Station(Vector2 start_position, int max_depth, int difficulty, int initial_branches, StationSpawner spawner)
        {
            this.id              = new Random(Guid.NewGuid().GetHashCode()).Next();
            this.position        = start_position;
            this.max_depth       = max_depth;
            this.inital_branches = initial_branches;
            this.spawner         = spawner;

            // Initialise the station tree
            station_tree          = new Node(0, null);
            station_tree.data     = new StationNode(station_tree, this);
            station_tree.position = Vector2.Zero;
            vectors.Add(Vector2.Zero);

            // Generate the initial tree
            GenerateNodeChildren(station_tree, 1, difficulty);

            // For each initial node, recursively build branch
            foreach (Node child in station_tree.children)
            {
                BuildStation(child);
            }

            foreach (Node child in station_tree.children.ToArray())
            {
                CleanTree(station_tree);
            }

            Initialise();
        }
예제 #2
0
        public Station(Node imported_tree, Vector2 position)
        {
            station_tree  = imported_tree;
            this.position = position;
            this.spawner  = Online.spawner;

            Initialise();
        }
예제 #3
0
        public void Initialize()
        {
            firstRun = true;

            // Load background
            background = new Background(ContentStore.bg7);

            spawner = new StationSpawner(true, 0);
        }
예제 #4
0
        public void Initialize()
        {
            // Disconnect if we are connected online
            if (Network.connected)
            {
                Network.connected = false;
            }

            // Create Station Spawner
            spawner = new StationSpawner(false, 3);

            // Load background
            background = new Background(ContentStore.bg7);

            // Create a new controllable player
            localPlayer = new Player(Vector2.Zero, SettingsManager.getUsername(), 100, true, 0);
            players.TryAdd(localPlayer.uid, localPlayer);

            // Create a minimap
            minimap = new Minimap(false, players, spawner.stations);
        }