-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eba0cec
commit 8384b71
Showing
9 changed files
with
259 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"K;^TvaJi59[St1XP4=p)": { | ||
"data": "hwQgACAAAAAzMzMzMzMzMzMzMzMzMzMzMxMRERERERERERERERExMzMxMzMzMzMzMzMzMzMzEzMTMzMzMzMzMzMzMzMzMzMxEzMzMzMzERERETEzMzMzMRMzMzMzETMzMzMTMTMzMzETMzMzEzMzMzMzMxMzMzMxEzMzMzEzMzMzMzMzMTMzMRMzMxMzMxMREREzMxMzMzETMzMxMxMxMzMzETMzMTMxEzMzMTMxMzMzMzMxMzEzMRMzEzMzMTMzMzMzMTMTMzETMxMzEzMzERExMxMzEzMxEzMTMxMzEyIiEjMTMxMzMRMzEzMTMxMiIhIzEzMTMzETMxMzEzMTIiISMxMzEzMxEzMTMxMzEyIiEjMTMxMzMRMzEzMTMxMiIhIzEzMTMzETMxMzEzMzERExMxMzEzMxEzMTMzMxMzMzMzMxMxMzMRMzMzEzMTMzMzMzMTMxMzETMzMxMxMxMzMzETMzMTMxEzMzEzMzExERETMzEzMzMRMzMzMxMzMzMzMzMzEzMzETMzMzEzMzMzMzMxMzMzMxEzMzMzMRMzMzMxMxMzMzMRMzMzMzMxERERExMzMzMzETMzMzMzMzMzMzMzMzMzMxMzEzMzMzMzMzMzMzMzMTMzMTERERERERERERERERMTMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMw==", | ||
"mimeType": "image/x-mkcd-f4", | ||
"displayName": "cardback" | ||
}, | ||
"*": { | ||
"mimeType": "image/x-mkcd-f4", | ||
"dataEncoding": "base64", | ||
"namespace": "myImages" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Auto-generated code. Do not edit. | ||
namespace myImages { | ||
|
||
helpers._registerFactory("image", function(name: string) { | ||
switch(helpers.stringTrim(name)) { | ||
case "K;^TvaJi59[St1XP4=p)": | ||
case "cardback":return img` | ||
33333333333333333333333333333333 | ||
33311111111111111111111111113333 | ||
33133333333333333333333333331333 | ||
31333333333333333333333333333133 | ||
31333333333333333333333333333133 | ||
31333333333111111111333333333133 | ||
31333333311333333333113333333133 | ||
31333333133333333333331333333133 | ||
31333331333333333333333133333133 | ||
31333313333311111113333313333133 | ||
31333133331133333331133331333133 | ||
31333133313333333333313331333133 | ||
31331333313333333333313333133133 | ||
31331333133331111133331333133133 | ||
31331333133312222213331333133133 | ||
31331333133312222213331333133133 | ||
31331333133312222213331333133133 | ||
31331333133312222213331333133133 | ||
31331333133312222213331333133133 | ||
31331333133331111133331333133133 | ||
31331333313333333333313333133133 | ||
31333133313333333333313331333133 | ||
31333133331133333331133331333133 | ||
31333313333311111113333313333133 | ||
31333331333333333333333133333133 | ||
31333333133333333333331333333133 | ||
31333333311333333333113333333133 | ||
31333333333111111111333333333133 | ||
31333333333333333333333333333133 | ||
33133333333333333333333333331333 | ||
33311111111111111111111111113333 | ||
33333333333333333333333333333333 | ||
`; | ||
} | ||
return null; | ||
}) | ||
|
||
helpers._registerFactory("animation", function(name: string) { | ||
switch(helpers.stringTrim(name)) { | ||
|
||
} | ||
return null; | ||
}) | ||
|
||
helpers._registerFactory("song", function(name: string) { | ||
switch(helpers.stringTrim(name)) { | ||
|
||
} | ||
return null; | ||
}) | ||
|
||
} | ||
// Auto-generated code. Do not edit. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,101 @@ | ||
|
||
function setPromptInvisible (isInvisible: boolean) { | ||
for (let value of promptSprites) { | ||
value.setFlag(SpriteFlag.Invisible, isInvisible) | ||
} | ||
playerCardSprite.setFlag(SpriteFlag.Invisible, !(isInvisible)) | ||
} | ||
function initTable () { | ||
info.setScore(0) | ||
scene.setBackgroundColor(6) | ||
headerSprite = fancyText.create("Acey Deucey") | ||
fancyText.setFont(headerSprite, fancyText.art_deco_11) | ||
fancyText.setColor(headerSprite, 9) | ||
headerSprite.setPosition(80, 10) | ||
prompts = [ | ||
"Will the next card", | ||
"fall in between?", | ||
"Aces are high.", | ||
"A = Yes B = No" | ||
] | ||
y = 35 | ||
promptSprites = [] | ||
for (let value of prompts) { | ||
promptSprite = fancyText.create(value) | ||
fancyText.setColor(promptSprite, 15) | ||
fancyText.setFont(promptSprite, fancyText.bold_sans_7) | ||
promptSprite.x = 80 | ||
promptSprite.y = y | ||
promptSprites.push(promptSprite) | ||
y += 10 | ||
} | ||
} | ||
controller.B.onEvent(ControllerButtonEvent.Pressed, function () { | ||
if (waitingForPlayer) { | ||
playerChoseBetween = false | ||
reveal() | ||
} | ||
}) | ||
controller.A.onEvent(ControllerButtonEvent.Pressed, function () { | ||
if (waitingForPlayer) { | ||
playerChoseBetween = true | ||
reveal() | ||
} | ||
}) | ||
function reveal () { | ||
setPromptInvisible(true) | ||
isBetween = rightCard.isLessThan(playerCard) && playerCard.isLessThan(leftCard) || leftCard.isLessThan(playerCard) && playerCard.isLessThan(rightCard) | ||
if (playerChoseBetween == isBetween) { | ||
info.changeScoreBy(1) | ||
music.play(music.melodyPlayable(music.baDing), music.PlaybackMode.InBackground) | ||
pause(1000) | ||
startRound() | ||
} else { | ||
pause(1000) | ||
game.gameOver(false) | ||
} | ||
} | ||
function drawCards () { | ||
if (theDeck.numCardsRemain < 3) { | ||
theDeck.shuffle() | ||
} | ||
leftCard = theDeck.nextCard | ||
leftCardSprite.setImage(theDeck.getCardImage(leftCard, CardSpriteSize.Size32x32)) | ||
rightCard = theDeck.nextCard | ||
rightCardSprite.setImage(theDeck.getCardImage(rightCard, CardSpriteSize.Size32x32)) | ||
playerCard = theDeck.nextCard | ||
playerCardSprite.setImage(theDeck.getCardImage(playerCard, CardSpriteSize.Size32x32)) | ||
} | ||
function initCards () { | ||
theDeck = PlayingCards.createPokerDeck() | ||
theDeck.isAceHigh = true | ||
theDeck.shuffle() | ||
leftCardSprite = sprites.create(assets.image`cardback`, SpriteKind.Enemy) | ||
leftCardSprite.setPosition(40, 100) | ||
rightCardSprite = sprites.create(assets.image`cardback`, SpriteKind.Enemy) | ||
rightCardSprite.setPosition(120, 100) | ||
playerCardSprite = sprites.create(assets.image`cardback`, SpriteKind.Enemy) | ||
playerCardSprite.setPosition(80, 60) | ||
} | ||
function startRound () { | ||
setPromptInvisible(false) | ||
drawCards() | ||
waitingForPlayer = true | ||
} | ||
let rightCardSprite: Sprite = null | ||
let leftCardSprite: Sprite = null | ||
let theDeck: Shoe = null | ||
let leftCard: Card = null | ||
let playerCard: Card = null | ||
let rightCard: Card = null | ||
let isBetween = false | ||
let playerChoseBetween = false | ||
let waitingForPlayer = false | ||
let promptSprite: fancyText.TextSprite = null | ||
let y = 0 | ||
let prompts: string[] = [] | ||
let headerSprite: fancyText.TextSprite = null | ||
let playerCardSprite: Sprite = null | ||
let promptSprites: fancyText.TextSprite[] = [] | ||
initCards() | ||
initTable() | ||
startRound() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"transparency16": { | ||
"data": "hwQQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", | ||
"mimeType": "image/x-mkcd-f4", | ||
"tilemapTile": true | ||
}, | ||
"*": { | ||
"mimeType": "image/x-mkcd-f4", | ||
"dataEncoding": "base64", | ||
"namespace": "myTiles" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Auto-generated code. Do not edit. | ||
namespace myTiles { | ||
//% fixedInstance jres blockIdentity=images._tile | ||
export const transparency16 = image.ofBuffer(hex``); | ||
|
||
helpers._registerFactory("tile", function(name: string) { | ||
switch(helpers.stringTrim(name)) { | ||
case "transparency16":return transparency16; | ||
} | ||
return null; | ||
}) | ||
|
||
} | ||
// Auto-generated code. Do not edit. |
8384b71
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![Difference between blocks](https://raw.githubusercontent.com/robo-technical-group/acey-deucey/8384b71a765829ce213a9bf3287dfd3fcad454fd/.github/makecode/blocksdiff.png