atlas.swf
The interactive world map ("Atlas") that allows players to navigate between Trove's biomes and portals. It is a zoomable, draggable map of node icons connected by path lines, and it appears when the player opens the world-selection interface.
Document/main class: Atlas (extends _kiwi.Core.UIComponent)
SWF-specific classes: 24 (Atlas, MapNode, MapNodeHub, NodePath, biomeRisingTides, plus 19 Atlas_fla timeline symbols)
Main class: Atlas
Atlas is the root UIComponent that owns the entire world map. On construction it hides all biome art clips and mapStage.map.tutorialArrow, sets up path connectors between map nodes via setupNodes(), selects the hub node as the default, and scales the map stage to platform-appropriate defaults. configUI() then registers ExternalInterface callbacks so the game engine can drive the UI, and starts an ENTER_FRAME listener to reveal biome art clips one per frame as a staggered animate-in sequence.
The map content lives inside mapStage (a MovieClip), which contains a nested map clip holding the 20 named biome art clips, the 23 node markers, a paths clip for the connector lines, tutorialArrow, a gridLines clip, and a consoleCursor clip. map is placed inside mapStage at about 0.27 scale, so node positions, GRID_SIZE and SNAP_RADIUS are in map units. The overall component can be panned by dragging and zoomed by mouse wheel; on console/NX the cursor is a logical sprite that snaps to nodes.
Public methods
showNextBiome(e:Event) : void—ENTER_FRAMEhandler; pops one name off theanimateInqueue each frame, makes that biome clip visible, and removes itself when the queue is empty.setNodeState(nodeId:String, unlocked:Boolean) : void— drives a named node (and its associated biome art clips and path connector) to the"locked"frame label whenunlockedisfalse. Passingtruechanges nothing; the class has no unlock path. No-op if the node clip is not found.setUberTwelveIcons(textureName:String, slot:int) : void— injects anObjectPreviewicon (150×150) into one of three icon slots (firstIcon,secondIcon,thirdIcon) on thebiomeRisingTidesart clip of nodert1. Used to display the Uber-12 / Rising Tides rotating biome icons.setSelected(nodeId:String) : void— public entry point (called viaExternalInterface) that looks up the named node clip and delegates toselectNode(). The engine calls it when the Atlas opens, naming the node of the world the player is in.centerOnCurrentNode() : void— tweensmapStageso the currently selected node is centred on screen, with a slight NX-specific offset (−100 x, −160 y). UsesIggyTweenwithNone.easeInover 0.1 s.
Private / internal methods
selectNode(node:MovieClip) : void— deselects the previous node (returns it to"unselected"or"locked"), setscurrentNode, zeros the hover alpha, advances the new node to"selected"/"consoleSelected"/"lockedSelected"depending on state, then callsExternalInterface.call("SelectNode", name)to notify the engine.scaleMap(delta:Number) : void— adjustsmapStage.scaleX/YbySCALE_DELTA(0.05) × delta, clamped to [1.3, 2.8] (PC) or [1.8, 2.8] (console). Compensates the map pan offset so the centre of the view stays fixed, and rescales theconsoleCursorto keep it visually constant size. On NX usesIggyTweento animate the re-center.moveMap(dx:Number, dy:Number) : void— called fromExternalInterfaceon console sticks; movesconsoleCursorand scrollsmapStage. When the cursor enters a snap radius of a nearby node (and is moving toward it), snaps to that node, callsselectNode+centerOnCurrentNode, and startspauseMovementtimer (200 ms) to throttle further snapping.moveHighlight(dx:int, dy:int) : void— D-pad navigation; steps from the current node's grid position in the given direction up to 3 grid cells, snapping to the nearest found node and centering. Falls back to a pixel-distance walk if grid lookup fails.setupNodes() : void— iterates every path array, looks up each named clip inmapStage.map, stores it inallNodeskeyed by grid point string, zeroes hover alpha, disablesmouseChildren, and creates aNodePathconnector stretched and rotated between consecutive nodes.drawGrid() : void— draws a 19×19 semi-transparent grid (265-unit cell) onmapStage.map.gridLinesfor development reference, with visibility fromshowGrid. Nothing in the class calls it, sogridLines(an empty sprite on the timeline) stays blank.findNearestNode(pt:Point, maxDist:Number) : MovieClip— searches a 3×3 grid neighbourhood aroundpt, returns the closest node withinmaxDistsquared distance.snapToNearestNode(pt:Point, maxDist:Number) : Boolean— thin wrapper aroundfindNearestNode; selects the node and returnstrueif found and different from current.onMouseMoveEvent(e:MouseEvent) : void— shows/hideshoversub-clip alpha on whichever node clip the mouse is over.onMouseEvent(e:Event) : void—MOUSE_DOWNstartsmapStage.startDrag()and, if the target is aMapNodeorMapNodeHub, selects it. Every other event routed here (MOUSE_UP,MOUSE_LEAVE,CLICK) stops the drag.onMouseWheel(e:MouseEvent) : void— delegates toscaleMap(±1).onStageResized(w:Number, h:Number, dpiScale:Number) : void— scales the component, repositions and resizes thebackgroundclip to fill the viewport, notifies the engine viaExternalInterface.call("NOTIFY_RESIZED", w, h).
Key fields
| Field | Type | Role |
|---|---|---|
mapStage |
MovieClip |
Top-level container for the scrollable/zoomable map; position and scale are manipulated for pan/zoom. |
background |
MovieClip |
Fills the screen behind the map; resized on onStageResized. |
consoleCursor |
MovieClip |
Logical cursor sprite used on console/NX platforms; position tracks the selected node. |
allNodes |
Dictionary |
Maps grid-point strings (e.g. "(3, 2)") to their node MovieClip references for O(1) neighbour lookup. |
currentNode |
MovieClip |
The currently selected map node. |
nodeSelectedLabel |
String |
Frame label to use for selection: "selected" (PC/NX) or "consoleSelected" (console). |
allPaths |
Array |
Nine path arrays (path0–path8) each listing ordered node IDs that form a chain. |
animateIn |
Array |
Queue of biome/art clip names to reveal one-per-frame on startup. |
nodeArt |
Object |
Map from node ID to array of associated biome art clip names locked alongside the node. Covers 18 nodes; biomeStarter and biomeShadowTower have no entry. |
biomeRisingTides |
MovieClip |
Declared but never assigned: the root timeline places only background and mapStage, and the code reaches the clip as mapStage.map.biomeRisingTides. |
firstRisingTidesIcon / secondRisingTidesIcon / thirdRisingTidesIcon |
ObjectPreview |
150×150 _kiwi.Core.ObjectPreview instances injected into the Rising Tides clip's icon slots. |
pauseMovement |
Timer |
Single-shot 200 ms timer; prevents consecutive node snapping immediately after a snap. |
showGrid |
Boolean |
Dev toggle for gridLines visibility; read only by the uncalled drawGrid(). |
locationChanged |
Boolean |
Set on MOUSE_DOWN drag start; used by scaleMap to rebase the map offset. |
lastHovered |
MovieClip |
Tracks the last hovered node so its hover alpha can be zeroed when the mouse leaves. |
Constants
| Constant | Value | Meaning |
|---|---|---|
INITIAL_X / INITIAL_Y |
960 / 540 | Default mapStage anchor position (approximately screen centre at 1080p). |
MIN_SCALE / MAX_SCALE |
1.3 / 2.8 | PC zoom range. |
CONSOLE_MIN_SCALE / CONSOLE_MAX_SCALE |
1.8 / 2.8 | Console zoom range. |
DEFAULT_SCALE / CONSOLE_DEFAULT_SCALE |
1.8 / 2.5 | Zoom on open. |
SCALE_DELTA |
0.05 | Zoom step per wheel tick or scaleMap call. |
CURSOR_CONSOLE_SCALE |
2.8 | Scale factor used to keep the console cursor a constant visual size as the map zooms. |
CURSOR_CONSOLE_SPEED_SCALE |
2 | Multiplier applied to analog stick input before moving the cursor. |
GRID_SIZE |
265 | Spacing between map grid cells, in map units; used for node bucketing and grid drawing. |
SNAP_RADIUS |
10000 | Squared distance threshold (100 map units) for console cursor snap-to-node. |
POST_SNAP_TIMEOUT |
0.2 s | Dwell time after a snap before further snapping is allowed. |
Map path topology
The map is divided into nine ordered chains:
| Path | Nodes (in order) |
|---|---|
| path0 (main) | tutorial01 → hub → a0 → a1 … a11 (14 nodes) |
| path1 | a5 → f6 |
| path2 | a7 → h8 |
| path3 | a9 → l10 |
| path4 | stlobby (standalone) |
| path5 | a10 → e11 |
| path6 | sky (standalone) |
| path7 | geode → geode11 |
| path8 | rt1 (standalone — Rising Tides) |
Each consecutive pair within a path gets a dynamically created NodePath connector stretched and rotated between them.
Runtime dependencies & integration
-
ExternalInterfacecallbacks registered (engine → Flash):UIComponent.onStageResized→onStageResized(w, h, dpiScale)setNodeState(nodeId, unlocked)— lock/unlock a node and its artsetSelected(nodeId)— programmatic node selectioncenterOnCurrentNode()— re-centre camerascaleMap(delta)— zoom in/outmoveMap(dx, dy)— analog stick pan (console)moveHighlight(dx, dy)— D-pad navigation (console)setUberTwelveIcons(textureName, slot)— Rising Tides icon injection
-
ExternalInterfacecalls (Flash → engine):SelectNode(nodeName)— fired whenever a node becomes selected (including the constructor's defaulthub); the engine answers by filling the world panel (atlasinfobox.swf) for that nodeNOTIFY_RESIZED(w, h)— fired after stage resize
-
Property written by the engine:
visibleonmapStage.map.tutorialArrow(an animatedAtlasDownArrowImagearrow), reached by that path string; the constructor hides it first, so themapStage→map→tutorialArrowchain is part of the engine contract. -
IggyTween— used for smoothmapStage.x/ypan animations (0.1 s,None.easeIn) triggered bycenterOnCurrentNode,scaleMap(NX only), and constructor (NX only). -
IggyFunctions.inIggy— guardsExternalInterfaceregistration; when false (design-time / standalone), a local test state is applied instead. -
IsConsole()/IsNX()— global Iggy runtime functions detected at startup to branch scale limits, cursor behaviour, and pan offsets. -
_kiwi.Core.ObjectPreview— used for the three Rising Tides icon slots; texture name set viasetUberTwelveIcons. -
Mouse events —
MOUSE_MOVE,MOUSE_WHEEL,MOUSE_DOWN,MOUSE_UPonstage;MOUSE_LEAVEandCLICKonmapStage. -
Event.ENTER_FRAME— used transiently during the animate-in sequence; removed once all biome clips are revealed.
Other game-specific classes
MapNode— Embedsassets.swfsymbol28; a generic world map node MovieClip with ahoversub-clip and 5 frame-stop labels:unselected(1),selected(11),locked(21),lockedSelected(31),consoleSelected(41). Used for 21 of the 23 node markers.MapNodeHub— Embedsassets.swfsymbol11; the node variant placed forhubandgeode, with 3 frame-stop labels:unselected(1),selected(11),locked(21). It has nolockedSelectedorconsoleSelectedlabel.NodePath— Embedsassets.swfsymbol3; the connector line between nodes. Labelsunlocked(1) andlocked(21); loops frames 1–20 and stops on frame 21. Dynamically instantiated bysetupNodes(), sized and rotated to span between consecutive nodes.biomeRisingTides— Embedsassets.swfsymbol34; the Rising Tides biome art clip. Has three named child slots (firstIcon,secondIcon,thirdIcon) forObjectPreviewicons. Three looping sections —unselected(frames 1–901, a 900-frame animation),selected(902–912) andlocked(913–924) — each end on an...Endlabel whose frame script (901, 912, 924) callsgotoAndPlayback to the section's own label.
Atlas_fla timeline symbols (19 classes): biomeShadowTower_6, biomeEverdark_8, biomeForbiddenSpires_10, biomegiantlands_12, biomeIgneous_01_17, biomeSkyRealm_01_19, biomeSkylands_01_21, biomeDrowned_01_23, biomeDragonfire_25, biomeJurassic_27, biomeNeonCity_29, biomeStarter_31, biomeCandoria_33, biomePermafrost_37, biomeFaeForest_39, biomeDesertFrontier_35, biomeCursedVale_41, PrimeWorld_43, biomeGeode_02_4. All follow the same pattern: embed an assets.swf symbol and register 3 frame-stop scripts (frames 1, 11, 21) for the unselected / selected / locked labels. They are the visual art clips for each biome tile on the map, placed in map under their own instance names (e.g. biomeGeode02, biomeSkylands1, primeWorld). In all 20 biome clips (these plus biomeRisingTides) the selected frame applies a slight brightening colour transform and the locked frame draws the art at 50% alpha. The class only ever sends them to locked (via setNodeState); selection changes the node marker, never the art. biomeStarter draws the islands under hub, tutorial01, a0 and geode, and biomeShadowTower the tower under stlobby; neither is in nodeArt, so neither is ever locked.
Notable logic
-
Staggered animate-in: All biome art clips start hidden. Each
ENTER_FRAMEtick reveals the next one in theanimateInqueue (20 biomes total), producing a sequential reveal animation on map open without any explicit timer. -
Grid-bucketed node lookup: Nodes are stored in
allNodeskeyed by grid cell coordinates (Math.floor(x / 265 − 0.5)×Math.floor(y / 265 − 0.5)).findNearestNodesearches only the 3×3 neighbourhood around the query point, giving O(1)-ish performance regardless of total node count. -
Console cursor vs. mouse: On PC, standard mouse events drive panning and node hover. On console, an invisible
consoleCursorsprite is moved bymoveMap()(analog stick) and snapped to the nearest node when it passes within the snap radius and is moving toward it. After a snap thepauseMovementtimer blocks further snapping for 200 ms. D-pad usesmoveHighlight()which steps by grid unit from the current node. -
NX-specific pan offset: On Nintendo Switch (
IsNX()), all centering tweens apply a −100 x / −160 y offset relative to the standard formula, and the pan uses a 0.6 scale factor instead of 0.5, presumably to account for different viewport proportions. -
Zoom + pan coupling: When the user has dragged the map away from its origin (
locationChanged = true) and then zooms,scaleMapadjusts bothmapStage.map.x/y(inner content) andmapStage.x/y(outer container) to keep the view centred on the zoom origin rather than the stage origin. -
Rising Tides icons:
setUberTwelveIconsaccepts a texture name and a slot index (0–2) and places anObjectPreview(which resolves a named game texture at runtime) into the corresponding icon child of thebiomeRisingTidesclip. The engine uses the three slots for the icons of the biomes in the rotation currently running. The clip is looked up asmapStage.map[nodeArt["rt1"]], where the value is the one-element array["biomeRisingTides"]; AS3 coerces it to the string"biomeRisingTides", so the lookup resolves.