diff --git a/conversion.txt b/conversion.txt new file mode 100644 index 0000000..092fa42 --- /dev/null +++ b/conversion.txt @@ -0,0 +1,2 @@ +EMPTY, BLOCK, DESTRUCTIBLE, HOLE, DESTROYED +48, 32, 17, 2 \ No newline at end of file diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..6e3e2a7 Binary files /dev/null and b/screenshot.png differ diff --git a/src/collision.c b/src/collision.c index 93ab10f..77db78d 100644 --- a/src/collision.c +++ b/src/collision.c @@ -13,38 +13,22 @@ #include "collision.h" #include "level.h" -AABB getShellAABB(Shell* shell) { - AABB result; - result.x1 = shell->pos_x; - result.y1 = shell->pos_y; - result.x2 = result.x1 + SHELL_SIZE; - result.y2 = result.y1 + SHELL_SIZE; - return result; -} +#include -AABB getMineAABB(Mine* mine) { +AABB getAABB(PhysicsBody* phys) { AABB result; - result.x1 = mine->pos_x; - result.y1 = mine->pos_y; - result.x2 = result.x1 + MINE_SIZE; - result.y2 = result.y1 + MINE_SIZE; - return result; -} - -AABB getTankAABB(Tank* tank) { - AABB result; - result.x1 = tank->pos_x; - result.y1 = tank->pos_y; - result.x2 = tank->pos_x + TANK_SIZE; - result.y2 = tank->pos_y + TANK_SIZE; + result.x1 = phys->position_x >> SHIFT_AMOUNT; + result.y1 = phys->position_y >> SHIFT_AMOUNT; + result.x2 = (phys->position_x >> SHIFT_AMOUNT) + phys->width; + result.y2 = (phys->position_y >> SHIFT_AMOUNT) + phys->height; return result; } AABB getDetectionAABB(Mine* mine) { AABB result; - uint24_t center_x = mine->pos_x + MINE_SIZE / 2; - uint24_t center_y = mine->pos_y + MINE_SIZE / 2; + uint24_t center_x = (mine->phys.position_x >> SHIFT_AMOUNT) + MINE_SIZE / 2; + uint24_t center_y = (mine->phys.position_y >> SHIFT_AMOUNT) + MINE_SIZE / 2; result.x1 = center_x - MINE_DETECT_RANGE; result.y1 = center_y - MINE_DETECT_RANGE; @@ -63,6 +47,14 @@ AABB getBlockAABB(uint8_t x, uint8_t y) { return result; } +uint24_t center_x(AABB bb) { + return (bb.x1 + bb.x2) / 2; +} + +uint8_t center_y(AABB bb) { + return (bb.y1 + bb.y2) / 2; +} + bool detectCollision(AABB bb1, AABB bb2) { return bb1.x1 < bb2.x2 && @@ -76,3 +68,50 @@ struct reflection getReflection(AABB bb1, AABB bb2) { struct reflection value = {0}; return value; } + +bool center_distance(AABB bb1, AABB bb2) { + int24_t delta_x = center_x(bb1) - center_x(bb2); + int24_t delta_y = center_y(bb1) - center_y(bb2); + return sqrt(delta_x * delta_x + delta_y * delta_y); +} + +struct reflection getTileReflect(PhysicsBody* state1, PhysicsBody* state2, bool respectHoles, uint8_t* tiles) { + struct reflection result = {false}; + uint8_t initial_corners[] = {0,0,0,0}; + uint8_t final_corners[] = {0,0,0,0}; + AABB bb1 = getAABB(state1); + AABB bb2 = getAABB(state2); + + int x, y; + + //Loop through the 4 corners + for(x = 0; x < 2; x++) { + for(y = 0; y < 2; y++) { + uint24_t final_corner_x = (&bb2.x1)[x]; //I'm pretty sure this is poor practice. + uint8_t final_corner_y = (&bb2.y1)[y]; + //The ID of the tile that the corner is occupying + uint8_t final_tile = tiles[pixelToXTile(final_corner_x) + LEVEL_SIZE_X * pixelToYTile(final_corner_y)]; + //Check if we need to collide here + if(final_tile == BLOCK || final_tile == DESTRUCTIBLE || (respectHoles && final_tile == HOLE)) { + //We have collided + result.colliding = true; + //Determine direction by seeing which axis has changed tiles + //This means if it hits a corner it will always prefer to reflect on the X axis + //(don't tell anyone though) + if(pixelToXTile(final_corner_x) > pixelToXTile((&bb1.x1)[x])) { + result.dir = RIGHT; + } else if(pixelToXTile(final_corner_x) < pixelToXTile((&bb1.x1)[x])) { + result.dir = LEFT; + } else if(pixelToYTile(final_corner_y) > pixelToYTile((&bb1.y1)[y])) { + result.dir = DOWN; + } else if(pixelToYTile(final_corner_y) < pixelToYTile((&bb1.y1)[y])) { + result.dir = UP; + } else { + //This should be unreachable. + result.dir = 0; + } + } + } + } + return result; +} diff --git a/src/collision.h b/src/collision.h index 2385c2b..f1bcb10 100644 --- a/src/collision.h +++ b/src/collision.h @@ -11,13 +11,23 @@ #include #include +#include "constants.h" + typedef enum { - UP, - DOWN, - LEFT, - RIGHT + UP = 1, + DOWN = 2, + LEFT = 4, + RIGHT = 8 } Direction; +enum { + TankPhysics, + ShellPhysics, + MinePhysics +}; + +typedef uint8_t PhysicsType; + struct reflection { bool colliding; uint8_t distance; @@ -26,23 +36,39 @@ struct reflection { typedef struct { //Axis-aligned bounding box - uint16_t x1; - uint16_t x2; + uint24_t x1; + uint24_t x2; uint8_t y1; uint8_t y2; } AABB; -AABB getTankAABB(Tank* tank); //Get the AABB of a tank -AABB getShellAABB(Shell* shell); //Get the AABB of a shell -AABB getMineAABB(Mine* mine); //Get the AABB of a mine -AABB getDetectionAABB(Mine* mine); //Get the AABB that a mine uses to detect enemy tanks. A seperate circular deterction radius will be used if the AABB detects a tank. +typedef struct { + PhysicsType type; + uint8_t rotation; + uint16_t position_x; //this is ufix, but gives compiler errors for some reason + uint16_t position_y; + float velocity_x; + float velocity_y; + uint8_t width; + uint8_t height; + uint32_t updateTime; +} PhysicsBody; + +AABB getAABB(PhysicsBody* phys); AABB getBlockAABB(uint8_t x, uint8_t y); //Get the AABB of a tile +uint24_t center_x(AABB bb); //Get the center coords of a AABB +uint8_t center_y(AABB bb); + //Determine if two bounding boxes are intersecting bool detectCollision(AABB bb1, AABB bb2); -//Distance "into" one BB the other is. +//Determine if a collision occurs with the tilemap +struct reflection getTileReflect(PhysicsBody* state1, PhysicsBody* state2, bool respectHoles, uint8_t* tiles); + //This shouldn't need to handle cases where one bounding box is fully inside the other because of the low speed of bullets and tanks. struct reflection getReflection(AABB bb1, AABB bb2); +bool center_distance(AABB bb1, AABB bb2); + #endif /* H_COLLISION */ diff --git a/src/constants.h b/src/constants.h index 3404e18..17acdf0 100644 --- a/src/constants.h +++ b/src/constants.h @@ -11,6 +11,8 @@ #include #include +#include "level.h" + //Comment this out to stop the levels from being bundled with the program #define CREATE_LEVEL_APPVAR @@ -20,12 +22,22 @@ //Offset from sides of screen #define MAP_OFFSET_X 16 +//Size of the gameplay area in tiles +#define LEVEL_SIZE_X 22 +#define LEVEL_SIZE_Y 17 + //Pixel size of each square object #define TILE_SIZE 13 #define TANK_SIZE 13 #define SHELL_SIZE 3 #define MINE_SIZE 13 +//Shifted by 6 bits +typedef uint16_t ufix; +typedef int16_t fix; +#define SHIFT_AMOUNT 6 +#define SHIFT_MASK ((1 << SHIFT_AMOUNT) - 1) + //Distance from center of tank new bullets appear #define BARREL_LENGTH 5 @@ -41,13 +53,49 @@ #define MINE_COUNTDOWN 100 #define MINE_TRIGGERED 10 +//Player action cooldown +#define SHOT_COOLDOWN 5 +#define MINE_COOLDOWN 10 + //TODO: Radius in pixels that enemy tanks will cause mines to explode #define MINE_DETECT_RANGE 20 +//TODO: Radius in pixels that the centers of objects must be inside to be blown up by mines +//I know this is inaccurate but mines are so rarely used it really doesn't matter +#define MINE_EXPLOSION_RADIUS 20 //TODO: rate at which things turn #define PLAYER_BARREL_ROTATION 4 #define PLAYER_TREAD_ROTATION 0 +//TODO: amount of time in milliseconds the mission start screen displays +#define MISSION_START_TIME 2000 +//Font size +#define MISSION_NUMBER_TEXT 3 +#define ENEMY_TANK_TEXT 2 + +#define BLACK 7 +#define WHITE gfx_black + +//Number and pixel size of subregions to be used in collision detection +#define COLLISION_SUBREGIONS_X 4 +#define COLLISION_SUBREGIONS_Y 4 +#define SUBREGION_SIZE_X (TILE_SIZE << SHIFT_AMOUNT) * LEVEL_SIZE_X / COLLISION_SUBREGIONS_X +#define SUBREGION_SIZE_Y (TILE_SIZE << SHIFT_AMOUNT) * LEVEL_SIZE_Y / COLLISION_SUBREGIONS_Y + #define ROT_UNITS_TO_RADIANS M_PI / 128 +typedef struct { + Level level; //level currently being played + uint8_t mission; //The mission number, always displayed 1 higher than stored. Also used as an index for levels. + uint8_t lives; //Number of remaining tanks. This includes the tank that is currently in use, so a value of 1 means that the game will end the next time the tank is hit. + uint8_t kills; //Number of enemy tanks destroyed. + uint24_t timer; //Game time, probably used for physics stuff. + uint16_t cursor_x; //If I decide to implement a cursor mode, this will represent the position of the crosshairs on the screen. + uint8_t cursor_y; //Otherwise, this will be removed + uint24_t lastCycle; //Time the last physics cycle started + bool inProgress; //Whether a mission is in progress + uint8_t shotCooldown; //How many more ticks before we can fire another shot + uint8_t mineCooldown; +} Game; + #endif /* H_CONSTANTS */ diff --git a/src/graphics.c b/src/graphics.c new file mode 100644 index 0000000..75b567e --- /dev/null +++ b/src/graphics.c @@ -0,0 +1,123 @@ +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "constants.h" +#include "objects.h" +//Hopefully we can remove this when we remove AABB rendering +//Hopefully we can now stop referring to myself in the plural +#include "collision.h" +#include "level.h" +#include "graphics.h" +#include "gfx/tiles_gfx.h" + + +void displayScores(void) { + +} + +void missionStart(uint8_t mission, uint8_t lives, uint8_t num_tanks) { + gfx_FillScreen(gfx_white); + + gfx_SetColor(gfx_red); + //TODO: get proper values for this + gfx_FillRectangle_NoClip(0, 60, LCD_WIDTH, 80); + + //Print mission number + gfx_SetTextScale(MISSION_NUMBER_TEXT, MISSION_NUMBER_TEXT); + gfx_SetTextFGColor(WHITE); + gfx_SetTextXY((LCD_WIDTH - 60 * MISSION_NUMBER_TEXT) / 2, 70); + gfx_PrintString("Mission "); + gfx_PrintUInt(mission + 1, 1 + (mission >= 9) + (mission >= 99)); + gfx_SetTextScale(ENEMY_TANK_TEXT, ENEMY_TANK_TEXT); + gfx_SetTextXY((LCD_WIDTH - 97 * ENEMY_TANK_TEXT) / 2, 110); + gfx_PrintString("Enemy Tanks: "); + gfx_PrintUInt(num_tanks, 1); + gfx_SetTextXY((LCD_WIDTH - 8 * MISSION_NUMBER_TEXT) / 2, 150); + gfx_SetTextFGColor(BLACK); // Will be blue once I get pallettes working + gfx_PrintString("x "); + gfx_PrintUInt(lives, 1); + gfx_SetTextFGColor(BLACK); + gfx_SetTextScale(1, 1); + //Print number of tanks + //Print number of lives + + gfx_BlitBuffer(); + + delay(MISSION_START_TIME); +} + +void render(uint8_t* tiles, Level* level, Tank* tanks) { + int i = 0; + gfx_tilemap_t tilemap; //Tilemap config struct + + tilemap.map = tiles; + tilemap.tiles = tileset_tiles; + tilemap.type_width = gfx_tile_no_pow2; + tilemap.type_height = gfx_tile_no_pow2; + tilemap.tile_height = TILE_SIZE; + tilemap.tile_width = TILE_SIZE; + tilemap.draw_height = LEVEL_SIZE_Y; + tilemap.draw_width = LEVEL_SIZE_X; + tilemap.height = LEVEL_SIZE_Y; + tilemap.width = LEVEL_SIZE_X; + tilemap.y_loc = 0; + tilemap.x_loc = MAP_OFFSET_X; + + gfx_FillScreen(gfx_white); + + //Render level tiles + gfx_Tilemap_NoClip(&tilemap, 0, 0); + + for(i = 0; i < level->num_tanks; i++) { + //Render tanks + int j; + AABB bb; + Tank* tank = &tanks[i]; + if(tank->alive) { + gfx_SetTextXY(tank->phys.position_x >> SHIFT_AMOUNT, tank->phys.position_y >> SHIFT_AMOUNT); + gfx_PrintUInt(tank->type, 1); + bb = getAABB(&tank->phys); + renderAABB(bb); + gfx_Line(center_x(bb), center_y(bb), center_x(bb) + tank->bullet_spawn_x, center_y(bb) + tank->bullet_spawn_y); + } + + //draw shell hitboxes until I can get sprites + for(j = max_shells[tank->type] - 1; j >= 0; j--) { + Shell* shell = &tank->shells[j]; + AABB bb; + if(!(shell->alive)) continue; + bb = getAABB(&shell->phys); + renderAABB(bb); + } + for(j = max_mines[tank->type] - 1; j >= 0; j--) { + Mine* mine = &tank->mines[j]; + AABB bb; + if(!(mine->alive)) continue; + bb = getAABB(&mine->phys); + renderAABB(bb); + } + } + + gfx_SetTextXY(0,0); + gfx_PrintUInt(timer_1_Counter / 32.768 , 4); + + gfx_BlitBuffer(); + + while(!os_GetCSC); + +} + +void renderAABB(AABB bb) { + gfx_SetColor(7); + gfx_Rectangle(bb.x1, bb.y1, bb.x2 - bb.x1, bb.y2 - bb.y1); + gfx_SetPixel(center_x(bb), center_y(bb)); +} diff --git a/src/graphics.h b/src/graphics.h new file mode 100644 index 0000000..c80bb45 --- /dev/null +++ b/src/graphics.h @@ -0,0 +1,32 @@ +#ifndef H_GRAPHICS +#define H_GRAPHICS + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "constants.h" +#include "objects.h" +//Hopefully we can remove this when we remove AABB rendering +//Hopefully we can now stop referring to myself in the plural +#include "collision.h" +#include "level.h" +#include "gfx/tiles_gfx.h" + +void displayScores(void); //Display high scores + +void missionStart(uint8_t mission, uint8_t lives, uint8_t num_tanks); //Display the mission start screen + +void render(uint8_t* tiles, Level* level, Tank* tanks); //Render tilemap, tanks, and UI during the game loop + +void renderAABB(AABB bb); + +void displayUI(void); //Display UI during a mission + +#endif \ No newline at end of file diff --git a/src/level.c b/src/level.c index 55f193c..b66d8bf 100644 --- a/src/level.c +++ b/src/level.c @@ -23,14 +23,33 @@ uint8_t tileToYPixel(uint8_t tile_y) { return tile_y * TILE_SIZE; } +uint8_t pixelToXTile(uint24_t pix_x) { + return (pix_x - MAP_OFFSET_X) / TILE_SIZE; +} + +uint8_t pixelToYTile(uint8_t pix_y) { + return pix_y / TILE_SIZE; +} + void createLevels(void) { #ifdef CREATE_LEVEL_APPVAR - LevelPack lvl_pack = {"TANKS!", 3, {0, 0, 0, 0, 0}}; - Level lvls[] = {{25, 2}, {22, 2}, {29, 4}}; + LevelPack lvl_pack = {"TANKS!", 14, {0, 0, 0, 0, 0}}; + Level lvls[] = {{25, 2}, {22, 2}, {29, 4}, {37, 5}, {22, 3}, {32, 5}, {23, 5}, {47, 6}, {31, 7}, {32, 3}, {46, 7}, {41, 5}, {26, 7}, {41, 7}}; SerializedTank* ser_tanks; - SerializedTank ser_tanks1[] = {{PLAYER, 2, 6}, {IMMOBILE, 19, 6}}; - SerializedTank ser_tanks2[] = {{PLAYER, 2, 13}, {BASIC, 19, 3}}; - SerializedTank ser_tanks3[] = {{PLAYER, 2, 8}, {BASIC, 5, 1}, {BASIC, 18, 15}, {IMMOBILE, 19, 8}}; + SerializedTank ser_tanks1[] = {{PLAYER, 2, 6}, {IMMOBILE, 19, 6}}; + SerializedTank ser_tanks2[] = {{PLAYER, 2, 13}, {BASIC, 19, 3}}; + SerializedTank ser_tanks3[] = {{PLAYER, 2, 8}, {BASIC, 5, 1}, {BASIC, 18, 15}, {IMMOBILE, 19, 8}}; + SerializedTank ser_tanks4[] = {{PLAYER, 3, 14}, {BASIC, 10, 8}, {BASIC, 18, 2}, {IMMOBILE, 18, 8}, {IMMOBILE, 11, 2}}; + SerializedTank ser_tanks5[] = {{PLAYER, 2, 13}, {MISSILE, 14, 1}, {MISSILE, 20, 9}}; + SerializedTank ser_tanks6[] = {{PLAYER, 2, 8}, {BASIC, 17, 4}, {BASIC, 17, 15}, {MISSILE, 19, 8}, {MISSILE, 20, 13}}; + SerializedTank ser_tanks7[] = {{PLAYER, 2, 14}, {MISSILE, 1, 1}, {MISSILE, 19, 2}, {MISSILE, 2, 7}, {MISSILE, 19, 15}}; + SerializedTank ser_tanks8[] = {{PLAYER, 1, 8}, {MISSILE, 21, 2}, {MISSILE, 21, 14}, {MINE, 15, 4}, {MINE, 18, 8}, {MINE, 14, 14}}; + SerializedTank ser_tanks9[] = {{PLAYER, 2, 13}, {MINE, 3, 3}, {MINE, 19, 13}, {BASIC, 7, 1}, {BASIC, 13, 5}, {BASIC, 14, 15}, {BASIC, 19, 3}}; + SerializedTank ser_tanks10[] = {{PLAYER, 1, 12}, {RED, 11, 1}, {RED, 20, 4}}; + SerializedTank ser_tanks11[] = {{PLAYER, 2, 2}, {BASIC, 3, 13}, {BASIC, 14, 1}, {MISSILE, 7, 0}, {MISSILE, 19, 14}, {RED, 19, 4}, {RED, 10, 8}}; + SerializedTank ser_tanks12[] = {{PLAYER, 2, 7}, {RED, 12, 1}, {RED, 10, 14}, {IMMOB_MISSILE, 17, 15}, {IMMOB_MISSILE, 19, 4}}; + SerializedTank ser_tanks13[] = {{PLAYER, 0, 8}, {MINE, 5, 15}, {MINE, 8, 1}, {MINE, 12, 10}, {MISSILE, 20, 1}, {MISSILE, 20, 15}, {MISSILE, 21, 8}}; + SerializedTank ser_tanks14[] = {{PLAYER, 1, 15}, {RED, 1, 7}, {RED, 15, 1}, {RED, 20, 11}, {IMMOB_MISSILE, 6, 6}, {IMMOB_MISSILE, 15, 11}, {IMMOB_MISSILE, 20, 1}}; ti_var_t appVar; int i; @@ -56,6 +75,50 @@ void createLevels(void) { comp_tiles = lvl3_compressed; ser_tanks = ser_tanks3; break; + case 3: + comp_tiles = lvl4_compressed; + ser_tanks = ser_tanks4; + break; + case 4: + comp_tiles = lvl5_compressed; + ser_tanks = ser_tanks5; + break; + case 5: + comp_tiles = lvl6_compressed; + ser_tanks = ser_tanks6; + break; + case 6: + comp_tiles = lvl7_compressed; + ser_tanks = ser_tanks7; + break; + case 7: + comp_tiles = lvl8_compressed; + ser_tanks = ser_tanks8; + break; + case 8: + comp_tiles = lvl9_compressed; + ser_tanks = ser_tanks9; + break; + case 9: + comp_tiles = lvl10_compressed; + ser_tanks = ser_tanks10; + break; + case 10: + comp_tiles = lvl11_compressed; + ser_tanks = ser_tanks11; + break; + case 11: + comp_tiles = lvl12_compressed; + ser_tanks = ser_tanks12; + break; + case 12: + comp_tiles = lvl13_compressed; + ser_tanks = ser_tanks13; + break; + case 13: + comp_tiles = lvl14_compressed; + ser_tanks = ser_tanks14; + break; } ti_Write(comp_tiles, sizeof(uint8_t), lvls[i].compressed_tile_size, appVar); ti_Write(ser_tanks, sizeof(SerializedTank), lvls[i].num_tanks, appVar); @@ -76,8 +139,10 @@ Tank deserializeTank(SerializedTank ser_tank) { result.type = ser_tank.type; result.start_x = ser_tank.start_x; result.start_y = ser_tank.start_y; - result.pos_x = (float)tileToXPixel(ser_tank.start_x); - result.pos_y = (float)tileToYPixel(ser_tank.start_y); + result.phys.position_x = tileToXPixel(ser_tank.start_x) << SHIFT_AMOUNT; + result.phys.position_y = tileToYPixel(ser_tank.start_y) << SHIFT_AMOUNT; + result.phys.height = TANK_SIZE; + result.phys.width = TANK_SIZE; result.barrel_rot = 0; result.tread_rot = 0; calc_bullet_spawn(&result); diff --git a/src/level.h b/src/level.h index a39f2e5..425e043 100644 --- a/src/level.h +++ b/src/level.h @@ -14,10 +14,6 @@ #include "constants.h" #include "objects.h" -//Size of the gameplay area in tiles -#define LEVEL_SIZE_X 22 -#define LEVEL_SIZE_Y 17 - enum { EMPTY = 0, //Empty space BLOCK, //Block that can be neither shot nor moved through @@ -49,6 +45,9 @@ void createLevels(void); //Temporary function to make a level pack uint16_t tileToXPixel(uint8_t tile_x); uint8_t tileToYPixel(uint8_t tile_y); +uint8_t pixelToXTile(uint24_t pix_x); +uint8_t pixelToYTile(uint8_t pix_x); + Tank deserializeTank(SerializedTank ser_tank); //Convert a serialized tank into an actual one #endif diff --git a/src/main.c b/src/main.c index 13194c6..8cacdc2 100644 --- a/src/main.c +++ b/src/main.c @@ -25,45 +25,22 @@ #include "objects.h" #include "collision.h" #include "level.h" +#include "graphics.h" #include "gfx/tiles_gfx.h" -typedef struct { - Level level; //level currently being played - uint8_t mission; //The mission number, always displayed 1 higher than stored. Also used as an index for levels. - uint8_t lives; //Number of remaining tanks. This includes the tank that is currently in use, so a value of 1 means that the game will end the next time the tank is hit. - uint8_t kills; //Number of enemy tanks destroyed. - uint24_t timer; //Game time, probably used for physics stuff. - uint16_t cursor_x; //If I decide to implement a cursor mode, this will represent the position of the crosshairs on the screen. - uint8_t cursor_y; //Otherwise, this will be removed - uint24_t lastCycle; //Time the last physics cycle started - bool inProgress; //Whether a mission is in progress -} Game; - -void displayScores(void); //Display high scores - void startMission(bool initial); //Start a mission and reset various tank things. -void missionStart(uint8_t mission, uint8_t lives, uint8_t num_tanks); //Display the mission start screen - void processTank(Tank* tank); //Process tank physics, along with that tank's shells and mines -void render(void); //Render tilemap, tanks, and UI - -void renderAABB(AABB bb); - -void displayUI(void); //Display UI during a mission - void processCollisions(void); //Process collisions between all entities that could reasonably intersect. void stablizeFPS(uint8_t target); void resetFPSCounter(void); //Start the tick and reset the tick time counter -void handleInput(); //Handles inputs from the keypad - -void memView(uint8_t* pointer); +void handleInput(void); //Handles inputs from the keypad -Game game; //Game global, so I can reuse those names elsewhere +Game game; //Game global, so I can reuse those names elsewhere if needed Tank* tanks; //List of all active tanks. uint8_t tiles[LEVEL_SIZE_X * LEVEL_SIZE_Y]; //Currently active tilemap data @@ -84,72 +61,97 @@ void main(void) { timer_1_MatchValue_1 = 32768 / TARGET_FPS; //Something with timers, I think. - displayScores(); - appVar = ti_Open("TANKSLPK", "r"); - ti_Read(&lvl_pack, sizeof(LevelPack), 1, appVar); - for(game.mission = 0; game.mission < lvl_pack.num_levels; game.mission++) { - //Level loop - uint8_t* comp_tiles; //Compressed tile data - SerializedTank* ser_tanks; - - //Read level from appvar - ti_Read(&game.level, sizeof(Level), 1, appVar); - comp_tiles = malloc(game.level.compressed_tile_size); - ti_Read(comp_tiles, sizeof(uint8_t), game.level.compressed_tile_size, appVar); //Load tiles - ser_tanks = malloc(game.level.num_tanks * sizeof(SerializedTank)); - tanks = malloc(game.level.num_tanks * sizeof(Tank)); - ti_Read(ser_tanks, sizeof(SerializedTank), game.level.num_tanks, appVar); - for(i = 0; i < game.level.num_tanks; i++) { - tanks[i] = deserializeTank(ser_tanks[i]); - } - - //Decompress tile data - dzx7_Turbo(comp_tiles, tiles); - - gfx_FillScreen(gfx_white); - - //Display the mission start screen - startMission(true); - - game.inProgress = true; - //Game loop - while(game.inProgress) { - int i; - resetFPSCounter(); - //handle player input - //process physics - for(i = 0; i < game.level.num_tanks; i++) { - processTank(&tanks[i]); - } - - handleInput(); - - processCollisions(); - - render(); - } - - free(ser_tanks); //Free memory so that we don't have issues - free(tanks); //(hopefully this does not cause issues) - free(comp_tiles); - - } - - gfx_End(); + game.lives = 3; + + displayScores(); + appVar = ti_Open("TANKSLPK", "r"); + ti_Read(&lvl_pack, sizeof(LevelPack), 1, appVar); + for(game.mission = 0; game.mission < lvl_pack.num_levels; game.mission++) { + //Level loop + uint8_t* comp_tiles; //Compressed tile data + SerializedTank* ser_tanks; + + //Read level from appvar + ti_Read(&game.level, sizeof(Level), 1, appVar); + comp_tiles = malloc(game.level.compressed_tile_size); + ti_Read(comp_tiles, sizeof(uint8_t), game.level.compressed_tile_size, appVar); //Load tiles + ser_tanks = malloc(game.level.num_tanks * sizeof(SerializedTank)); + tanks = malloc(game.level.num_tanks * sizeof(Tank)); + ti_Read(ser_tanks, sizeof(SerializedTank), game.level.num_tanks, appVar); + for(i = 0; i < game.level.num_tanks; i++) { + tanks[i] = deserializeTank(ser_tanks[i]); + } + + //Decompress tile data + dzx7_Turbo(comp_tiles, tiles); + + gfx_FillScreen(gfx_white); + + //Display the mission start screen + startMission(true); + + game.inProgress = true; + //Game loop + while(game.inProgress) { + int i, alive_tanks = 0; + if(!tanks[0].alive) { + if(!--game.lives) { + displayScores(); + gfx_End(); + return; + } + startMission(false); + } + resetFPSCounter(); + + if(game.shotCooldown) { + game.shotCooldown--; + } + if(game.mineCooldown) { + game.mineCooldown--; + } + + //handle player input + handleInput(); + //process physics + + for(i = 0; i < game.level.num_tanks; i++) { + processTank(&tanks[i]); + if(i && tanks[i].alive) { + alive_tanks++; + } + } + if(!alive_tanks) { + game.inProgress = 0; + } + + processCollisions(); + + render(tiles, &game.level, tanks); + } + + free(ser_tanks); //Free memory so that we don't have issues + free(tanks); //(hopefully this does not cause issues) + free(comp_tiles); + + } + + gfx_End(); ti_CloseAll(); } void startMission(bool initial) { int i; - int remaining_tanks = 0; + int remaining_tanks = -1; //Don't count the player tank + tanks[0].alive = true; for(i = 0; i < game.level.num_tanks; i++) { Tank* tank = &tanks[i]; int j; if(initial) tank->alive = true; if(tank->alive) remaining_tanks++; - tank->pos_x = (float)(tileToXPixel(tank->start_x)); - tank->pos_y = (float)(tileToYPixel(tank->start_y)); + tank->phys.position_x = tileToXPixel(tank->start_x) << SHIFT_AMOUNT; + tank->phys.position_y = tileToYPixel(tank->start_y) << SHIFT_AMOUNT; tank->barrel_rot = 0; tank->tread_rot = 191; for(j = 0; j < 5; j++) { @@ -164,120 +166,65 @@ void startMission(bool initial) { missionStart(game.mission, game.lives, remaining_tanks); } -void displayScores(void) { - -} - -void missionStart(uint8_t mission, uint8_t lives, uint8_t num_tanks) { - -} - -void render(void) { - int i = 0; - gfx_tilemap_t tilemap; //Tilemap config struct - - tilemap.map = tiles; - tilemap.tiles = tileset_tiles; - tilemap.type_width = gfx_tile_no_pow2; - tilemap.type_height = gfx_tile_no_pow2; - tilemap.tile_height = TILE_SIZE; - tilemap.tile_width = TILE_SIZE; - tilemap.draw_height = LEVEL_SIZE_Y; - tilemap.draw_width = LEVEL_SIZE_X; - tilemap.height = LEVEL_SIZE_Y; - tilemap.width = LEVEL_SIZE_X; - tilemap.y_loc = 0; - tilemap.x_loc = MAP_OFFSET_X; - - gfx_FillScreen(gfx_white); - - //Render level tiles - gfx_Tilemap(&tilemap, 0, 0); - - for(i = 0; i < game.level.num_tanks; i++) { - //Render tanks - int j; - uint16_t center_x; - uint16_t center_y; - AABB bb; - Tank* tank = &tanks[i]; - gfx_SetTextXY((uint16_t)tank->pos_x, (uint8_t)tank->pos_y); - gfx_PrintUInt(tank->type, 1); - bb = getTankAABB(tank); - renderAABB(bb); - center_x = tank->pos_x + TANK_SIZE / 2; - center_y = tank->pos_y + TANK_SIZE / 2; - gfx_Line(center_x, center_y, center_x + tank->bullet_spawn_x, center_y + tank->bullet_spawn_y); - - //draw shell hitboxes until I can get sprites - for(j = max_shells[tank->type] - 1; j >= 0; j--) { - Shell* shell = &tank->shells[j]; - AABB bb; - if(!(shell->alive)) continue; - bb = getShellAABB(shell); - renderAABB(bb); - } - for(j = max_mines[tank->type] - 1; j >= 0; j--) { - Mine* mine = &tank->mines[j]; - AABB bb; - if(!(mine->alive)) continue; - bb = getMineAABB(mine); - renderAABB(bb); - } - } - - gfx_SetTextXY(0,0); - gfx_PrintUInt(timer_1_Counter / 32.768 , 4); - - gfx_BlitBuffer(); - - while(!os_GetCSC); - -} - void resetFPSCounter() { //woo copypaste! /* Disable the timer so it doesn't run when we don't want it to be running */ - timer_Control = TIMER1_DISABLE; + timer_Control = TIMER1_DISABLE; - timer_1_Counter = 0; + timer_1_Counter = 0; - /* Enable the timer, set it to the 32768 kHz clock, enable an interrupt once it reaches 0, and make it count down */ + /* Enable the timer, set it to the 32768 kHz clock, enable an interrupt once it reaches 0, and make it count down */ timer_Control = TIMER1_ENABLE | TIMER1_32K | TIMER1_NOINT | TIMER1_UP; } -void memView(uint8_t* pointer) { - int i, j; - for(i = 0; i < 12; i++) { - for(j = 0; j < 8; j++) { - gfx_SetTextXY(40 * j, 20 * i); - gfx_PrintUInt(pointer[8 * i + j], 3); - } - } - gfx_BlitBuffer(); -} - -void renderAABB(AABB bb) { - gfx_SetColor(7); - gfx_Rectangle(bb.x1, bb.y1, bb.x2 - bb.x1, bb.y2 - bb.y1); -} - //Process tank physics void processTank(Tank* tank) { int i; //Loop through all shells for(i = max_shells[tank->type] - 1; i >= 0; i--) { + int j; Shell* shell = &tank->shells[i]; + struct reflection reflect; //Ignore dead shells if(!shell->alive) continue; //Add velocity - shell->pos_x += shell->vel_x; - shell->pos_y += shell->vel_y; + shell->phys.position_x += (uint24_t)(shell->phys.velocity_x * (1 << SHIFT_AMOUNT)); + shell->phys.position_y += (uint24_t)(shell->phys.velocity_y * (1 << SHIFT_AMOUNT)); + //This will eventually be part of the collision bit - if( shell->pos_x < MAP_OFFSET_X || - shell->pos_x > MAP_OFFSET_X + TILE_SIZE * LEVEL_SIZE_X || - shell->pos_y < 0 || - shell->pos_y > TILE_SIZE * LEVEL_SIZE_Y ) shell->alive = false; + for(j = 0; j < game.level.num_tanks; j++) { + AABB bb1 = getAABB(&shell->phys); + AABB bb2 = getAABB(&tanks[j].phys); + if(!tanks[j].alive) continue; + if(shell->left_tank_hitbox) { + if(detectCollision(bb1, bb2)) { + tanks[j].alive = false; + shell->alive = false; + } + } else { + if(j == 0 && !detectCollision(bb1, bb2)) { + shell->left_tank_hitbox = true; + } + } + } + + if(shell->phys.position_x >> SHIFT_AMOUNT < MAP_OFFSET_X) { + shell_ricochet(shell, LEFT, MAP_OFFSET_X - (shell->phys.position_x >> SHIFT_AMOUNT)); + } else if(shell->phys.position_x >> SHIFT_AMOUNT > MAP_OFFSET_X + TILE_SIZE * LEVEL_SIZE_X) { + shell_ricochet(shell, RIGHT, (shell->phys.position_x >> SHIFT_AMOUNT) - MAP_OFFSET_X - TILE_SIZE * LEVEL_SIZE_X); + } + if((shell->phys.position_y >> SHIFT_AMOUNT) + 30 < 30) { + shell_ricochet(shell, UP, 0 - (shell->phys.position_y >> SHIFT_AMOUNT)); + } else if(shell->phys.position_y >> SHIFT_AMOUNT > TILE_SIZE * LEVEL_SIZE_Y) { + shell_ricochet(shell, DOWN, (shell->phys.position_y >> SHIFT_AMOUNT) - TILE_SIZE * LEVEL_SIZE_Y); + } + reflect = getTileReflect(&shell->oldPhys, &shell->phys, false, tiles); + if(reflect.colliding) { + shell_ricochet(shell, reflect.dir, 0); + } + + shell->oldPhys = shell->phys; + } if(!max_mines[tank->type]) return; for(i = max_mines[tank->type] - 1; i >= 0; i--) { @@ -286,14 +233,12 @@ void processTank(Tank* tank) { if(!mine->alive) continue; //TODO: check for nearby enemy tanks and set counter if necessary if(--mine->countdown == 0) { - //TODO: kill things - //TODO: explosions - //TODO: sound effects for explosions - //TODO: USB drivers for sound effects for explosions - //TODO: be realistic abouot USB drivers for sound effects for explosions - mine->alive = false; + detonate(mine, tiles); } + mine->oldPhys = mine->phys; } + + tank->oldPhys = tank->phys; } void handleInput() { @@ -303,22 +248,24 @@ void handleInput() { //TODO: Replace with fancy roatation stuff if necessary if(kb_Data[7] & kb_Down) { - player->pos_y += TANK_SPEED_NORMAL; + player->phys.position_y += TANK_SPEED_NORMAL << SHIFT_AMOUNT; } if(kb_Data[7] & kb_Left) { - player->pos_x -= TANK_SPEED_NORMAL; + player->phys.position_x -= TANK_SPEED_NORMAL << SHIFT_AMOUNT; } if(kb_Data[7] & kb_Right) { - player->pos_x += TANK_SPEED_NORMAL; + player->phys.position_x += TANK_SPEED_NORMAL << SHIFT_AMOUNT; } if(kb_Data[7] & kb_Up) { - player->pos_y -= TANK_SPEED_NORMAL; + player->phys.position_y -= TANK_SPEED_NORMAL << SHIFT_AMOUNT; } - if(kb_Data[1] & kb_2nd) { + if(kb_Data[1] & kb_2nd && !game.shotCooldown) { fire_shell(player); + game.shotCooldown = SHOT_COOLDOWN; } - if(kb_Data[2] & kb_Alpha) { + if(kb_Data[2] & kb_Alpha && !game.mineCooldown) { lay_mine(player); + game.mineCooldown = MINE_COOLDOWN; } if(kb_Data[1] & kb_Mode) { player->barrel_rot -= PLAYER_BARREL_ROTATION; @@ -339,6 +286,8 @@ void processCollisions() { } +//TODO: moar levels //TODO: compress sprites //TODO: basic physics //TODO: tank sprites +//TODO: crosshair / direction indicator diff --git a/src/objects.c b/src/objects.c index 743059b..2cc11ae 100644 --- a/src/objects.c +++ b/src/objects.c @@ -10,9 +10,15 @@ #include "constants.h" #include "objects.h" +#include "level.h" +#include "collision.h" -const uint8_t max_shells[] = {5, 1, 1, 1, 1, 3, 2, 5, 5, 2}; -const uint8_t max_mines[] = {2, 0, 0, 0, 4, 0, 0, 2, 2, 2}; +extern Game game; +extern Tank* tanks; + +const uint8_t max_shells[] = {5, 1, 1, 1, 1, 3, 2, 5, 5, 2}; +const uint8_t max_mines[] = {2, 0, 0, 0, 4, 0, 0, 2, 2, 2}; +const uint8_t max_bounces[] = {1, 1, 1, 0, 1, 1, 2, 1, 1, 0}; bool fire_shell(Tank* tank) { int i; @@ -21,16 +27,20 @@ bool fire_shell(Tank* tank) { float vector_x, vector_y; if(shell->alive) continue; shell->alive = true; + shell->left_tank_hitbox = false; + shell->bounces = max_bounces[tank->type]; vector_x = cos(tank->barrel_rot * ROT_UNITS_TO_RADIANS); vector_y = sin(tank->barrel_rot * ROT_UNITS_TO_RADIANS); - shell->pos_x = tank->pos_x + TANK_SIZE / 2 + BARREL_LENGTH * vector_x; - shell->pos_y = tank->pos_y + TANK_SIZE / 2 + BARREL_LENGTH * vector_y; + shell->phys.position_x = tank->phys.position_x + (TANK_SIZE / 2 + BARREL_LENGTH * vector_x) * (1 << SHIFT_AMOUNT); + shell->phys.position_y = tank->phys.position_y + (TANK_SIZE / 2 + BARREL_LENGTH * vector_y) * (1 << SHIFT_AMOUNT); + shell->phys.width = shell->phys.height = SHELL_SIZE; + shell->phys.type = ShellPhysics; if(tank->type == MISSILE || tank->type == IMMOB_MISSILE) { - shell->vel_x = SHELL_SPEED_MISSILE * vector_x; - shell->vel_y = SHELL_SPEED_MISSILE * vector_y; + shell->phys.velocity_x = SHELL_SPEED_MISSILE * vector_x; + shell->phys.velocity_y = SHELL_SPEED_MISSILE * vector_y; } else { - shell->vel_x = SHELL_SPEED_STANDARD * vector_x; - shell->vel_y = SHELL_SPEED_STANDARD * vector_y; + shell->phys.velocity_x = SHELL_SPEED_STANDARD * vector_x; + shell->phys.velocity_y = SHELL_SPEED_STANDARD * vector_y; } return true; } @@ -45,8 +55,9 @@ bool lay_mine(Tank* tank) { if(mine->alive) continue; mine->alive = true; mine->countdown = MINE_COUNTDOWN; - mine->pos_x = tank->pos_x + (TANK_SIZE - MINE_SIZE) / 2; - mine->pos_y = tank->pos_y + (TANK_SIZE - MINE_SIZE) / 2; + mine->phys.position_x = tank->phys.position_x + ((TANK_SIZE - MINE_SIZE) << SHIFT_AMOUNT) / 2; + mine->phys.position_y = tank->phys.position_y + ((TANK_SIZE - MINE_SIZE) << SHIFT_AMOUNT) / 2; + mine->phys.width = mine->phys.height = MINE_SIZE; return true; } return false; @@ -56,3 +67,66 @@ void calc_bullet_spawn(Tank* tank) { tank->bullet_spawn_x = BARREL_LENGTH * cos(tank->barrel_rot * ROT_UNITS_TO_RADIANS); tank->bullet_spawn_y = BARREL_LENGTH * sin(tank->barrel_rot * ROT_UNITS_TO_RADIANS); } + +//TODO: fix this ugly mess +void detonate(Mine* mine, uint8_t* tiles) { + int j, k; + //TODO: explosions + mine->alive = false; + //Mines and tiles must be the same size for this to work + //(this is Bad Code) + for(j = ((mine->phys.position_x >> SHIFT_AMOUNT) - MINE_EXPLOSION_RADIUS - MAP_OFFSET_X) / TILE_SIZE; j <= ((mine->phys.position_x >> SHIFT_AMOUNT) + MINE_EXPLOSION_RADIUS - MAP_OFFSET_X) / TILE_SIZE; j++) { + for(k = ((mine->phys.position_y >> SHIFT_AMOUNT) - MINE_EXPLOSION_RADIUS) / TILE_SIZE; k <= ((mine->phys.position_y >> SHIFT_AMOUNT) + MINE_EXPLOSION_RADIUS) / TILE_SIZE; k++) { + if(tiles[j + LEVEL_SIZE_X * k] == DESTRUCTIBLE) tiles[j + LEVEL_SIZE_X * k] = DESTROYED; + } + } + for(j = 0; j < game.level.num_tanks; j++) { + Tank* tank = &tanks[j]; + AABB bb1 = getAABB(&mine->phys); + AABB bb2 = getAABB(&tank->phys); + if(!tank->alive) continue; + if(center_distance(bb1, bb2) < MINE_EXPLOSION_RADIUS) { + tank->alive = false; + } + for(k = 0; k < max_shells[tank->type]; k++) { + Shell* shell = &tank->shells[k]; + if(shell->alive && center_distance(getAABB(&mine->phys), getAABB(&shell->phys)) < MINE_EXPLOSION_RADIUS) { + shell->alive = false; + } + } + for(k = 0; k < max_mines[tank->type]; k++) { + Mine* mine2 = &tank->mines[k]; + if(mine2->alive && center_distance(getAABB(&mine->phys), getAABB(&mine2->phys)) < MINE_EXPLOSION_RADIUS) { + detonate(mine2, tiles); + } + } + } +} + +bool shell_ricochet(Shell* shell, Direction dir, uint8_t distance) { + //Determine if shell explodes here, and subtracts 1 from the bounces left + if(!shell->bounces--) { + shell->alive = false; + return false; + } + //Shell is still alive + switch(dir) { + case UP: + shell->phys.position_y += 2 * distance << SHIFT_AMOUNT; //Reflect the position of the shell + shell->phys.velocity_y *= -1; //Invert the velocity of the shell + break; + case DOWN: + shell->phys.position_y -= 2 * distance << SHIFT_AMOUNT; + shell->phys.velocity_y *= -1; + break; + case LEFT: + shell->phys.position_x += 2 * distance << SHIFT_AMOUNT; + shell->phys.velocity_x *= -1; + break; + case RIGHT: + shell->phys.position_x -= 2 * distance << SHIFT_AMOUNT; + shell->phys.velocity_x *= -1; + break; + } + return true; +} diff --git a/src/objects.h b/src/objects.h index dd35c93..7c50d4f 100644 --- a/src/objects.h +++ b/src/objects.h @@ -11,6 +11,8 @@ #include #include +#include "collision.h" + typedef enum { PLAYER = 0, //blue IMMOBILE, //brown @@ -26,21 +28,21 @@ typedef enum { typedef struct { bool alive; //Whether this bullet is processed - float pos_x; //Pixel of the top-left pixel of the sprite and AABB - float pos_y; - float vel_x; //Velocity of the bullets, in pixels per tick - float vel_y; + PhysicsBody phys; + PhysicsBody oldPhys; uint8_t bounces; //Number of times the bullet can bounce off a wall without exploding bool left_tank_hitbox; //Whether the shell has exited the tank hitbox yet. Used to stop bullets from blowing up the tank that fired them. } Shell; //Numer of shots each type of tank can have on-screen at any one time extern const uint8_t max_shells[]; +//Number of times a shell can bounce off a wall +extern const uint8_t max_bounces[]; typedef struct { bool alive; //Whether this mine is processed - uint16_t pos_x; //Top left pixel of the mine - uint8_t pos_y; + PhysicsBody phys; + PhysicsBody oldPhys; uint8_t countdown; //Number of physics loops until explosions occur } Mine; @@ -51,10 +53,10 @@ typedef struct { //A tank, used while gameplay occurs TankType type; bool alive; //Whether this tank is alive or exploded. - float pos_x; //Pixel of the top-left pixel of the sprite and AABB - float pos_y; - uint8_t start_x; //Tile the tank starts on + uint8_t start_x; uint8_t start_y; + PhysicsBody phys; + PhysicsBody oldPhys; uint8_t tread_rot; //Rotation of tank treads. Determines the direction of the tank. uint8_t barrel_rot; //Rotation of the barrel. Determines the direction shots are fired in int8_t bullet_spawn_x; //Position relative to center that bullets will spawn from @@ -67,6 +69,12 @@ uint8_t fire_shell(Tank* tank); //PEW PEW PEW uint8_t lay_mine(Tank* tank); //Lay a mine under the tank +void detonate(Mine* mine, uint8_t* tiles); + void calc_bullet_spawn(Tank* tank); +//Bounce a shell off a wall +//Returns whether or not the shell is still alive +bool shell_ricochet(Shell* shell, Direction dir, uint8_t distance); + #endif /* H_OBJECTS */ diff --git a/src/tiles/lvl10.csv b/src/tiles/lvl10.csv new file mode 100644 index 0000000..78ef077 --- /dev/null +++ b/src/tiles/lvl10.csv @@ -0,0 +1,17 @@ +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,1,1,2,1,1,1,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,2,2,2,2,0,0,0,0,0,0,0,0,0,0,2,2,2,2,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,1,1,1,2,1,1,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/src/tiles/lvl11.csv b/src/tiles/lvl11.csv new file mode 100644 index 0000000..0ba47b1 --- /dev/null +++ b/src/tiles/lvl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0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \ No newline at end of file diff --git a/src/tiles/template.xlsx b/src/tiles/template.xlsx index 35c3c4a..5e36367 100644 Binary files a/src/tiles/template.xlsx and b/src/tiles/template.xlsx differ diff --git a/src/tiles/template.xltx b/src/tiles/template.xltx new file mode 100644 index 0000000..91900c5 Binary files /dev/null and b/src/tiles/template.xltx differ diff --git a/src/tiles/tilemaps.c b/src/tiles/tilemaps.c index 52f2ff8..2df755e 100644 --- a/src/tiles/tilemaps.c +++ b/src/tiles/tilemaps.c @@ -5,10 +5,59 @@ uint8_t lvl1_compressed[25] = { 0x00,0x81,0x15,0x00,0x01,0x15,0x05,0x0F,0xCA,0x15,0x00,0x02,0x87,0xE0,0x15,0xDA,0x57,0x08,0x42,0xAA,0x02,0x0A,0x00,0x00,0x01 }; +uint8_t lvl10_compressed[32] = { + 0x00,0x82,0xC5,0x00,0x01,0x42,0x00,0xF0,0x0D,0x5A,0x47,0x02,0x83,0x85,0x3B,0x02,0x47,0x00,0xC1,0x0D,0xA8,0x83,0x58,0x84,0x4F,0x0D,0x03,0x68,0x87,0xC0,0x00,0x20 +}; + +uint8_t lvl11_compressed[46] = { + 0x00,0x90,0x00,0x02,0x00,0x8F,0x00,0x86,0x50,0x15,0x01,0x62,0x15,0x01,0x11,0x01,0x02,0x02,0xF1,0x15,0xFC,0x61,0x23,0x7C,0x1F,0x09,0xF7,0x0A,0x61,0x1F,0x78,0x1A, + 0xB8,0x18,0xA5,0x4E,0x23,0x01,0x83,0xF0,0xFA,0x87,0x46,0xD2,0x00,0x01 +}; + +uint8_t lvl12_compressed[41] = { + 0x00,0x81,0x18,0x00,0x03,0x03,0x99,0x08,0x01,0x09,0x91,0x15,0x01,0x01,0xF0,0x2F,0x58,0x14,0x02,0x85,0x10,0x14,0x02,0x9C,0x3E,0x7C,0x14,0x1A,0xCE,0x7D,0xB7,0x13, + 0x84,0xD2,0x7C,0x15,0x1F,0xC0,0x00,0x00,0x20 +}; + +uint8_t lvl13_compressed[26] = { + 0x00,0x81,0x0C,0x00,0x01,0x01,0x22,0x02,0x02,0xD0,0x03,0x00,0x2E,0x46,0x00,0xF0,0x6B,0x03,0x7F,0x4F,0x03,0x90,0xDB,0x40,0x00,0x20 +}; + +uint8_t lvl14_compressed[41] = { + 0x00,0x81,0x0D,0x00,0x01,0x3A,0x00,0x03,0x45,0x01,0x02,0x5C,0x01,0x15,0x2B,0x2B,0x06,0xB2,0x15,0x42,0x5E,0x9C,0x2B,0x0E,0x7A,0x20,0x00,0x04,0x8B,0x7C,0xCA,0x09, + 0x82,0xD4,0x78,0x00,0x11,0x06,0xB0,0x00,0x01 +}; + uint8_t lvl2_compressed[22] = { 0x00,0x81,0xC1,0x00,0x01,0x32,0x00,0x02,0x90,0x00,0x00,0x3C,0x5C,0x00,0x7D,0xE1,0x89,0x03,0x8C,0x7D,0x00,0x02 }; uint8_t lvl3_compressed[29] = { 0x00,0x81,0x0C,0x00,0x01,0x01,0x48,0x02,0x00,0x01,0x85,0x60,0x1D,0x55,0x15,0xE0,0x74,0x6A,0x6C,0x4E,0x00,0xE1,0x1C,0x1D,0x08,0x70,0x00,0x00,0x08 +}; + +uint8_t lvl4_compressed[37] = { + 0x00,0x95,0x00,0x03,0x18,0x06,0x00,0x81,0x3E,0x15,0x22,0x0E,0x4F,0x00,0x06,0x01,0x8B,0x00,0x8F,0x2B,0x83,0xF8,0x6D,0x72,0x48,0x3A,0x7A,0x70,0x8A,0x87,0x42,0xB6, + 0x04,0xF8,0x15,0x00,0x04 +}; + +uint8_t lvl5_compressed[22] = { + 0x00,0x81,0xA1,0x00,0x02,0x0A,0x38,0x15,0x01,0x16,0x08,0x62,0x00,0x02,0x01,0x15,0x16,0x81,0x4E,0x6B,0x00,0x01 +}; + +uint8_t lvl6_compressed[32] = { + 0x00,0x81,0x10,0x00,0x01,0x02,0x92,0x01,0x68,0x00,0xD4,0x1B,0x03,0xF0,0x08,0x27,0xCF,0x15,0x16,0x02,0xF4,0x6E,0xE1,0xD5,0x28,0xE2,0x40,0x8A,0xAF,0x30,0x00,0x08 +}; + +uint8_t lvl7_compressed[23] = { + 0x00,0x81,0x59,0x00,0x01,0x97,0x00,0x02,0x01,0x00,0x06,0x52,0x38,0xC0,0x3A,0x62,0x84,0x83,0x2B,0x00,0x00,0x00,0x80 +}; + +uint8_t lvl8_compressed[47] = { + 0x00,0x81,0x0D,0x00,0x02,0x20,0x04,0x02,0x01,0x01,0xE7,0x03,0x0E,0x9E,0x06,0x3A,0x24,0xE3,0x26,0x11,0x14,0x02,0xB1,0x1D,0xC8,0x0C,0x01,0xB4,0x15,0x01,0x19,0xC7, + 0x15,0xC3,0x57,0x41,0x83,0x1E,0xAF,0x10,0xD8,0xDB,0x41,0xF4,0x00,0x00,0x02 +}; + +uint8_t lvl9_compressed[31] = { + 0x00,0x81,0x28,0x00,0x01,0x01,0x84,0xC8,0x15,0x02,0x00,0x12,0xD2,0x15,0x01,0xDA,0x00,0x15,0x02,0x32,0x0E,0x05,0x58,0x6E,0x78,0xDB,0x20,0xDE,0x00,0x00,0x01 }; \ No newline at end of file diff --git a/src/tiles/tilemaps.h b/src/tiles/tilemaps.h index c67fd82..6758b49 100644 --- a/src/tiles/tilemaps.h +++ b/src/tiles/tilemaps.h @@ -5,7 +5,18 @@ #include extern uint8_t lvl1_compressed[25]; +extern uint8_t lvl10_compressed[32]; +extern uint8_t lvl11_compressed[46]; +extern uint8_t lvl12_compressed[41]; +extern uint8_t lvl13_compressed[26]; +extern uint8_t lvl14_compressed[41]; extern uint8_t lvl2_compressed[22]; extern uint8_t lvl3_compressed[29]; +extern uint8_t lvl4_compressed[37]; +extern uint8_t lvl5_compressed[22]; +extern uint8_t lvl6_compressed[32]; +extern uint8_t lvl7_compressed[23]; +extern uint8_t lvl8_compressed[47]; +extern uint8_t lvl9_compressed[31]; #endif