diff --git a/samples/colour-canvas-game/README.md b/samples/colour-canvas-game/README.md new file mode 100644 index 00000000..3f36b122 --- /dev/null +++ b/samples/colour-canvas-game/README.md @@ -0,0 +1,85 @@ +# Colour Memory Game + +## Summary + +A single player colour memory game built in Power Apps. A random colour appears on screen for a few seconds. The colour disappears and the player uses Red, Green, and Blue sliders to recreate the colour they saw. A score out of 10 is given based on how close the guess was to the original colour. + +![Intro Screen](assets/start.png) +![Colour Screen](assets/colour.png) +![Guess Screen](assets/colourpick.png) +![Result Screen](assets/result.png) + +## Applies to + +![Power Apps](https://img.shields.io/badge/Power%20Apps-Yes-green "Yes") +![Power Automate](https://img.shields.io/badge/Power%20Automate-No-red "No") +![Power BI](https://img.shields.io/badge/Power%20BI-No-red "No") +![Power Pages](https://img.shields.io/badge/Power%20Pages-No-red "No") +![Power Virtual Agents](https://img.shields.io/badge/Power%20Virtual%20Agents-No-red "No") +![Dataverse](https://img.shields.io/badge/Dataverse-No-red "No") +![AI Builder](https://img.shields.io/badge/AI%20Builder-No-red "No") +![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-No-red "No") +![Power Fx](https://img.shields.io/badge/Power%20Fx-Yes-green "Yes") + +## Compatibility + +![Premium License](https://img.shields.io/badge/Premium%20License-Not%20Required-red.svg "Premium license not required") +![Experimental Features](https://img.shields.io/badge/Experimental%20Features-No-red.svg "Does not rely on experimental features") + +## Contributors + +* [joshua](https://github.com/brayjosh) + +## Version history + +Version|Date|Comments +-------|----|-------- +1.0|June 8, 2025|Initial release + +## Prerequisites + +None. No connectors, no Dataverse, no premium licence required. + +## Minimal path to awesome + +### Using the solution zip + +* [Download](./solution/ColourCanvasGame.zip) the `.zip` from the `solution` folder +* Within **Power Apps Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just downloaded +* Open the app and select **Play** + +### Using the source code + +* Clone the repository to a local drive +* Pack the source files back into a solution `.zip` file: + +```bash + pac solution pack --zipfile ColourCanvasGame.zip --folder sourcecode --processCanvasApps +``` + +* Within **Power Apps Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed + +## Features + +A fun and lightweight game that demonstrates creative use of Power Fx and canvas app controls without any external data sources or premium features. + +* Random colour generation using `RGBA` and `RandBetween` +* Colour distance scoring using Euclidean distance in RGB space +* Timer controls for countdown and colour display +* Dynamic background colour updated live from slider values + +## Help + +We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues. + +If you encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerplatform-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=colour-canvas-game&authors=@brayjosh&title=colour-canvas-game%20-%20). + +For questions regarding this sample, [create a new question](https://github.com/pnp/powerplatform-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=colour-canvas-game&authors=@brayjosh&title=colour-canvas-game%20-%20). + +Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerplatform-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=colour-canvas-game&authors=@brayjosh&title=colour-canvas-game%20-%20). + +## Disclaimer + +**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** + + \ No newline at end of file diff --git a/samples/colour-canvas-game/assets/colour.png b/samples/colour-canvas-game/assets/colour.png new file mode 100644 index 00000000..0a39fb67 Binary files /dev/null and b/samples/colour-canvas-game/assets/colour.png differ diff --git a/samples/colour-canvas-game/assets/colourpick.png b/samples/colour-canvas-game/assets/colourpick.png new file mode 100644 index 00000000..f3ec20be Binary files /dev/null and b/samples/colour-canvas-game/assets/colourpick.png differ diff --git a/samples/colour-canvas-game/assets/result.png b/samples/colour-canvas-game/assets/result.png new file mode 100644 index 00000000..4df0ad33 Binary files /dev/null and b/samples/colour-canvas-game/assets/result.png differ diff --git a/samples/colour-canvas-game/assets/sample.json b/samples/colour-canvas-game/assets/sample.json new file mode 100644 index 00000000..4f08204b --- /dev/null +++ b/samples/colour-canvas-game/assets/sample.json @@ -0,0 +1,71 @@ +[ + { + "name": "pnp-powerplatform-samples-colour-canvas-game", + "source": "pnp", + "title": "Colour Canvas Game", + "shortDescription": "A Power Apps game that challenges players to memorise a colour and recreate it from memory as accurately as possible.", + "url": "https://github.com/pnp/powerplatform-samples/tree/main/samples/colour-canvas-game", + "downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/powerplatform-samples/tree/main/samples/colour-canvas-game", + "longDescription": [ + "Colour Canvas Game is a Power Apps Canvas App that tests a player's ability to remember and recreate colours from memory.", + "Players are briefly shown a randomly generated colour before attempting to recreate it using colour selection controls.", + "The solution demonstrates Power Apps game mechanics, timers, variables, collections, colour calculations, and custom scoring logic implemented using Power Fx." + ], + "creationDateTime": "2026-06-08", + "updateDateTime": "2026-06-08", + "products": [ + "Power Apps" + ], + "tags": [ + "game", + "colour", + "color", + "memory", + "canvas app", + "power fx" + ], + "categories": [ + "CANVAS" + ], + "metadata": [ + { + "key": "POWERAPPS-EXPERIMENTAL", + "value": "No" + }, + { + "key": "POWERAPPS-PREMIUM", + "value": "No" + }, + { + "key": "POWERAPPS-ONPREM", + "value": "No" + }, + { + "key": "POWERAPPS-CUSTOMCONNECTOR", + "value": "No" + } + ], + "thumbnails": [ + { + "type": "image", + "order": 100, + "url": "https://github.com/pnp/powerplatform-samples/raw/main/samples/colour-canvas-game/assets/start.png", + "alt": "Colour Canvas Game preview" + } + ], + "authors": [ + { + "gitHubAccount": "brayjosh", + "pictureUrl": "https://github.com/brayjosh.png", + "name": "joshua" + } + ], + "references": [ + { + "name": "Microsoft Power Platform documentation", + "description": "Discover how to make the most of Microsoft Power Platform products with online training courses, documentation, and videos.", + "url": "https://learn.microsoft.com/power-platform/" + } + ] + } +] \ No newline at end of file diff --git a/samples/colour-canvas-game/assets/start.png b/samples/colour-canvas-game/assets/start.png new file mode 100644 index 00000000..6d81a454 Binary files /dev/null and b/samples/colour-canvas-game/assets/start.png differ diff --git a/samples/colour-canvas-game/solution/colour-canvas-game.zip b/samples/colour-canvas-game/solution/colour-canvas-game.zip new file mode 100644 index 00000000..4484dca0 Binary files /dev/null and b/samples/colour-canvas-game/solution/colour-canvas-game.zip differ diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/.gitignore b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/.gitignore new file mode 100644 index 00000000..ba59257a --- /dev/null +++ b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/.gitignore @@ -0,0 +1,8 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# msbuild output directories +/bin +/obj + +# MSBuild Binary and Structured Log +*.binlog diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/ColourCanvasGame.cdsproj b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/ColourCanvasGame.cdsproj new file mode 100644 index 00000000..3b395cef --- /dev/null +++ b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/ColourCanvasGame.cdsproj @@ -0,0 +1,54 @@ + + + + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\PowerApps + + + + + + + 433b7241-77ac-466e-be3b-eccdf0b82fb5 + v4.6.2 + + net462 + PackageReference + src + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462.meta.xml b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462.meta.xml new file mode 100644 index 00000000..bcd0f520 --- /dev/null +++ b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462.meta.xml @@ -0,0 +1,34 @@ + + + bj_colour_3a462 + 2026-07-15T18:14:09Z + Ready + 3.26065.8.0 + 3.26065.8.0 + {"primaryDeviceWidth":"1527","primaryDeviceHeight":"629","supportsPortrait":"true","supportsLandscape":"true","primaryFormFactor":"Tablet","showStatusBar":"false","publisherVersion":"3.26065.8","minimumRequiredApiVersion":"2.2.0","hasComponent":"false","hasUnlockedComponent":"false","isUnifiedRootApp":"false","m365CopilotSettingValue":"0","sienaVersion":"20260608T175800Z-3.26054.13.0"} + 0 + + RGBA(0,176,240,1) + colour + + + + [] + {} + {} + [] + [] + 1 + 0 + 0 + 0 + + 1.0 + {"cdsdependencies":[]} + 1 + /CanvasApps/bj_colour_3a462_BackgroundImageUri + /CanvasApps/bj_colour_3a462_DocumentUri.msapp + + /CanvasApps/bj_colour_3a462_AdditionalUris0_identity.json + + \ No newline at end of file diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_AdditionalUris0_identity.json b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_AdditionalUris0_identity.json new file mode 100644 index 00000000..387f4558 --- /dev/null +++ b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_AdditionalUris0_identity.json @@ -0,0 +1 @@ +{"__Version":"0.1","App":"0ddfb624-21ec-4071-ad61-fbc3ca001f3b","Test_7F478737223C4B69":"c87a718a-8968-4a28-9d48-9468d3b5ffeb","Host":"30cd9de0-562c-42de-b807-ee54d3604429","scrStart":"96164a96-7811-46f3-b6ab-d94914b0ff72","conHome":"d7d9db13-7440-4304-8255-d2b72b2359b0","lblColour":"ef1c4843-e212-4ba7-8522-84c43ca09506","lblColour_1":"6045196f-cfa3-44bd-aa1e-4a4c036dbfd5","icoArrow":"79e2fae7-7a3e-4ba7-b145-43eeb224244b","scrColour":"678b4f19-abc1-4d1e-a29b-84fc265a2256","conInfo":"dc4f3a4c-21a8-4103-ac02-5a7c99bdb5f7","lblAnswer":"0592e01a-8e8f-4f59-a683-cb614078534c","lblReady":"2ae8e406-e1e9-4ef9-96b7-4757291ffe38","lblSet":"1ef6f2ef-4910-493b-b2bd-60eaad22615d","lblGo":"4981daea-f97d-42c6-8d7d-b312615e6970","lblTime":"8c1e2433-3c66-4a6e-9c5e-4bb55f10eaf4","tmrCountdown":"54e01032-6f58-4b0c-9cc7-47819778796c","tmrReadySetGo":"8ef1e1f3-c604-4e4e-98d2-c58b1d834298","scrColourPick":"02e35fc2-5f76-4e42-a75d-1fe385dec96a","conSliders":"dfda1af3-1700-4932-aced-08001e7dde2b","conTopFill":"97aabb9a-0452-4f64-9859-df92b1328f61","conRed":"9c149353-cdfe-4dc8-a5bc-a91d5463042e","lblRed":"bf282ad0-80da-4735-9131-29e7b3cb53a1","sldRed":"1aaecee8-b431-4e35-8af6-149a32e9fad3","conGreen":"06333429-74d8-44e6-bab4-b0f9d1d9893d","lblGreen":"d8382053-9141-4000-ac21-f765748694c0","sldGreen":"446ad481-5a47-426b-ae63-4d18bcd928e5","conBlue":"6dc90f8b-4ae2-4806-b0f2-3328349190c8","lblBlue":"959836bc-a671-407c-9f6d-b1dc73d8a377","sldBlue":"db5a697e-d051-4020-b05a-771bf93e7877","conBottomFill":"f196d189-d811-4b9c-9266-4453d184e438","icoGuess":"f79bb55d-c94e-4232-8f32-2ca3f9d1c624","scrResult":"ac46ac59-1352-485c-85b5-e98e0aa4dab6","conColours":"c8e3d5c9-7351-411d-bc48-8bfd35a05f4c","lblResult":"3f3ae869-0733-49c0-a11a-e813255170eb","conGuess":"1f1c272a-d1d2-4b57-b7b1-176df882e3e2","conLeftFill":"65083b7f-c5bd-4841-8d2c-babd681cc0a8","conOptions":"3105b635-62ab-471f-8dfc-239993521a49","icoHome":"cb69c2c9-e795-41f5-b6a6-eba54a7bb99f","icoReset":"c3dc1c1d-7174-48e3-82ad-19a137980e1d"} \ No newline at end of file diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_BackgroundImageUri b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_BackgroundImageUri new file mode 100644 index 00000000..c67f0065 Binary files /dev/null and b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_BackgroundImageUri differ diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_DocumentUri.msapp b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_DocumentUri.msapp new file mode 100644 index 00000000..314c4b58 Binary files /dev/null and b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/CanvasApps/bj_colour_3a462_DocumentUri.msapp differ diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/Other/Customizations.xml b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/Other/Customizations.xml new file mode 100644 index 00000000..63f08cc2 --- /dev/null +++ b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/Other/Customizations.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + 1033 + + \ No newline at end of file diff --git a/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/Other/Solution.xml b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/Other/Solution.xml new file mode 100644 index 00000000..56801194 --- /dev/null +++ b/samples/colour-canvas-game/sourcecode/sourcecode/ColourCanvasGame/src/Other/Solution.xml @@ -0,0 +1,85 @@ + + + + ColourCanvasGame + + + + + 1.0.0.1 + 2 + + brayjosh + + + + + + + bj + 12120 + +
+ 1 + 1 + + + + + + + + + + + + + + + + 1 + + + + + + + + +
+
+ 2 + 1 + + + + + + + + + + + + + + + + 1 + + + + + + + + +
+
+
+ + + + +
+
\ No newline at end of file