diff --git a/.gitignore b/.gitignore
index 474e379..8134906 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,4 @@
.vscode
-build/
\ No newline at end of file
+.cache/
+build/
+compile_commands.json
\ No newline at end of file
diff --git a/assets/enemy_1.pdf b/assets/enemy_1.pdf
new file mode 100644
index 0000000..045e52c
Binary files /dev/null and b/assets/enemy_1.pdf differ
diff --git a/assets/enemy_1.svg b/assets/enemy_1.svg
new file mode 100644
index 0000000..27ad8eb
--- /dev/null
+++ b/assets/enemy_1.svg
@@ -0,0 +1,265 @@
+
+
+
+
diff --git a/misc/enemy_1.dxf b/misc/enemy_1.dxf
new file mode 100644
index 0000000..fe2cf73
--- /dev/null
+++ b/misc/enemy_1.dxf
@@ -0,0 +1,4828 @@
+999
+dxflib 3.26.4.0
+ 0
+SECTION
+ 2
+HEADER
+ 9
+$ACADVER
+ 1
+AC1015
+ 9
+$HANDSEED
+ 5
+FFFF
+ 9
+$DIMADEC
+ 70
+0
+ 9
+$DIMASZ
+ 40
+0.125
+ 9
+$DIMATFIT
+ 70
+0
+ 9
+$DIMAUNIT
+ 70
+0
+ 9
+$DIMAZIN
+ 70
+2
+ 9
+$DIMBLK
+ 1
+
+ 9
+$DIMDEC
+ 70
+4
+ 9
+$DIMDLI
+ 40
+0.25
+ 9
+$DIMDSEP
+ 70
+46
+ 9
+$DIMEXE
+ 40
+0.0625
+ 9
+$DIMEXO
+ 40
+0.03125
+ 9
+$DIMGAP
+ 40
+0.03125
+ 9
+$DIMLFAC
+ 40
+1.0
+ 9
+$DIMLUNIT
+ 70
+2
+ 9
+$DIMSCALE
+ 40
+1.0
+ 9
+$DIMTAD
+ 70
+1
+ 9
+$DIMTIH
+ 70
+0
+ 9
+$DIMTSZ
+ 40
+0.0
+ 9
+$DIMTXT
+ 40
+0.125
+ 9
+$DIMZIN
+ 70
+8
+ 9
+$DWGCODEPAGE
+ 3
+ANSI_1252
+ 9
+$INSUNITS
+ 70
+4
+ 9
+$LTSCALE
+ 40
+1.0
+ 9
+$MAXACTVP
+ 70
+64
+ 9
+$MEASUREMENT
+ 70
+1
+ 9
+$MIRRTEXT
+ 70
+0
+ 9
+$PDMODE
+ 70
+0
+ 9
+$PDSIZE
+ 40
+0.0
+ 0
+ENDSEC
+ 0
+SECTION
+ 2
+TABLES
+ 0
+TABLE
+ 2
+VPORT
+ 5
+8
+100
+AcDbSymbolTable
+ 70
+1
+ 0
+VPORT
+ 5
+30
+100
+AcDbSymbolTableRecord
+100
+AcDbViewportTableRecord
+ 2
+*Active
+ 70
+0
+ 10
+0.0
+ 20
+0.0
+ 11
+1.0
+ 21
+1.0
+ 12
+286.3055555555554861
+ 22
+148.5
+ 13
+0.0
+ 23
+0.0
+ 14
+10.0
+ 24
+10.0
+ 15
+10.0
+ 25
+10.0
+ 16
+0.0
+ 26
+0.0
+ 36
+1.0
+ 17
+0.0
+ 27
+0.0
+ 37
+0.0
+ 40
+297.0
+ 41
+1.92798353909465
+ 42
+50.0
+ 43
+0.0
+ 44
+0.0
+ 50
+0.0
+ 51
+0.0
+ 71
+0
+ 72
+100
+ 73
+1
+ 74
+3
+ 75
+1
+ 76
+1
+ 77
+0
+ 78
+0
+281
+0
+ 65
+1
+110
+0.0
+120
+0.0
+130
+0.0
+111
+1.0
+121
+0.0
+131
+0.0
+112
+0.0
+122
+1.0
+132
+0.0
+ 79
+0
+146
+0.0
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+LTYPE
+ 5
+5
+100
+AcDbSymbolTable
+ 70
+41
+ 0
+LTYPE
+ 5
+16
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+Continuous
+ 70
+0
+ 3
+Solid line
+ 72
+65
+ 73
+0
+ 40
+0.0
+ 0
+LTYPE
+ 5
+31
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DASHDOT2
+ 70
+0
+ 3
+Dash dot (.5x) _._._._._._._._._._._._._._._.
+ 72
+65
+ 73
+4
+ 40
+12.6999999999999993
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+LTYPE
+ 5
+32
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+CENTER
+ 70
+0
+ 3
+Center ____ _ ____ _ ____ _ ____ _ ____ _ ____
+ 72
+65
+ 73
+4
+ 40
+50.8000000000000043
+ 49
+31.75
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+15
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+BYLAYER
+ 70
+0
+ 3
+
+ 72
+65
+ 73
+0
+ 40
+0.0
+ 0
+LTYPE
+ 5
+33
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+CENTERX2
+ 70
+0
+ 3
+Center (2x) ________ __ ________ __ _____
+ 72
+65
+ 73
+4
+ 40
+101.6000000000000085
+ 49
+63.5
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 0
+LTYPE
+ 5
+34
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+HIDDEN2
+ 70
+0
+ 3
+Hidden (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+ 72
+65
+ 73
+2
+ 40
+4.7624999999999993
+ 49
+3.1749999999999998
+ 74
+0
+ 49
+-1.5874999999999999
+ 74
+0
+ 0
+LTYPE
+ 5
+35
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO15W100
+ 70
+0
+ 3
+ISO double-dash triple-dot __ __ . . . __ __ . .
+ 72
+65
+ 73
+10
+ 40
+39.0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+36
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO04W100
+ 70
+0
+ 3
+ISO long-dash dot ____ . ____ . ____ . ____ . _
+ 72
+65
+ 73
+4
+ 40
+30.0
+ 49
+24.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+37
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DOT
+ 70
+0
+ 3
+Dot . . . . . . . . . . . . . . . . . . . . . . . .
+ 72
+65
+ 73
+2
+ 40
+6.3499999999999996
+ 49
+0.0
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+38
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO07W100
+ 70
+0
+ 3
+ISO dot . . . . . . . . . . . . . . . . . . . .
+ 72
+65
+ 73
+2
+ 40
+3.0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+39
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+HIDDEN
+ 70
+0
+ 3
+Hidden __ __ __ __ __ __ __ __ __ __ __ __ __ __
+ 72
+65
+ 73
+2
+ 40
+9.5249999999999986
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+LTYPE
+ 5
+3A
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DASHDOTX2
+ 70
+0
+ 3
+Dash dot (2x) ____ . ____ . ____ . ___
+ 72
+65
+ 73
+4
+ 40
+50.7999999999999972
+ 49
+25.3999999999999986
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 0
+LTYPE
+ 5
+3B
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+PHANTOM2
+ 70
+0
+ 3
+Phantom (.5x) ___ _ _ ___ _ _ ___ _ _ ___ _ _
+ 72
+65
+ 73
+6
+ 40
+31.7500000000000036
+ 49
+15.875
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+3.1749999999999998
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+3.1749999999999998
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+LTYPE
+ 5
+3C
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO11W100
+ 70
+0
+ 3
+ISO double-dash dot __ __ . __ __ . __ __ . __ _
+ 72
+65
+ 73
+6
+ 40
+33.0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+3D
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DIVIDEX2
+ 70
+0
+ 3
+Divide (2x) ________ . . ________ . . _
+ 72
+65
+ 73
+6
+ 40
+63.5
+ 49
+25.3999999999999986
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 0
+LTYPE
+ 5
+3E
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO10W100
+ 70
+0
+ 3
+ISO dash dot __ . __ . __ . __ . __ . __ . __ .
+ 72
+65
+ 73
+4
+ 40
+18.0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+3F
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO08W100
+ 70
+0
+ 3
+ISO long-dash short-dash ____ __ ____ __ ____ _
+ 72
+65
+ 73
+4
+ 40
+36.0
+ 49
+24.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+6.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+40
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+HIDDENX2
+ 70
+0
+ 3
+Hidden (2x) ____ ____ ____ ____ ____ ____ ____
+ 72
+65
+ 73
+2
+ 40
+19.0499999999999972
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+41
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+PHANTOM
+ 70
+0
+ 3
+Phantom ______ __ __ ______ __ __ ______
+ 72
+65
+ 73
+6
+ 40
+63.5000000000000071
+ 49
+31.75
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+42
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO09W100
+ 70
+0
+ 3
+ISO long-dash double-short-dash ____ __ __ ____
+ 72
+65
+ 73
+6
+ 40
+45.0
+ 49
+24.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+6.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+6.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+43
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DIVIDE
+ 70
+0
+ 3
+Divide ____ . . ____ . . ____ . . ____ . . ____
+ 72
+65
+ 73
+6
+ 40
+31.75
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+44
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO14W100
+ 70
+0
+ 3
+ISO dash triple-dot __ . . . __ . . . __ . . . _
+ 72
+65
+ 73
+8
+ 40
+24.0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+45
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DASHED2
+ 70
+0
+ 3
+Dashed (.5x) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+ 72
+65
+ 73
+2
+ 40
+9.5249999999999986
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+LTYPE
+ 5
+46
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO05W100
+ 70
+0
+ 3
+ISO long-dash double-dot ____ .. ____ .. ____ .
+ 72
+65
+ 73
+6
+ 40
+33.0
+ 49
+24.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+47
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DIVIDE2
+ 70
+0
+ 3
+Divide (.5x) __..__..__..__..__..__..__..__.._
+ 72
+65
+ 73
+6
+ 40
+15.875
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+LTYPE
+ 5
+48
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DASHED
+ 70
+0
+ 3
+Dashed __ __ __ __ __ __ __ __ __ __ __ __ __ _
+ 72
+65
+ 73
+2
+ 40
+19.0499999999999972
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+49
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DOT2
+ 70
+0
+ 3
+Dot (.5x) ........................................
+ 72
+65
+ 73
+2
+ 40
+3.1749999999999998
+ 49
+0.0
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+LTYPE
+ 5
+4A
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DASHEDX2
+ 70
+0
+ 3
+Dashed (2x) ____ ____ ____ ____ ____ ___
+ 72
+65
+ 73
+2
+ 40
+38.0999999999999943
+ 49
+25.3999999999999986
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 0
+LTYPE
+ 5
+4B
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO13W100
+ 70
+0
+ 3
+ISO double-dash double-dot __ __ . . __ __ . . _
+ 72
+65
+ 73
+8
+ 40
+36.0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+14
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+BYBLOCK
+ 70
+0
+ 3
+
+ 72
+65
+ 73
+0
+ 40
+0.0
+ 0
+LTYPE
+ 5
+4C
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DASHDOT
+ 70
+0
+ 3
+Dash dot __ . __ . __ . __ . __ . __ . __ . __
+ 72
+65
+ 73
+4
+ 40
+25.3999999999999986
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+4D
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+BORDER
+ 70
+0
+ 3
+Border __ __ . __ __ . __ __ . __ __ . __ __ .
+ 72
+65
+ 73
+6
+ 40
+44.4499999999999957
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-6.3499999999999996
+ 74
+0
+ 0
+LTYPE
+ 5
+4E
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO02W100
+ 70
+0
+ 3
+ISO dash __ __ __ __ __ __ __ __ __ __ __ __ __
+ 72
+65
+ 73
+2
+ 40
+15.0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+4F
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO06W100
+ 70
+0
+ 3
+ISO long-dash triple-dot ____ ... ____ ... ____
+ 72
+65
+ 73
+8
+ 40
+36.0
+ 49
+24.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+50
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+BORDERX2
+ 70
+0
+ 3
+Border (2x) ____ ____ . ____ ____ . ___
+ 72
+65
+ 73
+6
+ 40
+88.8999999999999915
+ 49
+25.3999999999999986
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+25.3999999999999986
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 0
+LTYPE
+ 5
+51
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+DOTX2
+ 70
+0
+ 3
+Dot (2x) . . . . . . . . . . . . . .
+ 72
+65
+ 73
+2
+ 40
+12.6999999999999993
+ 49
+0.0
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 0
+LTYPE
+ 5
+52
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+PHANTOMX2
+ 70
+0
+ 3
+Phantom (2x) ____________ ____ ____ _
+ 72
+65
+ 73
+6
+ 40
+127.0000000000000142
+ 49
+63.5
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 49
+12.6999999999999993
+ 74
+0
+ 49
+-12.6999999999999993
+ 74
+0
+ 0
+LTYPE
+ 5
+53
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+BORDER2
+ 70
+0
+ 3
+Border (.5x) __.__.__.__.__.__.__.__.__.__.__.
+ 72
+65
+ 73
+6
+ 40
+22.2249999999999979
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+6.3499999999999996
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+LTYPE
+ 5
+54
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO12W100
+ 70
+0
+ 3
+ISO dash double-dot __ . . __ . . __ . . __ . .
+ 72
+65
+ 73
+6
+ 40
+21.0
+ 49
+12.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 49
+0.0
+ 74
+0
+ 49
+-3.0
+ 74
+0
+ 0
+LTYPE
+ 5
+55
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+ACAD_ISO03W100
+ 70
+0
+ 3
+ISO dash space __ __ __ __ __ __
+ 72
+65
+ 73
+2
+ 40
+30.0
+ 49
+12.0
+ 74
+0
+ 49
+-18.0
+ 74
+0
+ 0
+LTYPE
+ 5
+56
+100
+AcDbSymbolTableRecord
+100
+AcDbLinetypeTableRecord
+ 2
+CENTER2
+ 70
+0
+ 3
+Center (.5x) ___ _ ___ _ ___ _ ___ _ ___ _ ___
+ 72
+65
+ 73
+4
+ 40
+28.5750000000000028
+ 49
+19.0500000000000007
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 49
+3.1749999999999998
+ 74
+0
+ 49
+-3.1749999999999998
+ 74
+0
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+LAYER
+ 5
+2
+100
+AcDbSymbolTable
+ 70
+3
+ 0
+LAYER
+ 5
+57
+100
+AcDbSymbolTableRecord
+100
+AcDbLayerTableRecord
+ 2
+layer 2
+ 70
+0
+ 62
+7
+420
+16777215
+ 6
+Continuous
+370
+5
+390
+F
+ 0
+LAYER
+ 5
+58
+100
+AcDbSymbolTableRecord
+100
+AcDbLayerTableRecord
+ 2
+layer 1
+ 70
+0
+ 62
+7
+420
+16777215
+ 6
+Continuous
+370
+9
+390
+F
+ 0
+LAYER
+ 5
+10
+100
+AcDbSymbolTableRecord
+100
+AcDbLayerTableRecord
+ 2
+0
+ 70
+0
+ 62
+7
+420
+16777215
+ 6
+Continuous
+370
+15
+390
+F
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+STYLE
+ 5
+3
+100
+AcDbSymbolTable
+ 70
+1
+ 0
+STYLE
+ 5
+59
+100
+AcDbSymbolTableRecord
+100
+AcDbTextStyleTableRecord
+ 2
+Standard
+ 70
+0
+ 40
+0.0
+ 41
+1.0
+ 50
+0.0
+ 71
+0
+ 42
+2.5
+ 3
+
+ 4
+
+1001
+ACAD
+1000
+txt
+1071
+0
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+VIEW
+ 5
+6
+100
+AcDbSymbolTable
+ 70
+0
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+UCS
+ 5
+7
+100
+AcDbSymbolTable
+ 70
+0
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+APPID
+ 5
+9
+100
+AcDbSymbolTable
+ 70
+1
+ 0
+APPID
+ 5
+12
+100
+AcDbSymbolTableRecord
+100
+AcDbRegAppTableRecord
+ 2
+ACAD
+ 70
+0
+ 0
+APPID
+ 5
+5A
+100
+AcDbSymbolTableRecord
+100
+AcDbRegAppTableRecord
+ 2
+QCAD
+ 70
+0
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+DIMSTYLE
+ 5
+A
+100
+AcDbSymbolTable
+ 70
+1
+100
+AcDbDimStyleTable
+ 71
+0
+ 0
+DIMSTYLE
+105
+27
+100
+AcDbSymbolTableRecord
+100
+AcDbDimStyleTableRecord
+ 2
+Standard
+ 41
+0.125
+ 42
+0.03125
+ 43
+3.75
+ 44
+0.0625
+ 70
+0
+ 73
+0
+ 74
+0
+ 77
+1
+ 78
+8
+140
+0.125
+141
+2.5
+143
+0.03937007874016
+147
+0.03125
+171
+3
+172
+1
+271
+2
+272
+2
+274
+3
+278
+44
+283
+0
+284
+8
+340
+59
+ 0
+ENDTAB
+ 0
+TABLE
+ 2
+BLOCK_RECORD
+ 5
+1
+100
+AcDbSymbolTable
+ 70
+1
+ 0
+BLOCK_RECORD
+ 5
+1F
+100
+AcDbSymbolTableRecord
+100
+AcDbBlockTableRecord
+ 2
+*Model_Space
+340
+22
+ 0
+BLOCK_RECORD
+ 5
+1B
+100
+AcDbSymbolTableRecord
+100
+AcDbBlockTableRecord
+ 2
+*Paper_Space
+340
+1E
+ 0
+BLOCK_RECORD
+ 5
+23
+100
+AcDbSymbolTableRecord
+100
+AcDbBlockTableRecord
+ 2
+*Paper_Space0
+340
+26
+ 0
+ENDTAB
+ 0
+ENDSEC
+ 0
+SECTION
+ 2
+BLOCKS
+ 0
+BLOCK
+ 5
+20
+100
+AcDbEntity
+ 8
+0
+100
+AcDbBlockBegin
+ 2
+*Model_Space
+ 70
+0
+ 10
+0.0
+ 20
+0.0
+ 30
+0.0
+ 3
+*Model_Space
+ 1
+
+ 0
+ENDBLK
+ 5
+21
+100
+AcDbEntity
+ 8
+0
+100
+AcDbBlockEnd
+ 0
+BLOCK
+ 5
+1C
+100
+AcDbEntity
+ 67
+1
+ 8
+0
+100
+AcDbBlockBegin
+ 2
+*Paper_Space
+ 70
+0
+ 10
+0.0
+ 20
+0.0
+ 30
+0.0
+ 3
+*Paper_Space
+ 1
+
+ 0
+ENDBLK
+ 5
+1D
+100
+AcDbEntity
+ 67
+1
+ 8
+0
+100
+AcDbBlockEnd
+ 0
+BLOCK
+ 5
+24
+100
+AcDbEntity
+ 8
+0
+100
+AcDbBlockBegin
+ 2
+*Paper_Space0
+ 70
+0
+ 10
+0.0
+ 20
+0.0
+ 30
+0.0
+ 3
+*Paper_Space0
+ 1
+
+ 0
+ENDBLK
+ 5
+25
+100
+AcDbEntity
+ 8
+0
+100
+AcDbBlockEnd
+ 0
+ENDSEC
+ 0
+SECTION
+ 2
+ENTITIES
+ 0
+LINE
+ 5
+5B
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.3
+ 20
+6.9999999999999991
+ 30
+0.0
+ 11
+1.4620694805455468
+ 21
+6.9999999999999991
+ 31
+0.0
+ 0
+LINE
+ 5
+5C
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.4620508075688754
+ 20
+2.0
+ 30
+0.0
+ 11
+0.0
+ 21
+2.0
+ 31
+0.0
+ 0
+LINE
+ 5
+5D
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.0
+ 20
+6.0
+ 30
+0.0
+ 11
+0.0
+ 21
+6.7999999999999998
+ 31
+0.0
+ 0
+LINE
+ 5
+5E
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.0
+ 20
+6.5
+ 30
+0.0
+ 11
+0.9999999999999999
+ 21
+6.4999999999999991
+ 31
+0.0
+ 0
+LINE
+ 5
+5F
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.3909157412340154
+ 20
+6.6882550990706324
+ 30
+0.0
+ 11
+1.462069480545547
+ 21
+6.9999999999999991
+ 31
+0.0
+ 0
+LINE
+ 5
+60
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.9999999999999996
+ 20
+6.4999999999999991
+ 30
+0.0
+ 11
+1.3909157412340154
+ 21
+6.6882550990706324
+ 31
+0.0
+ 0
+ARC
+ 5
+61
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbCircle
+ 10
+0.2999090564132529
+ 20
+6.6751364153801207
+ 30
+0.0
+ 40
+0.3248635973494304
+100
+AcDbArc
+ 50
+89.983960395055135
+ 51
+157.3961746569043783
+ 0
+LINE
+ 5
+62
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.4999999999999999
+ 20
+6.9999999999999991
+ 30
+0.0
+ 11
+-0.0
+ 21
+6.5
+ 31
+0.0
+ 0
+LINE
+ 5
+63
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.9999999999999999
+ 20
+6.9999999999999991
+ 30
+0.0
+ 11
+0.4999999999999999
+ 21
+6.5
+ 31
+0.0
+ 0
+LINE
+ 5
+64
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.7320508075688763
+ 20
+2.9999999999999991
+ 30
+0.0
+ 11
+1.7320508075688776
+ 21
+4.9999999999999982
+ 31
+0.0
+ 0
+LINE
+ 5
+65
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.7320508075688776
+ 20
+4.9999999999999982
+ 30
+0.0
+ 11
+0.0000000000000002
+ 21
+6.0
+ 31
+0.0
+ 0
+LINE
+ 5
+66
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+-0.0000000000000012
+ 20
+2.0
+ 30
+0.0
+ 11
+1.7320508075688763
+ 21
+2.9999999999999991
+ 31
+0.0
+ 0
+ARC
+ 5
+67
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbCircle
+ 10
+-1.8763883748662848
+ 20
+4.0000000000000027
+ 30
+0.0
+ 40
+2.7424137786507239
+100
+AcDbArc
+ 50
+313.173551107258902
+ 51
+46.8264488927410198
+ 0
+LINE
+ 5
+68
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.866025403784439
+ 20
+4.0
+ 30
+0.0
+ 11
+1.7320508075688776
+ 21
+4.9999999999999973
+ 31
+0.0
+ 0
+LINE
+ 5
+69
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.866025403784439
+ 20
+4.0
+ 30
+0.0
+ 11
+1.7320508075688763
+ 21
+2.9999999999999991
+ 31
+0.0
+ 0
+LINE
+ 5
+6A
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.2990381056766576
+ 20
+3.4999999999999996
+ 30
+0.0
+ 11
+1.732050807568877
+ 21
+3.9999999999999987
+ 31
+0.0
+ 0
+LINE
+ 5
+6B
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.732050807568877
+ 20
+3.9999999999999987
+ 30
+0.0
+ 11
+1.2990381056766584
+ 21
+4.4999999999999982
+ 31
+0.0
+ 0
+LINE
+ 5
+6C
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.866025403784439
+ 20
+4.0
+ 30
+0.0
+ 11
+-0.2
+ 21
+3.9999999999999996
+ 31
+0.0
+ 0
+LINE
+ 5
+6D
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+-0.3500000000000001
+ 20
+3.740192378864668
+ 30
+0.0
+ 11
+0.1
+ 21
+3.9999999999999996
+ 31
+0.0
+ 0
+LINE
+ 5
+6E
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+0.1
+ 20
+3.9999999999999996
+ 30
+0.0
+ 11
+-0.3499999999999999
+ 21
+4.2598076211353311
+ 31
+0.0
+ 0
+LINE
+ 5
+6F
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+-0.3500000000000001
+ 20
+3.7401923788646685
+ 30
+0.0
+ 11
+1.7320508075688763
+ 21
+2.9999999999999991
+ 31
+0.0
+ 0
+LINE
+ 5
+70
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+-0.3499999999999999
+ 20
+4.2598076211353302
+ 30
+0.0
+ 11
+1.7320508075688776
+ 21
+4.9999999999999973
+ 31
+0.0
+ 0
+ARC
+ 5
+71
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbCircle
+ 10
+-0.7971428571428585
+ 20
+4.0
+ 30
+0.0
+ 40
+0.5171428571428587
+100
+AcDbArc
+ 50
+329.8417241646845355
+ 51
+30.1582758353154645
+ 0
+LINE
+ 5
+72
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.462069480545547
+ 20
+7.0
+ 30
+0.0
+ 11
+3.0
+ 21
+6.0
+ 31
+0.0
+ 0
+LINE
+ 5
+73
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+1.4620508075688754
+ 20
+2.0
+ 30
+0.0
+ 11
+3.0
+ 21
+2.5
+ 31
+0.0
+ 0
+LINE
+ 5
+74
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.0
+ 20
+2.5
+ 30
+0.0
+ 11
+3.2999999999999998
+ 21
+2.9999999999999996
+ 31
+0.0
+ 0
+LINE
+ 5
+75
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.0
+ 20
+6.0
+ 30
+0.0
+ 11
+3.2999999999999998
+ 21
+5.2999999999999998
+ 31
+0.0
+ 0
+LINE
+ 5
+76
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.2999999999999998
+ 20
+2.9999999999999996
+ 30
+0.0
+ 11
+5.0
+ 21
+3.0
+ 31
+0.0
+ 0
+LINE
+ 5
+77
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+5.0
+ 20
+3.0
+ 30
+0.0
+ 11
+4.3999999999999995
+ 21
+2.5999999999999996
+ 31
+0.0
+ 0
+LINE
+ 5
+78
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+4.3999999999999995
+ 20
+2.5999999999999996
+ 30
+0.0
+ 11
+7.9999999999999991
+ 21
+2.5999999999999996
+ 31
+0.0
+ 0
+LINE
+ 5
+79
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+7.9999999999999991
+ 20
+2.5999999999999996
+ 30
+0.0
+ 11
+9.0
+ 21
+3.0
+ 31
+0.0
+ 0
+LINE
+ 5
+7A
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.2999999999999998
+ 20
+5.2999999999999998
+ 30
+0.0
+ 11
+5.0
+ 21
+5.2999999999999998
+ 31
+0.0
+ 0
+LINE
+ 5
+7B
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+5.0
+ 20
+5.2999999999999998
+ 30
+0.0
+ 11
+4.4000000000000004
+ 21
+5.7000000000000002
+ 31
+0.0
+ 0
+LINE
+ 5
+7C
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+4.4000000000000004
+ 20
+5.7000000000000002
+ 30
+0.0
+ 11
+8.0
+ 21
+5.7000000000000002
+ 31
+0.0
+ 0
+LINE
+ 5
+7D
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+8.0
+ 20
+5.7000000000000002
+ 30
+0.0
+ 11
+9.0
+ 21
+5.2999999999999998
+ 31
+0.0
+ 0
+LINE
+ 5
+7E
+100
+AcDbEntity
+ 8
+0
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+9.0
+ 20
+5.2999999999999998
+ 30
+0.0
+ 11
+9.0
+ 21
+3.0
+ 31
+0.0
+ 0
+LINE
+ 5
+7F
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.0999999999999996
+ 20
+5.0
+ 30
+0.0
+ 11
+5.0
+ 21
+5.0
+ 31
+0.0
+ 0
+LINE
+ 5
+80
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+5.0
+ 20
+5.0
+ 30
+0.0
+ 11
+5.2999999999999998
+ 21
+4.6999999999999993
+ 31
+0.0
+ 0
+LINE
+ 5
+81
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.0999999999999996
+ 20
+5.0
+ 30
+0.0
+ 11
+3.3999999999999999
+ 21
+4.6999999999999993
+ 31
+0.0
+ 0
+LINE
+ 5
+82
+100
+AcDbEntity
+ 8
+layer 1
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.3999999999999999
+ 20
+4.6999999999999993
+ 30
+0.0
+ 11
+5.2999999999999998
+ 21
+4.6999999999999993
+ 31
+0.0
+ 0
+LINE
+ 5
+83
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+3.0999999999999988
+ 20
+4.9999999999999991
+ 30
+0.0
+ 11
+5.3000000000000007
+ 21
+4.6999999999999993
+ 31
+0.0
+ 0
+LINE
+ 5
+84
+100
+AcDbEntity
+ 8
+layer 2
+ 62
+256
+370
+-1
+ 48
+1.0
+ 6
+BYLAYER
+100
+AcDbLine
+ 10
+4.0499999999999998
+ 20
+5.0
+ 30
+0.0
+ 11
+5.3000000000000007
+ 21
+4.6999999999999993
+ 31
+0.0
+ 0
+ENDSEC
+ 0
+SECTION
+ 2
+OBJECTS
+ 0
+DICTIONARY
+ 5
+C
+100
+AcDbDictionary
+280
+0
+281
+1
+ 3
+ACAD_GROUP
+350
+D
+ 3
+ACAD_LAYOUT
+350
+1A
+ 3
+ACAD_MLINESTYLE
+350
+17
+ 3
+ACAD_PLOTSETTINGS
+350
+19
+ 3
+ACAD_PLOTSTYLENAME
+350
+E
+ 3
+AcDbVariableDictionary
+350
+85
+ 3
+QCAD_OBJECTS
+350
+86
+ 0
+DICTIONARY
+ 5
+D
+100
+AcDbDictionary
+280
+0
+281
+1
+ 0
+ACDBDICTIONARYWDFLT
+ 5
+E
+100
+AcDbDictionary
+281
+1
+ 3
+Normal
+350
+F
+100
+AcDbDictionaryWithDefault
+340
+F
+ 0
+ACDBPLACEHOLDER
+ 5
+F
+ 0
+DICTIONARY
+ 5
+17
+100
+AcDbDictionary
+280
+0
+281
+1
+ 3
+Standard
+350
+18
+ 0
+MLINESTYLE
+ 5
+18
+100
+AcDbMlineStyle
+ 2
+STANDARD
+ 70
+0
+ 3
+
+ 62
+256
+ 51
+90.0
+ 52
+90.0
+ 71
+2
+ 49
+0.5
+ 62
+256
+ 6
+BYLAYER
+ 49
+-0.5
+ 62
+256
+ 6
+BYLAYER
+ 0
+DICTIONARY
+ 5
+19
+100
+AcDbDictionary
+280
+0
+281
+1
+ 0
+DICTIONARY
+ 5
+1A
+100
+AcDbDictionary
+281
+1
+ 3
+Layout1
+350
+1E
+ 3
+Layout2
+350
+26
+ 3
+Model
+350
+22
+ 0
+LAYOUT
+ 5
+1E
+100
+AcDbPlotSettings
+ 1
+
+ 2
+none_device
+ 4
+
+ 6
+
+ 40
+0.0
+ 41
+0.0
+ 42
+0.0
+ 43
+0.0
+ 44
+0.0
+ 45
+0.0
+ 46
+0.0
+ 47
+0.0
+ 48
+0.0
+ 49
+0.0
+140
+0.0
+141
+0.0
+142
+1.0
+143
+1.0
+ 70
+688
+ 72
+0
+ 73
+0
+ 74
+5
+ 7
+
+ 75
+16
+147
+1.0
+148
+0.0
+149
+0.0
+100
+AcDbLayout
+ 1
+Layout1
+ 70
+1
+ 71
+1
+ 10
+0.0
+ 20
+0.0
+ 11
+420.0
+ 21
+297.0
+ 12
+0.0
+ 22
+0.0
+ 32
+0.0
+ 14
+100000000000000000000.0
+ 24
+100000000000000000000.0
+ 34
+100000000000000000000.0
+ 15
+-100000000000000000000.0
+ 25
+-100000000000000000000.0
+ 35
+-100000000000000000000.0
+146
+0.0
+ 13
+0.0
+ 23
+0.0
+ 33
+0.0
+ 16
+1.0
+ 26
+0.0
+ 36
+0.0
+ 17
+0.0
+ 27
+1.0
+ 37
+0.0
+ 76
+0
+330
+1B
+ 0
+LAYOUT
+ 5
+22
+100
+AcDbPlotSettings
+ 1
+
+ 2
+none_device
+ 4
+
+ 6
+
+ 40
+0.0
+ 41
+0.0
+ 42
+0.0
+ 43
+0.0
+ 44
+0.0
+ 45
+0.0
+ 46
+0.0
+ 47
+0.0
+ 48
+0.0
+ 49
+0.0
+140
+0.0
+141
+0.0
+142
+1.0
+143
+1.0
+ 70
+1712
+ 72
+0
+ 73
+0
+ 74
+0
+ 7
+
+ 75
+0
+147
+1.0
+148
+0.0
+149
+0.0
+100
+AcDbLayout
+ 1
+Model
+ 70
+1
+ 71
+0
+ 10
+0.0
+ 20
+0.0
+ 11
+12.0
+ 21
+9.0
+ 12
+0.0
+ 22
+0.0
+ 32
+0.0
+ 14
+0.0
+ 24
+0.0
+ 34
+0.0
+ 15
+0.0
+ 25
+0.0
+ 35
+0.0
+146
+0.0
+ 13
+0.0
+ 23
+0.0
+ 33
+0.0
+ 16
+1.0
+ 26
+0.0
+ 36
+0.0
+ 17
+0.0
+ 27
+1.0
+ 37
+0.0
+ 76
+0
+330
+1F
+ 0
+LAYOUT
+ 5
+26
+100
+AcDbPlotSettings
+ 1
+
+ 2
+none_device
+ 4
+
+ 6
+
+ 40
+0.0
+ 41
+0.0
+ 42
+0.0
+ 43
+0.0
+ 44
+0.0
+ 45
+0.0
+ 46
+0.0
+ 47
+0.0
+ 48
+0.0
+ 49
+0.0
+140
+0.0
+141
+0.0
+142
+1.0
+143
+1.0
+ 70
+688
+ 72
+0
+ 73
+0
+ 74
+5
+ 7
+
+ 75
+16
+147
+1.0
+148
+0.0
+149
+0.0
+100
+AcDbLayout
+ 1
+Layout2
+ 70
+1
+ 71
+2
+ 10
+0.0
+ 20
+0.0
+ 11
+12.0
+ 21
+9.0
+ 12
+0.0
+ 22
+0.0
+ 32
+0.0
+ 14
+0.0
+ 24
+0.0
+ 34
+0.0
+ 15
+0.0
+ 25
+0.0
+ 35
+0.0
+146
+0.0
+ 13
+0.0
+ 23
+0.0
+ 33
+0.0
+ 16
+1.0
+ 26
+0.0
+ 36
+0.0
+ 17
+0.0
+ 27
+1.0
+ 37
+0.0
+ 76
+0
+330
+23
+ 0
+DICTIONARY
+ 5
+85
+100
+AcDbDictionary
+281
+1
+ 3
+DIMASSOC
+350
+88
+ 3
+HIDETEXT
+350
+87
+ 0
+DICTIONARYVAR
+ 5
+87
+100
+DictionaryVariables
+280
+0
+ 1
+2
+ 0
+DICTIONARYVAR
+ 5
+88
+100
+DictionaryVariables
+280
+0
+ 1
+1
+ 0
+DICTIONARY
+ 5
+86
+100
+AcDbDictionary
+281
+1
+ 3
+ColorSettings/BackgroundColor
+350
+89
+ 3
+ColorSettings/ColorMode
+350
+8A
+ 3
+Grid/DisplayGrid00
+350
+8B
+ 3
+Grid/DisplayGrid01
+350
+8C
+ 3
+Grid/DisplayGrid02
+350
+8D
+ 3
+Grid/DisplayGrid03
+350
+8E
+ 3
+Grid/GridSpacingX00
+350
+8F
+ 3
+Grid/GridSpacingX01
+350
+90
+ 3
+Grid/GridSpacingX02
+350
+91
+ 3
+Grid/GridSpacingX03
+350
+92
+ 3
+Grid/GridSpacingY00
+350
+93
+ 3
+Grid/GridSpacingY01
+350
+94
+ 3
+Grid/GridSpacingY02
+350
+95
+ 3
+Grid/GridSpacingY03
+350
+96
+ 3
+Grid/IsometricGrid00
+350
+97
+ 3
+Grid/IsometricGrid01
+350
+98
+ 3
+Grid/IsometricGrid02
+350
+99
+ 3
+Grid/IsometricGrid03
+350
+9A
+ 3
+Grid/IsometricProjection00
+350
+9B
+ 3
+Grid/IsometricProjection01
+350
+9C
+ 3
+Grid/IsometricProjection02
+350
+9D
+ 3
+Grid/IsometricProjection03
+350
+9E
+ 3
+Grid/MetaGridSpacingX00
+350
+9F
+ 3
+Grid/MetaGridSpacingX01
+350
+A0
+ 3
+Grid/MetaGridSpacingX02
+350
+A1
+ 3
+Grid/MetaGridSpacingX03
+350
+A2
+ 3
+Grid/MetaGridSpacingY00
+350
+A3
+ 3
+Grid/MetaGridSpacingY01
+350
+A4
+ 3
+Grid/MetaGridSpacingY02
+350
+A5
+ 3
+Grid/MetaGridSpacingY03
+350
+A6
+ 3
+MultiPageSettings/Columns
+350
+A7
+ 3
+MultiPageSettings/GlueMarginsBottom
+350
+A8
+ 3
+MultiPageSettings/GlueMarginsLeft
+350
+A9
+ 3
+MultiPageSettings/GlueMarginsRight
+350
+AA
+ 3
+MultiPageSettings/GlueMarginsTop
+350
+AB
+ 3
+MultiPageSettings/PrintCropMarks
+350
+AC
+ 3
+MultiPageSettings/Rows
+350
+AD
+ 3
+PageSettings/OffsetX
+350
+AE
+ 3
+PageSettings/OffsetY
+350
+AF
+ 3
+PageSettings/PageOrientation
+350
+B0
+ 3
+PageSettings/PaperHeight
+350
+B1
+ 3
+PageSettings/PaperWidth
+350
+B2
+ 3
+PageSettings/Scale
+350
+B3
+ 3
+PageSettings/ShowPaperBorders
+350
+B4
+ 3
+PageTagSettings/EnablePageTags
+350
+B5
+ 3
+PageTagSettings/TagAlignment
+350
+B6
+ 3
+PageTagSettings/TagFont
+350
+B7
+ 3
+PageTagSettings/TagPosition
+350
+B8
+ 3
+QCADVersion
+350
+B9
+ 3
+UnitSettings/PaperUnit
+350
+BA
+ 3
+ViewportCenter
+350
+BB
+ 3
+ViewportHeight
+350
+BC
+ 3
+ViewportWidth
+350
+BD
+ 0
+XRECORD
+ 5
+8A
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+FullColor
+ 0
+XRECORD
+ 5
+8B
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+1
+ 0
+XRECORD
+ 5
+8C
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+1
+ 0
+XRECORD
+ 5
+8D
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+1
+ 0
+XRECORD
+ 5
+8E
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+1
+ 0
+XRECORD
+ 5
+8F
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+90
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+91
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+92
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+93
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+94
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+95
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+96
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+97
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+0
+ 0
+XRECORD
+ 5
+98
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+0
+ 0
+XRECORD
+ 5
+99
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+0
+ 0
+XRECORD
+ 5
+9A
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+0
+ 0
+XRECORD
+ 5
+9B
+330
+86
+100
+AcDbXrecord
+280
+1
+ 90
+65537
+ 0
+XRECORD
+ 5
+9C
+330
+86
+100
+AcDbXrecord
+280
+1
+ 90
+65537
+ 0
+XRECORD
+ 5
+9D
+330
+86
+100
+AcDbXrecord
+280
+1
+ 90
+65537
+ 0
+XRECORD
+ 5
+9E
+330
+86
+100
+AcDbXrecord
+280
+1
+ 90
+65537
+ 0
+XRECORD
+ 5
+9F
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A0
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A1
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A2
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A3
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A4
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A5
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A6
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+auto
+ 0
+XRECORD
+ 5
+A7
+330
+86
+100
+AcDbXrecord
+280
+1
+ 90
+1
+ 0
+XRECORD
+ 5
+A8
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+0.5
+ 0
+XRECORD
+ 5
+A9
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+0.5
+ 0
+XRECORD
+ 5
+AA
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+0.5
+ 0
+XRECORD
+ 5
+AB
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+0.5
+ 0
+XRECORD
+ 5
+AC
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+0
+ 0
+XRECORD
+ 5
+AD
+330
+86
+100
+AcDbXrecord
+280
+1
+ 90
+1
+ 0
+XRECORD
+ 5
+AE
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+-77.5
+ 0
+XRECORD
+ 5
+AF
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+-123.5
+ 0
+XRECORD
+ 5
+B0
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+Portrait
+ 0
+XRECORD
+ 5
+B1
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+297.0
+ 0
+XRECORD
+ 5
+B2
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+210.0
+ 0
+XRECORD
+ 5
+B3
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+1" = 1"
+ 0
+XRECORD
+ 5
+B4
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+1
+ 0
+XRECORD
+ 5
+B5
+330
+86
+100
+AcDbXrecord
+280
+1
+290
+0
+ 0
+XRECORD
+ 5
+B6
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+Inside
+ 0
+XRECORD
+ 5
+B7
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+Arial,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1
+ 0
+XRECORD
+ 5
+B8
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+TopLeft
+ 0
+XRECORD
+ 5
+B9
+330
+86
+100
+AcDbXrecord
+280
+1
+1000
+3.32.3.1
+ 0
+XRECORD
+ 5
+BA
+330
+86
+100
+AcDbXrecord
+280
+1
+ 90
+4
+ 0
+XRECORD
+ 5
+BC
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+7.4789098795554114
+ 0
+XRECORD
+ 5
+BD
+330
+86
+100
+AcDbXrecord
+280
+1
+ 40
+12.6762918478374207
+ 0
+ENDSEC
+ 0
+EOF
diff --git a/src/const.hpp b/src/const.hpp
index 8651d89..3fc2d7b 100644
--- a/src/const.hpp
+++ b/src/const.hpp
@@ -7,3 +7,8 @@ constexpr int WORLD_WIDTH = 20000;
constexpr int WORLD_HEIGHT = 200000;
constexpr int TARGET_FPS = 120;
constexpr Uint64 TARGET_FRAME_TIME_NS = 1'000'000'000 / TARGET_FPS;
+
+#define WIDTH_RATIO 15
+#define HEIGHT_RATIO 41.53846153846154
+#define MIN_INPUT_DELAY_MOVEMENT 0
+#define MIN_INPUT_DELAY_FIRE 200
diff --git a/src/game_logic.cpp b/src/game_logic.cpp
new file mode 100644
index 0000000..c77d891
--- /dev/null
+++ b/src/game_logic.cpp
@@ -0,0 +1,136 @@
+#include "const.hpp"
+#include "main.hpp"
+#include "projectiles.hpp"
+#include "types.hpp"
+#include
+#include
+
+// returns true on win and false on lose
+bool play_level() {
+ ship_type player_ship = []() -> ship_type {
+ SDL_Texture *player_ship_texture = nullptr;
+
+ SDL_IOStream *texture_file = SDL_IOFromFile("assets/player_ship.svg", "r");
+
+ float ship_width = static_cast(static_cast(mode->w) /
+ static_cast(WIDTH_RATIO));
+ float ship_height = static_cast(static_cast(mode->h) /
+ static_cast(HEIGHT_RATIO));
+
+ SDL_Surface *player_ship_surface =
+ IMG_LoadSizedSVG_IO(texture_file, ship_width, ship_height);
+ SDL_CloseIO(texture_file);
+
+ player_ship_texture = SDL_CreateTextureFromSurface(
+ main_sdl_session.renderer, player_ship_surface);
+ SDL_DestroySurface(player_ship_surface);
+
+ SDL_FRect player_ship_rect = {0, 0, ship_width, ship_height};
+
+ SDL_FPoint gun_offset = {ship_width * 0.9f, ship_height * 0.9f};
+
+ return {player_ship_rect, gun_offset, player_ship_texture};
+ }();
+ bool running = true;
+ Uint64 lastFrameTime = SDL_GetTicksNS();
+ float deltaTime = 0.0f;
+
+ Uint8 player_ship_speed = 1;
+ std::vector projectiles;
+ std::vector enemies;
+ while (running) {
+ const Uint64 frameStart = SDL_GetTicksNS();
+
+ SDL_Event event;
+ while (SDL_PollEvent(&event)) {
+ switch (event.type) {
+ case SDL_EVENT_QUIT:
+ running = false;
+ break;
+ default:
+ break;
+ }
+ }
+
+ {
+ const bool *keystate = SDL_GetKeyboardState(NULL);
+ static Uint32 last_toggle_direction[4];
+ std::memset(last_toggle_direction, 0, sizeof(last_toggle_direction));
+ if ((keystate[SDL_SCANCODE_DOWN] || keystate[SDL_SCANCODE_S]) &&
+ (SDL_GetTicks() - last_toggle_direction[0] >
+ MIN_INPUT_DELAY_MOVEMENT)) {
+ if (player_ship.rect.y + player_ship.rect.h < mode->h) {
+ player_ship.rect.y += player_ship_speed;
+ }
+ last_toggle_direction[0] = SDL_GetTicks();
+ }
+ if ((keystate[SDL_SCANCODE_UP] || keystate[SDL_SCANCODE_W]) &&
+ (SDL_GetTicks() - last_toggle_direction[1] >
+ MIN_INPUT_DELAY_MOVEMENT)) {
+ if (player_ship.rect.y > 0) {
+ player_ship.rect.y -= player_ship_speed;
+ }
+ last_toggle_direction[1] = SDL_GetTicks();
+ }
+ if ((keystate[SDL_SCANCODE_RIGHT] || keystate[SDL_SCANCODE_D]) &&
+ (SDL_GetTicks() - last_toggle_direction[2] >
+ MIN_INPUT_DELAY_MOVEMENT)) {
+ if (player_ship.rect.x + player_ship.rect.w < mode->w) {
+ player_ship.rect.x += player_ship_speed;
+ }
+ last_toggle_direction[2] = SDL_GetTicks();
+ }
+ if ((keystate[SDL_SCANCODE_LEFT] || keystate[SDL_SCANCODE_A]) &&
+ (SDL_GetTicks() - last_toggle_direction[3] >
+ MIN_INPUT_DELAY_MOVEMENT)) {
+ if (player_ship.rect.x > 0) {
+ player_ship.rect.x -= player_ship_speed;
+ }
+ last_toggle_direction[3] = SDL_GetTicks();
+ }
+
+ const SDL_MouseButtonFlags mousestate =
+ SDL_GetMouseState(nullptr, nullptr);
+ static Uint32 last_fire = 0;
+ if ((mousestate & SDL_BUTTON_LMASK || keystate[SDL_SCANCODE_SPACE]) &&
+ SDL_GetTicks() - last_fire > MIN_INPUT_DELAY_FIRE) {
+ projectiles.push_back(
+ spawn_projectile({player_ship.rect.x + player_ship.gun_offset.x,
+ player_ship.rect.y + player_ship.gun_offset.y},
+ 1, 0, 3, "assets/basic_projectile.svg", nullptr));
+ last_fire = SDL_GetTicks();
+ }
+ }
+
+ SDL_SetRenderDrawColor(main_sdl_session.renderer, 0, 0, 0, 255);
+ SDL_RenderClear(main_sdl_session.renderer);
+
+ for (projectile &p : projectiles) {
+ if (p.rect.x > mode->w || p.rect.y > mode->h) {
+ projectiles.erase(projectiles.begin() + (&p - projectiles.data()));
+ } else { // TODO colision detection
+ step_projectile(p);
+ }
+ }
+
+ SDL_RenderTexture(main_sdl_session.renderer, player_ship.texture, nullptr,
+ &player_ship.rect);
+
+ SDL_RenderPresent(main_sdl_session.renderer);
+
+ const Uint64 frameTime = SDL_GetTicksNS() - frameStart;
+ if (frameTime < TARGET_FRAME_TIME_NS) {
+ const Uint64 sleepTime = TARGET_FRAME_TIME_NS - frameTime;
+ if (sleepTime >= 2'000'000) {
+ SDL_DelayNS(sleepTime - 2'000'000);
+ }
+ while (SDL_GetTicksNS() - frameStart < TARGET_FRAME_TIME_NS) {
+ }
+ }
+
+ deltaTime = (SDL_GetTicksNS() - lastFrameTime) / 1e9f;
+ lastFrameTime = SDL_GetTicksNS();
+ }
+
+ SDL_DestroyTexture(player_ship.texture);
+}
\ No newline at end of file
diff --git a/src/game_logic.hpp b/src/game_logic.hpp
new file mode 100644
index 0000000..3219691
--- /dev/null
+++ b/src/game_logic.hpp
@@ -0,0 +1,2 @@
+#pragma once
+bool play_level();
\ No newline at end of file
diff --git a/src/main.cpp b/src/main.cpp
index be39dc1..f8690c3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,5 +1,4 @@
-#include "const.hpp"
-#include "projectiles.hpp"
+#include "game_logic.hpp"
#include "types.hpp"
#include
#include
@@ -12,23 +11,14 @@
#include
#include
#include
-#include
-#include
-#include
sdl_session main_sdl_session;
-SDL_DisplayMode *mode;
-
-#define WIDTH_RATIO 15
-#define HEIGHT_RATIO 41.53846153846154
-#define MIN_INPUT_DELAY_MOVEMENT 0
-#define MIN_INPUT_DELAY_FIRE 200
+const SDL_DisplayMode *mode;
int main(int argc, char *argv[]) {
SDL_Init(SDL_INIT_VIDEO);
- const SDL_DisplayMode *mode =
- SDL_GetCurrentDisplayMode(SDL_GetPrimaryDisplay());
+ mode = SDL_GetCurrentDisplayMode(SDL_GetPrimaryDisplay());
main_sdl_session.window =
SDL_CreateWindow("Vector Blow", mode->w, mode->h, SDL_WINDOW_FULLSCREEN);
@@ -36,123 +26,8 @@ int main(int argc, char *argv[]) {
main_sdl_session.renderer =
SDL_CreateRenderer(main_sdl_session.window, "gpu,vulcan");
- player_ship_type player_ship = [&mode]() -> player_ship_type {
- SDL_Texture *player_ship_texture = nullptr;
+ play_level();
- SDL_IOStream *texture_file = SDL_IOFromFile("assets/player_ship.svg", "r");
-
- float ship_width = static_cast(static_cast(mode->w) /
- static_cast(WIDTH_RATIO));
- float ship_height = static_cast(static_cast(mode->h) /
- static_cast(HEIGHT_RATIO));
-
- SDL_Surface *player_ship_surface =
- IMG_LoadSizedSVG_IO(texture_file, ship_width, ship_height);
- SDL_CloseIO(texture_file);
-
- player_ship_texture = SDL_CreateTextureFromSurface(
- main_sdl_session.renderer, player_ship_surface);
- SDL_DestroySurface(player_ship_surface);
-
- SDL_FRect player_ship_rect = {0, 0, ship_width, ship_height};
-
- SDL_FPoint gun_offset = {ship_width * 0.9f, ship_height * 0.9f};
-
- return {player_ship_rect, gun_offset, player_ship_texture};
- }();
- bool running = true;
- Uint64 lastFrameTime = SDL_GetTicksNS();
- float deltaTime = 0.0f;
-
- Uint8 player_ship_speed = 1;
- std::vector projectiles;
- while (running) {
- const Uint64 frameStart = SDL_GetTicksNS();
-
- SDL_Event event;
- while (SDL_PollEvent(&event)) {
- switch (event.type) {
- case SDL_EVENT_QUIT:
- running = false;
- break;
- default:
- break;
- }
- }
-
- {
- const bool *keystate = SDL_GetKeyboardState(NULL);
- static Uint32 last_toggle_direction[4];
- std::memset(last_toggle_direction, 0, sizeof(last_toggle_direction));
- if ((keystate[SDL_SCANCODE_DOWN] || keystate[SDL_SCANCODE_S]) &&
- (SDL_GetTicks() - last_toggle_direction[0] >
- MIN_INPUT_DELAY_MOVEMENT)) {
- player_ship.rect.y += player_ship_speed;
- last_toggle_direction[0] = SDL_GetTicks();
- }
- if ((keystate[SDL_SCANCODE_UP] || keystate[SDL_SCANCODE_W]) &&
- (SDL_GetTicks() - last_toggle_direction[1] >
- MIN_INPUT_DELAY_MOVEMENT)) {
- player_ship.rect.y -= player_ship_speed;
- last_toggle_direction[1] = SDL_GetTicks();
- }
- if ((keystate[SDL_SCANCODE_RIGHT] || keystate[SDL_SCANCODE_D]) &&
- (SDL_GetTicks() - last_toggle_direction[2] >
- MIN_INPUT_DELAY_MOVEMENT)) {
- player_ship.rect.x += player_ship_speed;
- last_toggle_direction[2] = SDL_GetTicks();
- }
- if ((keystate[SDL_SCANCODE_LEFT] || keystate[SDL_SCANCODE_A]) &&
- (SDL_GetTicks() - last_toggle_direction[3] >
- MIN_INPUT_DELAY_MOVEMENT)) {
- player_ship.rect.x -= player_ship_speed;
- last_toggle_direction[3] = SDL_GetTicks();
- }
-
- const SDL_MouseButtonFlags mousestate =
- SDL_GetMouseState(nullptr, nullptr);
- static Uint32 last_fire = 0;
- if ((mousestate & SDL_BUTTON_LMASK || keystate[SDL_SCANCODE_SPACE]) &&
- SDL_GetTicks() - last_fire > MIN_INPUT_DELAY_FIRE) {
- projectiles.push_back(
- spawn_projectile({player_ship.rect.x + player_ship.gun_offset.x,
- player_ship.rect.y + player_ship.gun_offset.y},
- 1, 0, 3, "assets/basic_projectile.svg", nullptr));
- last_fire = SDL_GetTicks();
- }
- }
-
- SDL_SetRenderDrawColor(main_sdl_session.renderer, 0, 0, 0, 255);
- SDL_RenderClear(main_sdl_session.renderer);
-
- for (projectile &p : projectiles) {
- if (p.rect.x > mode->w || p.rect.y > mode->h) {
- projectiles.erase(projectiles.begin() + (&p - projectiles.data()));
- } else { // TODO colision detection
- step_projectile(p);
- }
- }
-
- SDL_RenderTexture(main_sdl_session.renderer, player_ship.texture, nullptr,
- &player_ship.rect);
-
- SDL_RenderPresent(main_sdl_session.renderer);
-
- const Uint64 frameTime = SDL_GetTicksNS() - frameStart;
- if (frameTime < TARGET_FRAME_TIME_NS) {
- const Uint64 sleepTime = TARGET_FRAME_TIME_NS - frameTime;
- if (sleepTime >= 2'000'000) {
- SDL_DelayNS(sleepTime - 2'000'000);
- }
- while (SDL_GetTicksNS() - frameStart < TARGET_FRAME_TIME_NS) {
- }
- }
-
- deltaTime = (SDL_GetTicksNS() - lastFrameTime) / 1e9f;
- lastFrameTime = SDL_GetTicksNS();
- }
-
- SDL_DestroyTexture(player_ship.texture);
SDL_DestroyRenderer(main_sdl_session.renderer);
SDL_DestroyWindow(main_sdl_session.window);
SDL_Quit();
diff --git a/src/main.hpp b/src/main.hpp
index 4c65371..8b64ec1 100644
--- a/src/main.hpp
+++ b/src/main.hpp
@@ -1,3 +1,4 @@
#pragma once
#include "types.hpp"
-extern sdl_session main_sdl_session;
\ No newline at end of file
+extern sdl_session main_sdl_session;
+extern SDL_DisplayMode *mode;
\ No newline at end of file
diff --git a/src/meth.cpp b/src/meth.cpp
index 41bd937..0c08cf5 100644
--- a/src/meth.cpp
+++ b/src/meth.cpp
@@ -1,5 +1,3 @@
-#pragma once
-
#include "types.hpp"
#include
diff --git a/src/types.hpp b/src/types.hpp
index ffbb5ef..7489a3a 100644
--- a/src/types.hpp
+++ b/src/types.hpp
@@ -5,6 +5,14 @@
#include
#include
+enum enemy_ai_type {
+ RANDOM,
+ FLYER,
+ GUNNER,
+ ACE,
+ BOSS,
+};
+
struct Angle {
private:
float value{0};
@@ -105,12 +113,19 @@ struct sdl_session {
SDL_Renderer *renderer;
};
-struct player_ship_type {
+struct ship_type {
SDL_FRect rect;
SDL_FPoint gun_offset;
SDL_Texture *texture;
};
+struct enemy_type {
+ ship_type ship;
+ enemy_ai_type type;
+ Uint32 last_shot;
+ Uint32 reload_time;
+};
+
struct projectile {
SDL_FRect rect;
SDL_Texture *texture;