Git Product home page Git Product logo

princejs's Introduction

Prince of Persia (JS) - princejs.com

Prince of Persia reimplementation written in HTML5 / JavaScript (MS-DOS version)

Play Online

  • Browser: https://princejs.com
  • Keyboard
    • Cursor keys: Movement
      • Left / Right key: Move Left/Right, Advance/Retreat
      • Up key: Jump, Climb Up, Block Attack
      • Down key: Crouch, Crawl, Climb Down, Sheathe Sword
    • SHIFT: Drink Potion, Grab Edge, Sword Strike
    • SPACE: Show Remaining Time
    • ENTER: Continue Game
  • Mouse
    • See Touch Controls for Mobile
  • Game Controller
    • Left / Right Stick, DPad: Movement
      • Left / Right: Move Left/Right, Advance/Retreat
      • Up: Jump, Climb Up, Block Attack
      • Down: Crouch, Crawl, Climb Down, Sheathe Sword
    • A / R / ZR Button: Jump, Climb Up, Block Attack
    • B / Y / L / ZL Button: Drink Potion, Grab Edge, Sword Strike
    • X: (1x) Show Remaining Time, (2x) Restart Level
    • Minus Button: Previous Level
    • Plus Button: Next Level
    • Any: Continue Game

Play Mobile

  • Browser: https://princejs.com

    • Use Landscape Mode
    • Single Tab
    • Disable Landscape Tab Bar in Browser Settings
  • Add to Home Screen to start as Fullscreen App

  • Reduced difficulty (50%):

  • Touch Controls (tap/drag area on screen, fight mode in brackets):

    Mobile

    • Dragging can be used to trigger continuous move sequences, e.g.
      • Run Jump: Tap Left or Right -> Hold -> Drag in Left or Right corner
      • Jump Grab: (Run) Jump -> Hold -> Drag to Center (Shift)
    • Fight
      • Left/Right: Advance/Retreat
      • Shift: Sword Strike
      • Up: Block Attack
      • Down: Sheathe Sword

Play on Apple Watch

  • Mail/Message
    • Send mail or message to yourself with body: https://princejs.com
    • On Apple Watch open Mail or Message app
    • Click included link to open Browser
  • Siri
    • Tell Siri 'princejs.com' on Apple Watch
    • Watch out for correct localized pronunciation
  • Play using Touch Controls as on Mobile

Play GitHub Version

Play Locally

  • Install Node.js
  • Clone: https://github.com/oklemenz/PrinceJS.git
  • Terminal:
    • npm install
    • npm start
  • Browser: localhost:8080

Options

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))
  • 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

Default shortcut url looks as follows:

https://princejs.com?l=1&h=3&t=60&s=100&w=0&_=true

Manual adjustments of url parameters is possible as preset options.

Custom Levels

Apoplexy (https://apoplexy.github.io/apoplexysite/) can be used to build custom levels. Custom levels can be played performing the following steps.

Single Conversion

  • 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
  • Custom level ids starts beyond 100, e.g. level1.xml gets id 101, 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

Batch Conversion

  • 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
  • Execute npm run convert
  • Corresponding JSON files are placed at /assets/maps/

Level Numbers

Converted levels from https://www.popot.org/custom_levels.php:

Level Walkthrough

Level 99 - Chamber Play

Level 100 - Tower of Revenge

Credits

princejs's People

Contributors

oklemenz avatar ultrabolido avatar uguu-org avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.