1.1.7 • Published 1 year ago

@notcc/logic v1.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

NotCC logic

This package contains all the game logic for NotCC, a Chip's Challenge 2® emulator.

Legal notice

Chip's Challenge is a registered trademark of Bridgestone Media Group LLC, used here for identification purposes only. Not affiliated with, sponsored, or endorsed by Bridgestone Media Group LLC.

Example

// Verify a level's built-in solution

import { parseC2M, createLevelFromData, GameState } from "@notcc/logic"
import { readFileSync } from "fs"

const levelData = parseC2M(readFileSync("./funLevel.c2m").buffer)

const level = createLevelFromData(levelData)

level.playbackSolution(levelData.associatedSolution)

let bonusTicks = 60 * 60

while (level.gameState === GameState.PLAYING && bonusTicks > 0) {
	level.tick()
	if (level.solutionSubticksLeft === Infinity) {
		bonusTicks -= 1
	}
}

console.log(`Level built-in solution result: ${GameState[level.gameState]}`)
1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago