-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' of https://github.com/bitten2up/bittens-adventure …
…into next
- Loading branch information
Showing
10 changed files
with
142 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# bitten engine level format | ||
|
||
## tiled is nice and all, but can be a bitch at times | ||
|
||
I would like to minimize dependices to make it easier to port, not to mention just how badly undocumented it is. Just look at `e_collision.c` for example, fucking gross. Better yet it doesn't even work properly still.... (worse part it worked on raylib iirc) | ||
The other issue is that if i can bearly get collision working with static objects because welp look at that, fucking conversions to get our current location that not even I understand how they worked back in the raylib days (when they actually somewhat worked properly, iirc i even could delete tiles or smth) | ||
|
||
## Why not use LDtk | ||
|
||
well.. if you looked through `r_render.c` you can find broken code to attempt and do this exact thing, but iirc i didn't like any of the libraries for it. now that I have cpp, i might consider it again though. | ||
|
||
## the plan | ||
|
||
make something thats easy to use. one of the goals is being able to figure out if we are coliding at different aspect ratios/resolutions and be able to have the character not be dead stuck in the middle of the screen | ||
|
||
|
||
## ok but what's the catch | ||
|
||
well... inorder to do that, i don't want to just remove whats currently working, so I will make a simple map configuration format that will define which format to use. | ||
|
||
the goal would be something like this for the time being | ||
|
||
```text | ||
version 1 | ||
using tiled/LDtk/custom | ||
``` | ||
|
||
now i dont feel like parsing text, so ill take the easy way out for now | ||
|
||
```c | ||
char file[] = {'0x1', '0x0'} // first value is version, second is format (in this case tiled) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# bitten engine save files | ||
|
||
## file format | ||
|
||
to start out with, I'll show the code that defines the default save as of july 9th 2024 | ||
```c | ||
enum saveFormat | ||
{ | ||
HEADER = 0, | ||
HEADERVERSION = 10, | ||
SETTINGS = 11, | ||
SAVEDXPOS = 12, | ||
SAVEDYPOS = 16, | ||
}; | ||
unsigned char saveD[] = { | ||
'b', 'i', 't', 't', 'e', 'n', 's', 'a', 'v', 0x00, // header, last byte is for different games | ||
0x00, // version of save format, part of header, but we check this separately | ||
0b10000000, // first value: music, second value: fullscreen | ||
0x00, 0x00, 0x00, 0x00, // x position | ||
0x00, 0x00, 0x00, 0x00, // y position | ||
}; | ||
unsigned int saveDlen = 20; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright (c) 2021-2024 bitten2up | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
///////////////////////////// | ||
/* | ||
* t_main.cpp | ||
* | ||
* handles reading the tilemaps data. | ||
*/ | ||
///////////////////////////// | ||
|
||
#include "tmx.h" | ||
#include <cLDtk.h> | ||
|
||
|
||
extern "c" { | ||
#include "t_main.h" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* MIT License | ||
* | ||
* Copyright (c) 2021-2024 bitten2up | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ |