-
Notifications
You must be signed in to change notification settings - Fork 0
/
maps.c
81 lines (73 loc) · 3.04 KB
/
maps.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#define _POSIX_C_SOURCE 200112L
#include "maps.h"
#include "LCD_lib.h"
#include "font.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
void welcome_screen(uint16_t *matrix,int color){
int size = 5;
int x = 24;
int y = 0;
write_background(matrix);
//clock_nanosleep()
write_char(matrix,24,100,B,color,size);
write_char(matrix,24 +(size*9)*1,100,U,color,size);
write_char(matrix,24 +(size*9)*2,100,L,color,size);
write_char(matrix,24 +(size*9)*3,100,A,color,size);
write_char(matrix,24 +(size*9)*4,100,N,color,size);
write_char(matrix,24 +(size*9)*5,100,C,color,size);
write_char(matrix,24 +(size*9)*6,100,I,color,size);
write_char(matrix,24 +(size*9)*8,100,three,color,size);
}
void map1(uint16_t *matrix, int color) // Simple map
{
write_horizon_line(matrix, 120, 60, color, 20, 120);
write_vert_line(matrix, 100, 40, color, 20, 60);
write_horizon_line(matrix, 120, 180, color, 20, 120);
write_vert_line(matrix, 240, 160, color, 20, 60);
write_horizon_line(matrix, 120, 260, color, 20, 120);
write_horizon_line(matrix, 360, 40, color, 20, 20);
write_horizon_line(matrix, 360, 100, color, 20, 20);
write_horizon_line(matrix, 360, 160, color, 20, 20);
write_horizon_line(matrix, 360, 220, color, 20, 20);
write_horizon_line(matrix, 360, 280, color, 20, 20);
}
void map2(uint16_t *matrix, int color) // Rendition of Dust 2 from Counter Strike
{
write_blank(matrix,0,0,480,320);
write_horizon_line(matrix, 0, 0, 0xccc4, 20, 480);
write_horizon_line(matrix, 0, 300, 0xccc4, 20, 480);
write_vert_line(matrix, 460, 0, 0xccc4, 20, 320);
write_vert_line(matrix, 0, 0, 0xccc4, 20, 320);
write_horizon_line(matrix, 0, 60, 0xccc4, 20, 40);
write_horizon_line(matrix, 80, 60, 0xccc4, 20, 180);
write_horizon_line(matrix, 340, 60, 0xccc4, 20, 140);
write_horizon_line(matrix, 0, 220, 0xccc4, 20, 180);
write_horizon_line(matrix, 380, 220, 0xccc4, 20, 100);
write_horizon_line(matrix, 380, 220, 0xccc4, 20, 100);
write_horizon_line(matrix, 180, 180, 0xEED6, 60, 60);
write_horizon_line(matrix, 80, 80, 0xEED6, 40, 40);
write_horizon_line(matrix, 40, 160, 0xEED6, 20, 40);
write_horizon_line(matrix, 40, 280, 0xEED6, 40, 40);
//CAR
write_horizon_line(matrix, 380, 120, 0xC618, 60, 40);
//Barrels
write_horizon_line(matrix, 180, 240, 0x0019, 20, 20); //B
write_horizon_line(matrix, 200, 240, 0xC800, 20, 20); //R
write_horizon_line(matrix, 200, 260, 0x1660, 20, 20); //G
write_char(matrix, 200, 190, B, 0xF800, 3);
}
void end_screen(uint16_t *matrix, int score){
int X = 20;
int size = 10;
write_blank(matrix,0,0,480,320);
write_background(matrix);
write_val(matrix,score,X + (size * 9)*1,160,size,0xf800,1);
write_char(matrix,X,0,S,0xFFFF,size);
write_char(matrix,X + (size * 9)*1,0,C,0xFFFF,size);
write_char(matrix,X +(size * 9)*2,0,O,0xFFFF,size);
write_char(matrix,X +(size * 9)*3,0,R,0xFFFF,size);
write_char(matrix,X +(size * 9)*4,0,E,0xFFFF,size);
}