diff --git a/src/bit_game.cpp b/src/bit_game.cpp index 9e39c36..1986467 100644 --- a/src/bit_game.cpp +++ b/src/bit_game.cpp @@ -21,6 +21,18 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +//---------------------------------------------------------- +// bit_game.cpp +/*********************************************************** +* main game loop +************************************************************/ +// Horible, despratly needs to be cleaned up... + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +// STD, SDL, and tmx +//////////////////////////////////////////////////////////// #include #include @@ -30,9 +42,9 @@ #include #include "discord.h" -////////////////// -// bitten headers -////////////////// +//////////////////////////////////////////////////////////// +// ENGINE HEADERS +//////////////////////////////////////////////////////////// extern "C" { @@ -48,6 +60,7 @@ extern "C" #include "f_save.h" } +// mainloop void bit_main() { bitgame.preformance.startTime = 0; diff --git a/src/e_collision.c b/src/e_collision.c index c0d13d1..5ec35b8 100644 --- a/src/e_collision.c +++ b/src/e_collision.c @@ -28,19 +28,19 @@ * this file handles the collision between sprites ************************************************************/ // needs to be compleatly nuked most likely +// november 2024 update: oh my god its fucking working... maybe i dont need to nuke it //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// -// STD and SDL +// STD, SDL, and tmx //////////////////////////////////////////////////////////// #include #include #include #include #include -#include "r_render.h" -#include "tmx.h" +#include //////////////////////////////////////////////////////////// @@ -51,6 +51,7 @@ #include "e_collision.h" // collision handling #include "p_player.h" #include "bit_game.h" +#include "r_render.h" #include "discord.h" /////// @@ -113,6 +114,10 @@ int32_t checkCollision(tmx_map* map, int x, int y) if (chests->content.gids[((y - 3) * map->width) + (x - 3)] > 0) return chests->content.gids[((y - 3) * map->width) + (x - 3)]; + else if (chests->content.gids[((y - 4) * map->width) + (x - 4)] > 0) + return chests->content.gids[((y - 4) * map->width) + (x - 4)]; + else + return chests->content.gids[((y - 2) * map->width) + (x - 2)]; } else { diff --git a/src/f_save.c b/src/f_save.c index ad6b81c..4c9d9c0 100644 --- a/src/f_save.c +++ b/src/f_save.c @@ -21,15 +21,31 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +//---------------------------------------------------------- +// f_save.c +/*********************************************************** +* this file handles reading and writing save files +************************************************************/ +// was written from scratch, could be cleaned up, but im currently happy with it + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +// STD +//////////////////////////////////////////////////////////// #include #include #include #include #include -#include "defaultSave.h" // default savefile -#include "sdl_bittendef.h" +//////////////////////////////////////////////////////////// +// ENGINE HEADERS +//////////////////////////////////////////////////////////// + +#include "sdl_bittendef.h" // defines for the engine +#include "defaultSave.h" // default savefile, also horible way we can make a buffer :) #include "bit_game.h" #include "f_save.h" diff --git a/src/main.cpp b/src/main.cpp index a51ad56..73f5544 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,19 +21,35 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +//---------------------------------------------------------- +// main.cpp +/*********************************************************** +* this file setus up everything +************************************************************/ + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +// STD, SDL, and tmx +//////////////////////////////////////////////////////////// #include #include #include #include -#include "discord.h" +#include -//#include +//#include // sorry cLDtk, tmx seems to be working fine for now :) +//////////////////////////////////////////////////////////// +// ENGINE HEADERS +//////////////////////////////////////////////////////////// + +#include "discord.h" extern "C" { -#include "bit_game.h" -#include "sdl_bittendef.h" +#include "sdl_bittendef.h" // defines for the engine +#include "bit_game.h" // a c header for some fucking reason #include "r_render.h" #include "f_save.h" } diff --git a/src/p_player.c b/src/p_player.c index b6abd35..0c23e0c 100644 --- a/src/p_player.c +++ b/src/p_player.c @@ -22,6 +22,18 @@ * SOFTWARE. */ +//---------------------------------------------------------- +// p_player.c +/*********************************************************** +* this file handles the movement of the player +************************************************************/ + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +// ENGINE HEADERS +//////////////////////////////////////////////////////////// + #include "sdl_bittendef.h" #include "p_player.h" #include "e_entity.h" diff --git a/src/r_render.c b/src/r_render.c index 1304dbc..a5aad2a 100644 --- a/src/r_render.c +++ b/src/r_render.c @@ -21,6 +21,18 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +//---------------------------------------------------------- +// r_render.c +/*********************************************************** +* this file handles all rendering related logic +************************************************************/ +// very dumb and we have to work around some of the things it does, but it works + +//////////////////////////////////////////////////////////// +// Headers +//////////////////////////////////////////////////////////// +// STD, SDL, and tmx +//////////////////////////////////////////////////////////// #include #include @@ -28,9 +40,13 @@ #include #include -//#include +//#include // sorry cLDtk, tmx seems to be working fine for now :) -#include "sdl_bittendef.h" +//////////////////////////////////////////////////////////// +// ENGINE HEADERS +//////////////////////////////////////////////////////////// + +#include "sdl_bittendef.h" // defines for the engine #include "r_render.h" #include "e_entity.h" #include "bit_game.h"