annotate arkanoid/arkanoid.h @ 5:0c50890ef159

flappyufo-0.230919-1
author prymula <prymula76@outlook.com>
date Wed, 31 Jan 2024 13:23:13 +0100
parents 2787f5e749ae
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
prymula <prymula76@outlook.com>
parents:
diff changeset
1 /* arkanoid.h */
prymula <prymula76@outlook.com>
parents:
diff changeset
2 #include <stdio.h> // printf
prymula <prymula76@outlook.com>
parents:
diff changeset
3 #include <stdlib.h> // exit
prymula <prymula76@outlook.com>
parents:
diff changeset
4 #include <string.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
5 #include <unistd.h> // sleep access
prymula <prymula76@outlook.com>
parents:
diff changeset
6 //#include <time.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
7 //#include <errno.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
8 #include <SDL2/SDL.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
9 #include <SDL2/SDL_ttf.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
10 //#include <SDL/SDL_image.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
11 #if WINDOWS
prymula <prymula76@outlook.com>
parents:
diff changeset
12 #include <windows.h>
prymula <prymula76@outlook.com>
parents:
diff changeset
13 #include "resource.h"
prymula <prymula76@outlook.com>
parents:
diff changeset
14 #endif
prymula <prymula76@outlook.com>
parents:
diff changeset
15 #include "ball.h"
prymula <prymula76@outlook.com>
parents:
diff changeset
16
prymula <prymula76@outlook.com>
parents:
diff changeset
17 #define WIELKOSCFONTU 30
prymula <prymula76@outlook.com>
parents:
diff changeset
18
prymula <prymula76@outlook.com>
parents:
diff changeset
19 #define XPILKI 30
prymula <prymula76@outlook.com>
parents:
diff changeset
20 #define YPILKI 30
prymula <prymula76@outlook.com>
parents:
diff changeset
21 #define XPALETKI 120
prymula <prymula76@outlook.com>
parents:
diff changeset
22 #define YPALETKI YPILKI
prymula <prymula76@outlook.com>
parents:
diff changeset
23 #define XKAFLA 80
prymula <prymula76@outlook.com>
parents:
diff changeset
24 #define YKAFLA YPILKI
prymula <prymula76@outlook.com>
parents:
diff changeset
25 #define PUNKTY 50
prymula <prymula76@outlook.com>
parents:
diff changeset
26
prymula <prymula76@outlook.com>
parents:
diff changeset
27 SDL_Surface * obraz;
prymula <prymula76@outlook.com>
parents:
diff changeset
28 TTF_Font* font_panel;
prymula <prymula76@outlook.com>
parents:
diff changeset
29
prymula <prymula76@outlook.com>
parents:
diff changeset
30 typedef struct {
prymula <prymula76@outlook.com>
parents:
diff changeset
31 int px; // poprzednia pozycja x
prymula <prymula76@outlook.com>
parents:
diff changeset
32 int py; // poprzednia pozycja y
prymula <prymula76@outlook.com>
parents:
diff changeset
33 int ax; // aktualny x
prymula <prymula76@outlook.com>
parents:
diff changeset
34 int ay; // aktualny y
prymula <prymula76@outlook.com>
parents:
diff changeset
35 int kx; // kierunek x
prymula <prymula76@outlook.com>
parents:
diff changeset
36 int ky; // kierunek y
prymula <prymula76@outlook.com>
parents:
diff changeset
37 SDL_Surface * obraz;
prymula <prymula76@outlook.com>
parents:
diff changeset
38 SDL_Surface * gumka;
prymula <prymula76@outlook.com>
parents:
diff changeset
39 } RuchomyObiekt;
prymula <prymula76@outlook.com>
parents:
diff changeset
40
prymula <prymula76@outlook.com>
parents:
diff changeset
41 typedef struct {
prymula <prymula76@outlook.com>
parents:
diff changeset
42 RuchomyObiekt * pilka;
prymula <prymula76@outlook.com>
parents:
diff changeset
43 RuchomyObiekt * paletka;
prymula <prymula76@outlook.com>
parents:
diff changeset
44 // int poprzedni_y;
prymula <prymula76@outlook.com>
parents:
diff changeset
45 } Teczka;
prymula <prymula76@outlook.com>
parents:
diff changeset
46
prymula <prymula76@outlook.com>
parents:
diff changeset
47 //typedef struct {
prymula <prymula76@outlook.com>
parents:
diff changeset
48 // int * czas;
prymula <prymula76@outlook.com>
parents:
diff changeset
49 //} Teczka2;
prymula <prymula76@outlook.com>
parents:
diff changeset
50
prymula <prymula76@outlook.com>
parents:
diff changeset
51 typedef struct {
prymula <prymula76@outlook.com>
parents:
diff changeset
52 int twardosc;
prymula <prymula76@outlook.com>
parents:
diff changeset
53 int x, y;
prymula <prymula76@outlook.com>
parents:
diff changeset
54 SDL_Surface * obraz;
prymula <prymula76@outlook.com>
parents:
diff changeset
55 } Kafel;
prymula <prymula76@outlook.com>
parents:
diff changeset
56
prymula <prymula76@outlook.com>
parents:
diff changeset
57 typedef struct {
prymula <prymula76@outlook.com>
parents:
diff changeset
58 Uint8 r;
prymula <prymula76@outlook.com>
parents:
diff changeset
59 Uint8 g;
prymula <prymula76@outlook.com>
parents:
diff changeset
60 Uint8 b;
prymula <prymula76@outlook.com>
parents:
diff changeset
61 } Kolor;
prymula <prymula76@outlook.com>
parents:
diff changeset
62 /*
prymula <prymula76@outlook.com>
parents:
diff changeset
63 #if WINDOWS
prymula <prymula76@outlook.com>
parents:
diff changeset
64 char * FILE_NAME = "\\arkanoid.txt";
prymula <prymula76@outlook.com>
parents:
diff changeset
65 char * HOME = "HOMEPATH";
prymula <prymula76@outlook.com>
parents:
diff changeset
66
prymula <prymula76@outlook.com>
parents:
diff changeset
67 #elif LINUX
prymula <prymula76@outlook.com>
parents:
diff changeset
68 char * FILE_NAME = "/.arkanoid.txt";
prymula <prymula76@outlook.com>
parents:
diff changeset
69 char * HOME = "HOME";
prymula <prymula76@outlook.com>
parents:
diff changeset
70 #endif
prymula <prymula76@outlook.com>
parents:
diff changeset
71 */
prymula <prymula76@outlook.com>
parents:
diff changeset
72 /* prototypy poza plikowe */
prymula <prymula76@outlook.com>
parents:
diff changeset
73 //SDL_Surface * utworz_pilke();