diff --git a/CMakeLists.txt b/CMakeLists.txt index a1a8fca..90cd411 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,7 @@ add_custom_command( set(SOURCES src/main.cpp + src/fast_trig.cpp src/extrakeyboard.cpp src/collections.cpp @@ -57,10 +58,12 @@ set(ASSETS_cg assets-cg/Sprites/Bullets/bullet_normal.png assets-cg/Sprites/Bullets/bullet_blue.png assets-cg/Sprites/Bullets/bullet_laser.png + assets-cg/Sprites/Bullets/bullet_enemy_blue.png assets-cg/Sprites/Players/mainship1.png assets-cg/Sprites/Players/Satellite_Lvl1.png + assets-cg/Sprites/Enemies/Lifebar.png assets-cg/Sprites/Enemies/mainship2.png assets-cg/Sprites/Enemies/Enemy_Blue_Lvl1.png assets-cg/Sprites/Enemies/Enemy_Red_Lvl1.png diff --git a/assets-cg/Levels/Level1.json b/assets-cg/Levels/Level1.json deleted file mode 100644 index 4465c14..0000000 --- a/assets-cg/Levels/Level1.json +++ /dev/null @@ -1,44 +0,0 @@ -{ "compressionlevel":-1, - "height":14, - "infinite":false, - "layers":[ - { - "data":[0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 759, 760, 759, 760, 759, 760, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 759, 760, 759, 760, 759, 760, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 0, 1310, 0, 1310, 0, 0, 0, 759, 760, 759, 760, 759, 760, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 791, 792, 791, 792, 791, 792, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 791, 792, 791, 792, 791, 792, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 0, 2003, 2003, 2003, 0, 0, 0, 791, 792, 791, 792, 791, 792, 834, 842, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 834, 842, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 834, 842, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 0, 810, 0, 0, 919, 77, 921, 601, 601, 877, 0, 919, 77, 921, 0, 601, 601, 0, 919, 77, 921, 0, 601, 601, 919, 77, 921, 919, 77, 921, 0, 810, 0, 0, 919, 77, 921, 601, 601, 877, 0, 919, 77, 921, 0, 601, 601, 0, 919, 77, 921, 0, 601, 601, 919, 77, 921, 919, 77, 921, 0, 810, 0, 0, 919, 77, 921, 601, 601, 877, 0, 919, 77, 921, 0, 601, 601, 0, 919, 77, 921, 0, 601, 601, 919, 77, 921, 919, 77, 921, 851, 0, 0, 0, 116, 533, 118, 601, 601, 907, 885, 116, 533, 118, 886, 601, 601, 885, 116, 533, 118, 0, 601, 601, 116, 533, 118, 116, 533, 118, 851, 0, 0, 0, 116, 533, 118, 601, 601, 907, 885, 116, 533, 118, 886, 601, 601, 885, 116, 533, 118, 0, 601, 601, 116, 533, 118, 116, 533, 118, 851, 0, 0, 0, 116, 533, 118, 601, 601, 907, 885, 116, 533, 118, 886, 601, 601, 885, 116, 533, 118, 0, 601, 601, 116, 533, 118, 116, 533, 118, 627, 628, 629, 630, 308, 213, 310, 601, 0, 629, 630, 308, 213, 310, 627, 628, 629, 630, 308, 213, 310, 0, 601, 0, 308, 213, 310, 308, 213, 310, 627, 628, 629, 630, 308, 213, 310, 601, 0, 629, 630, 308, 213, 310, 627, 628, 629, 630, 308, 213, 310, 0, 601, 0, 308, 213, 310, 308, 213, 310, 627, 628, 629, 630, 308, 213, 310, 601, 0, 629, 630, 308, 213, 310, 627, 628, 629, 630, 308, 213, 310, 0, 601, 0, 308, 213, 310, 308, 213, 310, 659, 660, 661, 662, 919, 77, 921, 601, 852, 661, 662, 919, 77, 921, 659, 660, 661, 662, 919, 77, 921, 0, 601, 0, 919, 77, 921, 919, 77, 921, 659, 660, 661, 662, 919, 77, 921, 601, 852, 661, 662, 919, 77, 921, 659, 660, 661, 662, 919, 77, 921, 0, 601, 0, 919, 77, 921, 919, 77, 921, 659, 660, 661, 662, 919, 77, 921, 601, 852, 661, 662, 919, 77, 921, 659, 660, 661, 662, 919, 77, 921, 0, 601, 0, 919, 77, 921, 919, 77, 921, 691, 692, 693, 694, 919, 77, 921, 691, 692, 819, 0, 919, 77, 921, 691, 692, 693, 694, 919, 77, 921, 0, 601, 0, 919, 77, 921, 919, 77, 921, 691, 692, 693, 694, 919, 77, 921, 691, 692, 819, 0, 919, 77, 921, 691, 692, 693, 694, 919, 77, 921, 0, 601, 0, 919, 77, 921, 919, 77, 921, 691, 692, 693, 694, 919, 77, 921, 691, 692, 819, 0, 919, 77, 921, 691, 692, 693, 694, 919, 77, 921, 0, 601, 0, 919, 77, 921, 919, 77, 921, 723, 724, 725, 726, 116, 533, 118, 723, 724, 0, 0, 1371, 0, 1370, 723, 724, 725, 726, 116, 533, 118, 0, 601, 0, 116, 533, 118, 116, 533, 118, 723, 724, 725, 726, 116, 533, 118, 723, 724, 0, 0, 1371, 0, 1370, 723, 724, 725, 726, 116, 533, 118, 0, 601, 0, 116, 533, 118, 116, 533, 118, 723, 724, 725, 726, 116, 533, 118, 723, 724, 0, 0, 1371, 0, 1370, 723, 724, 725, 726, 116, 533, 118, 0, 601, 0, 116, 533, 118, 116, 533, 118, 918, 0, 0, 917, 308, 213, 310, 918, 0, 0, 620, 621, 0, 618, 619, 0, 0, 917, 308, 213, 310, 0, 0, 0, 308, 213, 310, 308, 213, 310, 918, 0, 0, 917, 308, 213, 310, 918, 0, 0, 620, 621, 0, 618, 619, 0, 0, 917, 308, 213, 310, 0, 0, 0, 308, 213, 310, 308, 213, 310, 918, 0, 0, 917, 308, 213, 310, 918, 0, 0, 620, 621, 0, 618, 619, 0, 0, 917, 308, 213, 310, 0, 0, 0, 308, 213, 310, 308, 213, 310, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 652, 653, 695, 650, 651, 0, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 652, 653, 695, 650, 651, 0, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 0, 652, 653, 695, 650, 651, 0, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 811, 0, 0, 727, 0, 0, 810, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 811, 0, 0, 727, 0, 0, 810, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 0, 0, 0, 0, 919, 77, 921, 0, 0, 811, 0, 0, 727, 0, 0, 810, 0, 0, 919, 77, 921, 0, 0, 0, 919, 77, 921, 919, 77, 921, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, 542, 509, 510, 542, 543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, 542, 509, 510, 542, 543, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1497, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, 542, 509, 510, 542, 543, 0, 0, 0, 0, 524, 756, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 756, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 756, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 756, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 756, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 524, 756, 525, 0, 0, 0, 0, 0, 0, 0, 0, 0], - "height":14, - "id":2, - "name":"Background", - "opacity":1, - "type":"tilelayer", - "visible":true, - "width":90, - "x":0, - "y":0 - }, - { - "data":[866, 1986, 1991, 1971, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 1971, 1991, 1972, 0, 0, 0, 0, 0, 0, 866, 1986, 1991, 1971, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 1971, 1991, 1972, 0, 0, 0, 0, 0, 0, 866, 1986, 1991, 1971, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 1971, 741, 742, 1971, 976, 1011, 977, 1971, 1991, 1972, 0, 0, 0, 0, 0, 0, 898, 1986, 1991, 1974, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1973, 1991, 1972, 0, 0, 0, 0, 0, 0, 898, 1986, 1991, 1974, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1973, 1991, 1972, 0, 0, 0, 0, 0, 0, 898, 1986, 1991, 1974, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1973, 773, 774, 1974, 1498, 1497, 1499, 1973, 1991, 1972, 0, 0, 0, 0, 0, 0, 899, 2018, 2023, 2020, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 2002, 2023, 2004, 0, 0, 0, 0, 0, 0, 899, 2018, 2023, 2020, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 2002, 2023, 2004, 0, 0, 0, 0, 0, 0, 899, 2018, 2023, 2020, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 2002, 2003, 2003, 2020, 0, 0, 0, 2002, 2023, 2004, 0, 0, 0, 0, 0, 0, 612, 908, 874, 877, 0, 0, 0, 908, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 612, 908, 874, 877, 0, 0, 0, 908, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 612, 908, 874, 877, 0, 0, 0, 908, 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 644, 0, 908, 907, 0, 0, 0, 0, 908, 0, 877, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 644, 0, 908, 907, 0, 0, 0, 0, 908, 0, 877, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 644, 0, 908, 907, 0, 0, 0, 0, 908, 0, 877, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1398, 569, 855, 908, 907, 0, 0, 1398, 569, 855, 854, 569, 1398, 0, 265, 569, 569, 855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1398, 569, 855, 908, 907, 0, 0, 1398, 569, 855, 854, 569, 1398, 0, 265, 569, 569, 855, 0, 0, 0, 0, 0, 0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, 0, 0, 535, 207, 537, 810, 0, 0, 0, 0, 0, 1398, 569, 855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 535, 207, 537, 810, 0, 0, 0, 0, 0, 1398, 569, 855, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 852, 0, 0, 0, 0, 0, 842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 852, 0, 0, 0, 0, 0, 842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 852, 0, 0, 0, 0, 0, 842, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, 819, 0, 0, 0, 811, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, 819, 0, 0, 0, 811, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 265, 819, 0, 0, 0, 811, 265, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 6, 38, 39, 0, 0, 0, 0, 265, 0, 0, 0, 0, 37, 38, 6, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 6, 38, 39, 0, 0, 0, 0, 265, 0, 0, 0, 0, 37, 38, 6, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 38, 6, 38, 39, 0, 0, 0, 0, 265, 0, 0, 0, 0, 37, 38, 6, 38, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 535, 503, 408, 504, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 535, 503, 408, 504, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 535, 503, 408, 504, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 535, 503, 408, 504, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 535, 503, 408, 504, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 535, 503, 408, 504, 537, 0, 0, 0, 0, 0, 0, 0, 0], - "height":14, - "id":1, - "name":"Foreground", - "opacity":1, - "type":"tilelayer", - "visible":true, - "width":90, - "x":0, - "y":0 - }], - "nextlayerid":3, - "nextobjectid":1, - "orientation":"orthogonal", - "renderorder":"right-down", - "tiledversion":"1.8.0", - "tileheight":16, - "tilesets":[ - { - "firstgid":1, - "source":"Tileset_Space.tsx" - }], - "tilewidth":16, - "type":"map", - "version":"1.8", - "width":90 -} \ No newline at end of file diff --git a/assets-cg/Levels/Level2.json b/assets-cg/Levels/Level2.json deleted file mode 100644 index 97ab2ae..0000000 --- a/assets-cg/Levels/Level2.json +++ /dev/null @@ -1,44 +0,0 @@ -{ "compressionlevel":-1, - "height":30, - "infinite":false, - "layers":[ - { - "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 884, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 917, 883, 915, 918, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 915, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 885, 884, 883, 886, 0, 0, 0, 0, 915, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 915, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 915, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 915, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 884, 918, 917, 883, 886, 0, 0, 885, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 918, 0, 0, 917, 883, 886, 885, 884, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - "height":30, - "id":2, - "name":"Background", - "opacity":1, - "type":"tilelayer", - "visible":true, - "width":96, - "x":0, - "y":0 - }, - { - "data":[1954, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1956, 741, 742, 741, 742, 1954, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1956, 741, 742, 741, 742, 1954, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1956, 741, 742, 741, 742, 1954, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1956, 741, 742, 741, 742, 1986, 1987, 1990, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 1989, 1987, 1988, 773, 774, 773, 774, 1986, 1987, 1990, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 1989, 1987, 1988, 773, 774, 773, 774, 1986, 1987, 1990, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 1989, 1987, 1988, 773, 774, 773, 774, 1986, 1987, 1990, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 1989, 1987, 1988, 773, 774, 773, 774, 2018, 2019, 2020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2018, 2019, 2020, 1925, 1926, 1926, 1927, 2018, 2019, 2020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2018, 2019, 2020, 1925, 1926, 1926, 1927, 2018, 2019, 2020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 627, 628, 629, 630, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 659, 660, 661, 662, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 691, 692, 693, 694, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 723, 724, 725, 726, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 1955, 1956, 1925, 1926, 1926, 1927, 1954, 1955, 1956, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1954, 1955, 1956, 1925, 1926, 1926, 1927, 1954, 1955, 1956, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1954, 1955, 1956, 1925, 1926, 1926, 1927, 1986, 1987, 1958, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1957, 1987, 1988, 741, 742, 741, 742, 1986, 1987, 1958, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1957, 1987, 1988, 741, 742, 741, 742, 1986, 1987, 1958, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1957, 1987, 1988, 741, 742, 741, 742, 1986, 1987, 1958, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1957, 1987, 1988, 741, 742, 741, 742, 2018, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2020, 773, 774, 773, 774, 2018, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2020, 773, 774, 773, 774, 2018, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2020, 773, 774, 773, 774, 2018, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2019, 2020, 773, 774, 773, 774], - "height":30, - "id":1, - "name":"Foreground", - "opacity":1, - "type":"tilelayer", - "visible":true, - "width":96, - "x":0, - "y":0 - }], - "nextlayerid":4, - "nextobjectid":1, - "orientation":"orthogonal", - "renderorder":"right-down", - "tiledversion":"1.8.0", - "tileheight":16, - "tilesets":[ - { - "firstgid":1, - "source":"Tileset_Space.tsx" - }], - "tilewidth":16, - "type":"map", - "version":"1.8", - "width":96 -} \ No newline at end of file diff --git a/assets-cg/Levels/Tileset_Space.json b/assets-cg/Levels/Tileset_Space.json deleted file mode 100644 index fd37d86..0000000 --- a/assets-cg/Levels/Tileset_Space.json +++ /dev/null @@ -1,14 +0,0 @@ -{ "columns":32, - "image":"tileset.png", - "imageheight":1024, - "imagewidth":512, - "margin":0, - "name":"Tileset_Space", - "spacing":0, - "tilecount":2048, - "tiledversion":"1.8.0", - "tileheight":16, - "tilewidth":16, - "type":"tileset", - "version":"1.8" -} \ No newline at end of file diff --git a/assets-cg/Sprites/Bullets/bullet_enemy_blue.png b/assets-cg/Sprites/Bullets/bullet_enemy_blue.png new file mode 100644 index 0000000..33456cb Binary files /dev/null and b/assets-cg/Sprites/Bullets/bullet_enemy_blue.png differ diff --git a/assets-cg/Sprites/Enemies/Lifebar.png b/assets-cg/Sprites/Enemies/Lifebar.png new file mode 100644 index 0000000..1bb6f18 Binary files /dev/null and b/assets-cg/Sprites/Enemies/Lifebar.png differ diff --git a/assets-cg/__pycache__/converters.cpython-310.pyc b/assets-cg/__pycache__/converters.cpython-310.pyc deleted file mode 100644 index a0c803e..0000000 Binary files a/assets-cg/__pycache__/converters.cpython-310.pyc and /dev/null differ diff --git a/fxlink-image-2023.02.04-22h05-5.png b/fxlink-image-2023.02.04-22h05-5.png new file mode 100644 index 0000000..6f7622b Binary files /dev/null and b/fxlink-image-2023.02.04-22h05-5.png differ diff --git a/fxlink-image-2023.02.04-22h06-1.png b/fxlink-image-2023.02.04-22h06-1.png new file mode 100644 index 0000000..cb3339e Binary files /dev/null and b/fxlink-image-2023.02.04-22h06-1.png differ diff --git a/src/bullet.cpp b/src/bullet.cpp index 83e9c65..08516a9 100644 --- a/src/bullet.cpp +++ b/src/bullet.cpp @@ -12,32 +12,36 @@ extern bopti_image_t img_bullet_normal; extern bopti_image_t img_bullet_blue; extern bopti_image_t img_bullet_laser; +extern bopti_image_t img_bullet_enemy_blue; -Bullet::Bullet( uint16_t lx, uint16_t ly, uint8_t id ) + + +Bullet::Bullet( uint16_t lx, uint16_t ly, int16_t dx, int16_t dy, uint8_t id ) { x = libnum::num( lx ); y = libnum::num( ly ); + sx = libnum::num( dx ); + sy = libnum::num( dy ); + ID=id; - if (ID==0) + if (ID==BULLET_NORMAL) { - sx = libnum::num( 6 ); - sy = 0; strength = 5; } - else if (ID==1) + else if (ID==BULLET_BLUE) { - sx = libnum::num( 3 ); - sy = 0; strength = 2; } - else if (ID==2) + else if (ID==BULLET_LASER) { - sx = libnum::num( 3 ); - sy = 0; strength = 1; } + else if (ID==BULLET_ENEMY_BLUE) + { + strength = 2; + } toberemoved = false; } @@ -58,23 +62,28 @@ void Bullet::Update( float dt ) void Bullet::Render( ) { - uint16_t px = (int) x; - uint16_t py = (int) y; + int16_t px = (int) x; + int16_t py = (int) y; - if (ID==0) + if (ID==BULLET_NORMAL) { azrp_image_p8( px-img_bullet_normal.width/2, py-img_bullet_normal.height/2, &img_bullet_normal, DIMAGE_NONE ); return; } - else if (ID==1) + else if (ID==BULLET_BLUE) { azrp_image_p8( px-img_bullet_blue.width/2, py-img_bullet_blue.height/2, &img_bullet_blue, DIMAGE_NONE ); return; } - else if (ID==2) + else if (ID==BULLET_LASER) { azrp_image_p8( px-img_bullet_laser.width/2, py-img_bullet_laser.height/2, &img_bullet_laser, DIMAGE_NONE ); return; } + else if (ID==BULLET_ENEMY_BLUE) + { + azrp_image_p8( px-img_bullet_enemy_blue.width/2, py-img_bullet_enemy_blue.height/2, &img_bullet_enemy_blue, DIMAGE_NONE ); + return; + } } diff --git a/src/bullet.h b/src/bullet.h index 5b7765d..a3bc480 100644 --- a/src/bullet.h +++ b/src/bullet.h @@ -4,10 +4,20 @@ #include #include + +enum +{ + BULLET_NORMAL, + BULLET_BLUE, + BULLET_LASER, + BULLET_ENEMY_BLUE, +}; + + class Bullet { public: - Bullet( uint16_t lx, uint16_t ly, uint8_t id ); + Bullet( uint16_t lx, uint16_t ly, int16_t dx, int16_t dy, uint8_t id ); ~Bullet(); void Update( float dt ); void Render(); diff --git a/src/collections.cpp b/src/collections.cpp index 92a3bb9..e808f51 100644 --- a/src/collections.cpp +++ b/src/collections.cpp @@ -5,9 +5,13 @@ extern std::vector MyParticles; + extern std::vector MyPlayerBullets; +extern std::vector MyEnemiesBullets; + extern std::vector MyEnemies; extern std::vector MyImpacts; + extern Player *MyPlayer; @@ -15,33 +19,34 @@ extern Player *MyPlayer; void Create_Player_Shoot( uint8_t id ) { - if (id==0) + if (id==BULLET_NORMAL) { - Bullet *b = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, id ); + Bullet *b = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, 6, 0, id ); MyPlayerBullets.push_back( b ); } - else if (id==1) + else if (id==BULLET_BLUE) { - Bullet *b1 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, id ); + Bullet *b1 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, 5, 0, id ); MyPlayerBullets.push_back( b1 ); - Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, id ); + Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, 5, 0, id ); MyPlayerBullets.push_back( b2 ); } - else if (id==2) + else if (id==BULLET_LASER) { - Bullet *b1 = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, id ); + Bullet *b1 = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, 3, 0, id ); MyPlayerBullets.push_back( b1 ); - Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, id ); + Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, 3, 0, id ); MyPlayerBullets.push_back( b2 ); - Bullet *b3 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, id ); + Bullet *b3 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, 3, 0, id ); MyPlayerBullets.push_back( b3 ); } } -void Create_Ennemies( void ) + +void Create_Enemies( void ) { Enemy* e1 = new Enemy( 348, 112, 0); e1->Set_Speed_Vector( 1, 1, -6 ); @@ -129,6 +134,21 @@ void Clean_Everything( void ) MyPlayerBullets.erase( MyPlayerBullets.begin() + i ); } MyPlayerBullets.clear(); + + for(unsigned int i=0; i +#include - +extern bopti_image_t img_Lifebar; extern bopti_image_t img_mainship2; extern bopti_image_t img_Enemy_Blue_Lvl1; extern bopti_image_t img_Enemy_Red_Lvl1; + +extern std::vector MyEnemiesBullets; + + + Enemy::Enemy( int16_t _x, int16_t _y, uint8_t _id ) { x = libnum::num( _x ); @@ -22,18 +28,21 @@ Enemy::Enemy( int16_t _x, int16_t _y, uint8_t _id ) width = img_mainship2.width/2; height = img_mainship2.height/2; speed = 1; + life = 400; } else if (ID==1) { width = img_Enemy_Blue_Lvl1.width/2; height = img_Enemy_Blue_Lvl1.height/2; speed = 2; + life = 200; } else if (ID==2) { width = img_Enemy_Red_Lvl1.width/2; height = img_Enemy_Red_Lvl1.height/2; speed = 2; + life = 100; } xmin = (int) x - width; @@ -43,9 +52,7 @@ Enemy::Enemy( int16_t _x, int16_t _y, uint8_t _id ) toberemoved = false; - if (ID==0) life = 400; - else if (ID==1) life = 200; - else if (ID==2) life = 100; + lastshottime = 0; } Enemy::~Enemy() @@ -75,14 +82,62 @@ void Enemy::Update( float dt ) ymin = (int) y - height; ymax = (int) y + height; + + uint32_t tempshoot = rtc_ticks(); + + if (Shoot_OK( tempshoot )) + { + if ( ID==0 ) + { + Bullet *b = new Bullet( xmin, (int) y, -3, 0, BULLET_ENEMY_BLUE ); + MyEnemiesBullets.push_back( b ); + } + else if ( ID==1 ) + { + Bullet *b1 = new Bullet( xmin, (int) y, -5, 0, BULLET_ENEMY_BLUE ); + MyEnemiesBullets.push_back( b1 ); + + Bullet *b2 = new Bullet( xmin, (int) y, -5, 0, BULLET_ENEMY_BLUE ); + MyEnemiesBullets.push_back( b2 ); + } + else if ( ID==2 ) + { + Bullet *b = new Bullet( xmin, (int) y, -1, 0, BULLET_ENEMY_BLUE ); + MyEnemiesBullets.push_back( b ); + } + + } + + if (life<=0) toberemoved=true; } void Enemy::Render( void ) { - if (ID==0) azrp_image_p8_effect(xmin, ymin, &img_mainship2, DIMAGE_NONE); - if (ID==1) azrp_image_p8_effect(xmin, ymin, &img_Enemy_Blue_Lvl1, DIMAGE_NONE); - if (ID==2) azrp_image_p8_effect(xmin, ymin, &img_Enemy_Red_Lvl1, DIMAGE_NONE); + azrp_subimage_p8_effect( (int) x - img_Lifebar.width/2, ymin - 10, &img_Lifebar, 0, 0, img_Lifebar.width, 7, DIMAGE_NONE ); + + int life0=100; + + if (ID==0) + { + azrp_image_p8_effect(xmin, ymin, &img_mainship2, DIMAGE_NONE); + life0 = 400; + } + else if (ID==1) + { + azrp_image_p8_effect(xmin, ymin, &img_Enemy_Blue_Lvl1, DIMAGE_NONE); + life0 = 200; + } + else if (ID==2) + { + azrp_image_p8_effect(xmin, ymin, &img_Enemy_Red_Lvl1, DIMAGE_NONE); + life0 = 100; + } + + if (life>life0*2/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 7, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE ); + else if (life>life0/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 12, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE ); + else azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 17, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE ); + } @@ -102,4 +157,15 @@ void Enemy::Set_Speed_Vector( uint8_t _sp, uint8_t _xd, uint8_t _yd) speed = _sp; dirx = _xd; diry = _yd; +} + +bool Enemy::Shoot_OK( uint32_t tempshoot ) +{ + if(tempshoot-lastshottime>15) + { + lastshottime=tempshoot; + return true; + } + else return false; + } \ No newline at end of file diff --git a/src/enemy.h b/src/enemy.h index cbe9924..ced5fb9 100644 --- a/src/enemy.h +++ b/src/enemy.h @@ -37,6 +37,10 @@ class Enemy private: int8_t dirx, diry; // vector of the current direction of the ennemy (TODO : to implement more complex displacement pattern) + + uint32_t lastshottime; + + bool Shoot_OK( uint32_t tempshoot ); }; diff --git a/src/fast_trig.cpp b/src/fast_trig.cpp new file mode 100644 index 0000000..71379f9 --- /dev/null +++ b/src/fast_trig.cpp @@ -0,0 +1,61 @@ +#include "fast_trig.h" +#include "num/num.h" + + +static libnum::num cosTable[360]; +static libnum::num sinTable[360]; + + +void Fast_Trig_Init( void ) +{ + for(int u=0; u<360; u++) + { + cosTable[u] = libnum::num( cos( u * PI / 180 ) ); + sinTable[u] = libnum::num( sin( u * PI / 180 ) ); + } +} + + +libnum::num FastCos( int16_t angle ) +{ + if (angle>=0 and angle<360) return cosTable[ angle ]; + else + { + int16_t input = angle; + if (input<0) + { + while (input<0) input+=360; + return cosTable[ angle ]; + } + else + { + while (input>=360) input-=360; + return cosTable[ angle ]; + } + } +} + +libnum::num FastSin( int16_t angle ) +{ + if (angle>=0 and angle<360) return sinTable[ angle ]; + else + { + int16_t input = angle; + if (input<0) + { + while (input<0) input+=360; + return sinTable[ angle ]; + } + else + { + while (input>=360) input-=360; + return sinTable[ angle ]; + } + } +} + +libnum::num FastTan( int16_t angle ) +{ + //TODO : work on representation of infinite number for angle = 90 degrees or angle = 270 degrees + return libnum::num(0); +} \ No newline at end of file diff --git a/src/fast_trig.h b/src/fast_trig.h new file mode 100644 index 0000000..9bb2172 --- /dev/null +++ b/src/fast_trig.h @@ -0,0 +1,19 @@ +#ifndef FAST_TRIG_H +#define FAST_TRIG_H + + +#include +#include + + +#define PI 3.141592 + + +void Fast_Trig_Init( void ); + +libnum::num FastCos( int16_t angle ); +libnum::num FastSin( int16_t angle ); +libnum::num FastTan( int16_t angle ); + + +#endif diff --git a/src/main.cpp b/src/main.cpp index 1022d2f..f33b343 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -#define DEBUG_MODE 0 +#define DEBUG_MODE 1 #include #include @@ -20,6 +20,7 @@ #include +#include "fast_trig.h" #include "extrakeyboard.h" #include "collections.h" @@ -72,6 +73,7 @@ kmalloc_gint_stats_t *extram_stats; std::vector MyParticles; std::vector MyPlayerBullets; +std::vector MyEnemiesBullets; std::vector MyEnemies; std::vector MyImpacts; @@ -138,6 +140,9 @@ static void update( float dt ) { MyEnemies[i]->Update( dt ); + // Check if there is a collision with the current enemy + //MyPlayer->Test_Collision( MyEnemies[i] ); + // Check if the property toberemoved has been set to "true" for particle deletion if (MyEnemies[i]->toberemoved == true) { @@ -181,6 +186,26 @@ static void update( float dt ) } } + for(unsigned int i=0; iUpdate( dt ); + + if(MyPlayer->Test_Impact(MyEnemiesBullets[i])==true) + { + //TODO : we can create a list of impacts here, to be rendered later on + Create_Impact( (int) MyEnemiesBullets[i]->x, (int) MyEnemiesBullets[i]->y ); + } + + + // Check if the property toberemoved has been set to "true" for particle deletion + if (MyEnemiesBullets[i]->toberemoved == true) + { + delete( MyEnemiesBullets[i] ); + MyEnemiesBullets.erase( MyEnemiesBullets.begin() + i ); + } + } + + MyBackground.Update( dt ); } @@ -199,6 +224,9 @@ static void render( void ) for(auto& b : MyPlayerBullets) b->Render(); + for(auto& b : MyEnemiesBullets) + b->Render(); + for(auto& e : MyEnemies) e->Render(); @@ -235,17 +263,17 @@ static void get_inputs( float dt ) if(MyKeyboard.IsKeyPressed(MYKEY_F1)) { - if (MyPlayer->Shoot_OK(tempshoot, 0)) Create_Player_Shoot(0); + if (MyPlayer->Shoot_OK(tempshoot, BULLET_NORMAL)) Create_Player_Shoot(0); } if(MyKeyboard.IsKeyPressed(MYKEY_F2)) { - if (MyPlayer->Shoot_OK(tempshoot, 1)) Create_Player_Shoot(1); + if (MyPlayer->Shoot_OK(tempshoot, BULLET_BLUE)) Create_Player_Shoot(1); } if(MyKeyboard.IsKeyPressedEvent(MYKEY_F3)) { - if (MyPlayer->Shoot_OK(tempshoot, 2)) Create_Player_Shoot(2); + if (MyPlayer->Shoot_OK(tempshoot, BULLET_LASER)) Create_Player_Shoot(2); } if (MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyHoldPressed(MYKEY_EXIT)) {exitToOS = true; }; @@ -286,7 +314,7 @@ bool AddMoreRAM( void ) extended_ram.name = "extram"; extended_ram.is_default = true; extended_ram.start = (void *)0x8c200000; - extended_ram.end = (void *)0x8c500000 ; + extended_ram.end = (void *)0x8c4e0000 ; kmalloc_init_arena(&extended_ram, true); kmalloc_add_arena(&extended_ram ); @@ -316,7 +344,7 @@ bool AddMoreRAM( void ) extended_ram.name = "extram"; extended_ram.is_default = true; extended_ram.start = (void *)0x88200000; - extended_ram.end = (void *)0x88500000 ; + extended_ram.end = (void *)0x884e0000 ; kmalloc_init_arena(&extended_ram, true); kmalloc_add_arena(&extended_ram ); @@ -329,15 +357,35 @@ void FreeMoreRAM( void ) memset(extended_ram.start, 0, (char *)extended_ram.end - (char *)extended_ram.start); } +/* +#define DBGCRSH 1 +#include +int a=0; +void debug_crash( int value ) +{ + dprint( 1, 1+a*10, C_BLACK, "point = %d : REACHED", value ); + a++; + dupdate(); + getkey(); +} -extern bopti_image_t img_Enemy_Red_Lvl1; - +void debug_crash_msg( char *chain ) +{ + dprint( 1, 1+a*10, C_BLACK, "point = %s : REACHED", chain ); + a++; + dupdate(); + getkey(); +} +*/ int main(void) { exitToOS = false; + Fast_Trig_Init(); + + _uram = kmalloc_get_arena("_uram"); bool canWeAllocate3Mb = AddMoreRAM(); @@ -354,11 +402,15 @@ int main(void) azrp_starfield_init( 250 ); - Create_Ennemies( ); - + Create_Enemies( ); MyPlayer = new Player( azrp_width/4, azrp_height/2, 0); +/* + #if(DBGCRSH) + debug_crash( 1 ); + #endif +*/ usb_interface_t const *interfaces[] = { &usb_ff_bulk, NULL }; usb_open(interfaces, GINT_CALL_NULL); @@ -398,6 +450,7 @@ int main(void) render(); azrp_update(); + } prof_leave(perf_render); diff --git a/src/player.cpp b/src/player.cpp index 6334d2b..db3eda2 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -3,17 +3,16 @@ #include "enemy.h" #include #include -#include +#include "fast_trig.h" #include "background.h" + +extern bopti_image_t img_Lifebar; extern bopti_image_t img_mainship1; extern bopti_image_t img_Satellite_Lvl1; extern Background MyBackground; -static int16_t cosTable[360], sinTable[360]; -#define PI 3.141592 - Player::Player( int16_t _x, int16_t _y, uint8_t _id ) { x = libnum::num(_x); @@ -42,12 +41,6 @@ Player::Player( int16_t _x, int16_t _y, uint8_t _id ) satAngle = 0; satRadius = 50; satSpeed = 2; - - for(int u=0; u<360; u++) - { - cosTable[u] = (int16_t) (satRadius*cos( u * PI / 180 )); - sinTable[u] = (int16_t) (satRadius*sin( u * PI / 180 )); - } } Player::~Player() @@ -72,6 +65,8 @@ void Player::Update( float dt ) void Player::Render( void ) { + azrp_subimage_p8_effect( (int) x - img_Lifebar.width/2, ymin - 10, &img_Lifebar, 0, 0, img_Lifebar.width, 7, DIMAGE_NONE ); + if (ID==0) azrp_image_p8_effect(xmin, ymin, &img_mainship1, DIMAGE_NONE); int w = img_Satellite_Lvl1.width/2; @@ -85,11 +80,18 @@ void Player::Render( void ) { int angle = (int) satAngle + u*incangle; angle = angle % 360; - int xsat = (int) x + cosTable[angle]; - int ysat = (int) y + sinTable[angle]; + int xsat = (int) (x + FastCos( angle ) * libnum::num( satRadius) ); + int ysat = (int) (y + FastSin( angle ) * libnum::num( satRadius) ); azrp_image_p8_effect(xsat-w, ysat-h, &img_Satellite_Lvl1, DIMAGE_NONE); } } + + int16_t life0=1000; + + if (life>life0*2/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 7, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE ); + else if (life>life0/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 12, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE ); + else azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 17, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE ); + } @@ -104,7 +106,7 @@ bool Player::Test_Impact( Bullet *projectile ) else return false; } -bool Player::Test_Impact( Enemy *adverseship ) +bool Player::Test_Collision( Enemy *adverseship ) { if (adverseship->xmax >= xmin && adverseship->xmin <= xmax && adverseship->ymax >= ymin && adverseship->ymin <= ymax ) { @@ -122,7 +124,7 @@ void Player::Set_Speed( uint8_t _sp ) bool Player::Shoot_OK( uint32_t tempshoot, uint8_t shootID ) { - if (shootID==0) + if (shootID==BULLET_NORMAL) { if(tempshoot-lastshoot0>8) { @@ -131,7 +133,7 @@ bool Player::Shoot_OK( uint32_t tempshoot, uint8_t shootID ) } else return false; } - else if (shootID==1) + else if (shootID==BULLET_BLUE) { if(tempshoot-lastshoot1>15) { @@ -140,7 +142,7 @@ bool Player::Shoot_OK( uint32_t tempshoot, uint8_t shootID ) } else return false; } - else if (shootID==2) + else if (shootID==BULLET_LASER) { if(tempshoot-lastshoot2>2) { diff --git a/src/player.h b/src/player.h index 4a67e49..2681a03 100644 --- a/src/player.h +++ b/src/player.h @@ -22,7 +22,7 @@ class Player void Render( void ); bool Test_Impact( Bullet *projectile ); - bool Test_Impact( Enemy *adverseship ); + bool Test_Collision( Enemy *adverseship ); void Set_Speed( uint8_t _sp ); bool Shoot_OK( uint32_t tempshoot, uint8_t shootID ); diff --git a/src/starfieldshader.cpp b/src/starfieldshader.cpp index 5b41351..6000a1f 100644 --- a/src/starfieldshader.cpp +++ b/src/starfieldshader.cpp @@ -279,7 +279,7 @@ void azrp_starfield( void ) cmd.nbpixel = pixels.size(); cmd.data = pixels.data(); - for(int i=0; ix = (pixels[i]->x - pixels[i]->s) % 396; pixels[i]->frag = pixels[i]->y / 16;