Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Power Player

Power Player is a runtime player that executes code and assets authored in PowerPoint, enabling the development of games, interactive media.

  • Standalone : Windows

Instructions

1. Visual Editing

Edit objects directly on the slides. Define object names and layer hierarchy using the Selection Pane (Home > Select > Selection Pane).

2. Scripting

Write JavaScript directly in the slide's Comment section to control objects, set up game loops, and handle player input.

  • Invoke the function with 'this' as the Game Instance.
  • Using this.var["varName"] to defined a global(Game) variable.
  • Using let / var to defined a temporary variable.
  • Auto convert to ', to '.
  • Using spawnObject to duplicate an object results in a new instance named with the format [originalName]-[uuid].
  • Disable auto correct option : File -> Options -> Proofing -> AutoCorrect Options
  • A semicolon ; is required at the end of each statement.

Class & Functions

3. Objects

Example

  • Make a button and switch to other slides.

    {
        let b = this.getObject("buttonObject");
        b.interactive=true;
        b.on("pointerdown",()=>{
            this.switchSlide(2);
        })
    }
  • Control player.

    this.onUpdate=(delta)=>{
        let player = this.getObject("player");
        player.x = this.input.mousePosition.x;
        player.y = this.input.mousePosition.y;
        if(this.input.getCode("KeyA")=="JustPress"){
            this.spawnObject("object", {x:p.x+60, y:p.y});
            this.playAudio(0,"se");
        }
    }
  • Update spawned objects.

    this.onUpdate=(delta)=>{
        for(let obj of this.queryObjects("^objects-.+$")){
            obj.x+=delta*300;
            if(this.objectOutOfScene(obj.name)){
                this.removeObject(obj.name);
            }
            else if(this.collide("player",obj.name)){
                this.var["score"]+=1;
                this.removeObject(obj.name);
            }
        }
    }

Demo

  • Editing & Scripting.

  • Gameplay

About

A PowerPoint runtime player executes code and assets contained within a pptx file.

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors