Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Commit

Permalink
remove set player api
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Sep 24, 2019
1 parent 74a6ea1 commit 2b0a18d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
11 changes: 0 additions & 11 deletions blockstile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@ namespace TileWorld {
export function addTileSprite(code: number, image: Image, kind: number) {
myWorld.addTileSprites(code, image, kind)
}
/**
* Set the player
* @param color
*/
//% group="Tiles"
//% blockId=TWsetplayer block="set player to %color=colorindexpicker"
export function setPlayer(code: number) {
let player = myWorld.getSprite(code)
bindToController(player)
scene.cameraFollowSprite(player)
}

// notifications

Expand Down
2 changes: 1 addition & 1 deletion pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
],
"testFiles": [],
"public": false,
"installedVersion": "workspace:61b84db3-6c7a-4117-3e63-465e2303c6ff",
"installedVersion": "workspace:61b7f103-b0d4-4907-c2e8-9edc8ab9a6b9",
"preferredEditor": "tsprj"
}
5 changes: 5 additions & 0 deletions tileworld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ namespace TileWorld {
if (code == pixel) this.tileMap.setPixel(x, y, this.backgroundTile)
}
}
// TODO: check for multiple player sprites
if (kind == SpriteKind.Player) {
bindToController(this.sprites[code][0])
scene.cameraFollowSprite(this.sprites[code][0])
}
}

private setKind(code: number, kind: number) {
Expand Down

0 comments on commit 2b0a18d

Please sign in to comment.