Skip to content

Commit 94d15e1

Browse files
committed
1 parent 508b37a commit 94d15e1

11 files changed

+654
-2
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "common"]
2+
path = common
3+
url = https://github.com/teeebor/flipper_helpers.git

README.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,25 @@
1-
# flipper_solitaire
2-
Solitaire game for Flipper Zero
1+
# Solitaire game for Flipper Zero
2+
3+
![Play screen](screenshots/solitaire.png)
4+
5+
![Play screen](screenshots/solitaire.gif)
6+
7+
### Shortcuts
8+
* Long press up skips the navigation inside the bottom column
9+
* Long press center to automatically place the card to the top rigth section
10+
11+
## Building
12+
> The app should be compatible with the official and custom flipper firmwares. If not, follow these steps to build it
13+
> yourself
14+
* Download your firmware's source code
15+
* Clone the repository recursively `git clone REPO_URL --recursive` into the firmware's applications_user folder
16+
* Navigate into the firmwares root folder
17+
* Make sure you can use
18+
the [Fipper build tool](https://github.com/flipperdevices/flipperzero-firmware/blob/dev/documentation/fbt.md)
19+
* To build the project, type this into your console:
20+
#### Linux
21+
> ./fbt fap_{APP_NAME}
22+
#### Windows
23+
> fbt.cmd fap_{APP_NAME}
24+
* the finished build will be in the following location, copy this into your SD card:
25+
> build\f7-firmware-D\.extapps\blackjack.fap

application.fam

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
App(
2+
appid="solitaire",
3+
name="Solitaire",
4+
apptype=FlipperAppType.EXTERNAL,
5+
entry_point="solitaire_app",
6+
cdefines=["APP_SOLITAIRE"],
7+
requires=["gui","storage","canvas"],
8+
stack_size=2 * 1024,
9+
order=30,
10+
fap_icon="solitaire_10px.png",
11+
fap_category="Games",
12+
fap_icon_assets="assets"
13+
)

assets/card_graphics.png

409 Bytes
Loading

assets/solitaire_main.png

1.13 KB
Loading

common

Submodule common added at 4ef796c

defines.h

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#pragma once
2+
#include <furi.h>
3+
#include <input/input.h>
4+
#include <gui/elements.h>
5+
#include <flipper_format/flipper_format.h>
6+
#include <flipper_format/flipper_format_i.h>
7+
#include "common/card.h"
8+
#include "common/queue.h"
9+
10+
#define APP_NAME "Solitaire"
11+
12+
typedef enum {
13+
EventTypeTick,
14+
EventTypeKey,
15+
} EventType;
16+
17+
typedef struct {
18+
EventType type;
19+
InputEvent input;
20+
} AppEvent;
21+
22+
typedef enum {
23+
GameStateGameOver,
24+
GameStateStart,
25+
GameStatePlay,
26+
GameStateAnimate
27+
} PlayState;
28+
29+
typedef struct {
30+
uint8_t *buffer;
31+
Card card;
32+
int8_t deck;
33+
int indexes[4];
34+
float x;
35+
float y;
36+
float vx;
37+
float vy;
38+
bool started;
39+
} CardAnimation;
40+
41+
typedef struct {
42+
Deck deck;
43+
Hand bottom_columns[7];
44+
Card top_cards[4];
45+
bool dragging_deck;
46+
uint8_t dragging_column;
47+
Hand dragging_hand;
48+
49+
InputKey input;
50+
51+
bool started;
52+
bool processing;
53+
bool longPress;
54+
PlayState state;
55+
unsigned int last_tick;
56+
uint8_t selectRow;
57+
uint8_t selectColumn;
58+
int8_t selected_card;
59+
CardAnimation animation;
60+
uint8_t *buffer;
61+
} GameState;

screenshots/solitaire.gif

3.38 MB
Loading

screenshots/solitaire.png

2.33 KB
Loading

0 commit comments

Comments
 (0)