Prince of Persia reimplementation written in HTML5 / JavaScript
- Browser: https://princejs.com
- Keyboard / Mouse Controls
-
Browser: https://princejs.com
- Use Landscape Mode (Single Tab, Disable Landscape Tab Bar in Browser Settings)
- Force Fullscreen: https://princejs.com?fullscreen=true
-
Add to Home Screen to start as Fullscreen App
-
Reduced difficulty (50%):
-
Touch Controls (tap/drag area on screen):
- Dragging can be used to trigger continuous move sequences, e.g.
- Run Jump: Tap Left / Right -> Hold -> Drag in Left / Right corner
- Jump Grab: (Run) Jump -> Hold -> Drag to Center (Shift)
- Dragging can be used to trigger continuous move sequences, e.g.
- Browser: https://oklemenz.github.io/PrinceJS
- Install Node.js
- Clone:
https://github.com/oklemenz/PrinceJS.git
- Terminal:
npm install
npm start
- Browser:
localhost:8080
Url parameters are leveraged to save game state automatically (shortcut in brackets)
level (l)
: Current Level (1-14, default: 1)health (h)
: Max Health (3-10, default: 3)time (t)
: Remaining Minutes (1-60, default: 60)strength (s)
: Guard Strength in "%" (0-100, default: 100)width (w)
: Game Width in "px" (default: 0 (fit to screen))fullscreen (f)
: Fullscreen mode (=100vh) (default: false)shortcut (_)
: Write url in shortcut version (default: false)
Default url looks as follows:
https://princejs.com?level=1&health=3&time=60&strength=100&width=0&fullscreen=false
Default shortcut url looks as follows:
https://princejs.com?l=1&h=3&t=60&s=100&w=0&f=false&_=true
Manual adjustments of url parameters is possible as preset options.
Apoplexy (https://www.apoplexy.org) can be used to build custom levels. Custom levels can be played performing the following steps.
- Save level as XML file in Apoplexy, e.g.
./xml/level1.xml
- Call convert script, e.g.
npm run convert .../xml/level1.xml
- A JSON file is placed at
/assets/maps/
, e.g./assets/maps/level101.json
- A JSON file is placed at
- Custom level ids starts beyond 100, e.g.
level1.xml
gets id101
, etc.- An optional second parameter can be used to control level offset
- e.g.
npm run convert .../xml/level1.xml 200
generates/assets/maps/level201.json
- Start game locally with
npm start
and open game in browser - Change Url and set parameter
level
to the respective id, e.g.level=101
- Note: No special events are supported
- Place level files into folder
/converter/<xxx>
, where<xxx>
stands for the offset (default: 100)- e.g.
/converter/100
: place all levels starting with 100 offset
- e.g.
- Execute
npm run convert
- Corresponding JSON files are placed at
/assets/maps/
Converted levels from https://www.popot.org/custom_levels.php:
- 100: Tower of Revenge (own)
- 101-114: Prince of Persia Revisited
- 115-128: Jaffar's House
- 129-142: Ipank's Levels
- 143-156: Barre's Alternative
- 157-170: Miracles Don't Exist
- 171-184: Babylon Tower Climb
- 185-198: Lost in Errors
- 199-212: Story Retold
- 213-226: Prince of Persia Guard Revolt
- 227-240: Return of Prince