Skip to content

Commit 5551e7b

Browse files
TaddyHCmirkokurt
authored andcommitted
[PXCT-1310] Mascot Jump Game Example Addition (arduino#7)
* Update audio classification doc (arduino#6) * PR 143 Migration to up to date repository --------- Co-authored-by: Mirko Curtolo <47823364+mirkokurt@users.noreply.github.com>
1 parent 83cce6f commit 5551e7b

File tree

7 files changed

+41
-34
lines changed

7 files changed

+41
-34
lines changed

examples/mascot-jump-game/assets/fonts/fonts.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
2+
* SPDX-FileCopyrightText: Copyright (C) 2025 ARDUINO SA <http://www.arduino.cc>
33
*
44
* SPDX-License-Identifier: MPL-2.0
55
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
1+
SPDX-FileCopyrightText: Copyright (C) 2025 ARDUINO SA <http://www.arduino.cc>
22

33
SPDX-License-Identifier: MPL-2.0

examples/mascot-jump-game/assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
2+
SPDX-FileCopyrightText: Copyright (C) 2025 ARDUINO SA <http://www.arduino.cc>
33
44
SPDX-License-Identifier: MPL-2.0
55
-->

examples/mascot-jump-game/assets/style.css

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
2+
SPDX-FileCopyrightText: Copyright (C) 2025 ARDUINO SA <http://www.arduino.cc>
33
44
SPDX-License-Identifier: MPL-2.0
55
*/
@@ -13,8 +13,8 @@ SPDX-License-Identifier: MPL-2.0
1313
}
1414

1515
body {
16-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; margin: 0;
17-
background: #DAE3E3;
16+
font-family: 'Consolas', 'Courier New', monospace;
17+
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
1818
min-height: 100vh;
1919
display: flex;
2020
justify-content: center;
@@ -34,7 +34,7 @@ body {
3434
display: flex;
3535
justify-content: space-between;
3636
align-items: center;
37-
margin-bottom: 40px;
37+
margin-bottom: 20px;
3838
padding: 0 10px;
3939
}
4040

@@ -59,6 +59,7 @@ body {
5959
background: white;
6060
border-radius: 12px;
6161
padding: 20px;
62+
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
6263
position: relative;
6364
}
6465

@@ -108,15 +109,13 @@ body {
108109
font-weight: 500;
109110
opacity: 0.7;
110111
font-size: 20px;
111-
font-family: "Open Sans", monospace;
112112
}
113113

114114
.score-value,
115115
.high-score-value {
116116
font-weight: 700;
117117
font-variant-numeric: tabular-nums;
118118
letter-spacing: 2px;
119-
font-family: "Open Sans", monospace;
120119
}
121120

122121
.high-score-label {
@@ -181,7 +180,6 @@ body {
181180
background: #4caf50;
182181
color: white;
183182
animation: pulse 2s ease-out;
184-
display: none;
185183
}
186184

187185
.connection-status.disconnected {
@@ -240,40 +238,40 @@ body {
240238
.container {
241239
padding: 10px;
242240
}
243-
241+
244242
.header {
245243
margin-bottom: 15px;
246244
}
247-
245+
248246
.arduino-text {
249247
font-size: 24px;
250248
}
251-
249+
252250
.game-container {
253251
padding: 15px;
254252
}
255-
253+
256254
#gameCanvas {
257255
max-width: 100%;
258256
height: auto;
259257
}
260-
258+
261259
.game-info {
262260
flex-direction: column;
263261
gap: 15px;
264262
align-items: center;
265263
text-align: center;
266264
}
267-
265+
268266
.score-display {
269267
font-size: 20px;
270268
}
271-
269+
272270
.controls-info {
273271
flex-wrap: wrap;
274272
justify-content: center;
275273
}
276-
274+
277275
.connection-status {
278276
top: 10px;
279277
right: 10px;
@@ -286,25 +284,25 @@ body {
286284
.arduino-text {
287285
font-size: 20px;
288286
}
289-
287+
290288
.arduino-logo {
291289
height: 24px;
292290
}
293-
291+
294292
.score-display {
295293
font-size: 18px;
296294
gap: 10px;
297295
}
298-
296+
299297
.score-label,
300298
.high-score-label {
301299
font-size: 16px;
302300
}
303-
301+
304302
.controls-info {
305303
font-size: 12px;
306304
}
307-
305+
308306
.key-icon {
309307
padding: 2px 6px;
310308
font-size: 10px;
@@ -315,23 +313,23 @@ body {
315313
#gameCanvas {
316314
cursor: default;
317315
}
318-
316+
319317
#gameCanvas:hover {
320318
transform: none;
321319
}
322-
320+
323321
#gameCanvas:active {
324322
transform: scale(0.98);
325323
}
326-
324+
327325
.key-icon {
328326
display: none;
329327
}
330-
328+
331329
.control-item:first-child::before {
332330
content: "Tap to ";
333331
}
334-
332+
335333
.control-divider,
336334
.control-item:last-child {
337335
display: none;
@@ -342,11 +340,11 @@ body {
342340
body {
343341
background: white;
344342
}
345-
343+
346344
.connection-status {
347345
display: none;
348346
}
349-
347+
350348
.game-container {
351349
box-shadow: none;
352350
border: 1px solid #ddd;

examples/mascot-jump-game/python/main.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
1+
# SPDX-FileCopyrightText: Copyright (C) 2025 ARDUINO SA <http://www.arduino.cc>
22
#
33
# SPDX-License-Identifier: MPL-2.0
44

@@ -231,5 +231,14 @@ def on_client_connected(client_id, data):
231231
# Provide the LED state function to the Arduino sketch
232232
Bridge.provide("get_led_state", get_led_state)
233233

234+
# Start game loop in separate thread
235+
game_thread = threading.Thread(target=game_loop, daemon=True)
236+
game_thread.start()
237+
234238
# Run the app
235-
App.run(user_loop=game_loop)
239+
try:
240+
App.run()
241+
except KeyboardInterrupt:
242+
game_running = False
243+
if game_thread:
244+
game_thread.join()

examples/mascot-jump-game/sketch/game_frames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
2+
* SPDX-FileCopyrightText: Copyright (C) 2025 ARDUINO SA <http://www.arduino.cc>
33
*
44
* SPDX-License-Identifier: MPL-2.0
55
*/

examples/mascot-jump-game/sketch/sketch.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: Copyright (C) ARDUINO SRL (http://www.arduino.cc)
1+
// SPDX-FileCopyrightText: Copyright (C) 2025 ARDUINO SA <http://www.arduino.cc>
22
//
33
// SPDX-License-Identifier: MPL-2.0
44

0 commit comments

Comments
 (0)