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

Commit

Permalink
setting up tile world (done)
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Sep 20, 2019
1 parent 9dbd0e8 commit 8e26335
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions blockstile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ namespace TileWorld {
export function addTileSprite(code: number, image: Image) {
myWorld.addTileSprites(code, image)
}

export function getTileSprite(code: number) {
return myWorld.getSprite(code)
}
export function makeGroup(code: number, code2: number, code3: number = 0xff, code4: number = 0xff) {
return myWorld.makeGroup(code, code2, code3, code4)
/**
* 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 All @@ -63,6 +67,9 @@ namespace TileWorld {
}

// checks
export function makeGroup(code: number, code2: number, code3: number = 0xff, code4: number = 0xff) {
return myWorld.makeGroup(code, code2, code3, code4)
}
export function isOneOf(d: Dir, c1: Dir, c2: Dir = 0xff, c3: Dir = 0xff) {
myWorld.isOneOf(d, c1, c2, c3)
}
Expand Down

0 comments on commit 8e26335

Please sign in to comment.