Commit graph

264 commits

Author SHA1 Message Date
Theo Champion
e28cd1c85b feat: readded minimap 2025-07-30 16:35:39 +02:00
Theo Champion
5281fe6abd feat: made 3d... for the cub3d 2025-07-30 16:25:41 +02:00
Theo Champion
077659cd25 feat: Added raycaster (concept only no drawing yet)
Almost copy pasted from https://github.com/herbievine/42/blob/main/cub3d
but it's also copied from Lodev's ressource
2025-07-30 13:34:36 +02:00
Theo Champion
7c42208d20 dev: added ray structure 2025-07-30 12:07:45 +02:00
Theo Champion
a9b5fbd370 chore(map): changed spawn angle to north for easier debugging of angles: 2025-07-29 20:15:20 +02:00
Theo Champion
788f248c5e fix: norme compliance 2025-07-29 20:13:43 +02:00
Theo Champion
b6eeea5e9f feat(player): reimplemented angles 2025-07-29 19:50:23 +02:00
Theo Champion
e46f199606 fix: forgot to add header file 2025-07-29 15:03:10 +02:00
Theo Champion
2e1838e0bd removal(player): removed old angle code as it's incompatible with new methods 2025-07-29 15:02:40 +02:00
Theo Champion
faf5127829 feat(player): redid all the movement code more details in desc
- had to tamper at init with the map pointer to allow player to move
- tweaked movement speed
- allowed for multiple keys to be pressed at the same time
- added collisions
- had to modify minimap code because it segfaulted due to old code
2025-07-29 15:01:31 +02:00
Theo Champion
ac94e9e937 fix(player init): deleted old init_player function in favor of the new
one
2025-07-29 13:33:58 +02:00
Theo Champion
9c710c13e3 fix: removed stash conflict 2025-07-29 13:33:04 +02:00
Theo Champion
1626b1d9da fix(hooks): Reworked keypresses events
Keypresses (along with keyreleases) events are now using booleans, a
function in the game loop will apply various changes as the key are
pressed. By default every boolean are set to false
2025-07-29 12:33:58 +02:00
Theo Champion
fa3cb8da4a fix(player): reworked angles for player and added player initialization 2025-07-29 12:29:59 +02:00
Theo Champion
6c5a15915f removal: commented old raycaster loop 2025-07-29 12:13:05 +02:00
Theo Champion
5161bc4e49 feat(maps): added new map for easier testing of the raycaster 2025-07-29 12:12:12 +02:00
d856a10ffc
feat: calculate distance to first horizontal line 2025-07-29 12:02:25 +02:00
76fba8fd8a
feat: player coordinate are at the center of a tile 2025-07-29 12:01:39 +02:00
15de3cc857
feat: add utility function to convert coordinates from global to local space 2025-07-29 10:32:01 +02:00
b53fa93377 feat: separate utility functions for cardinal and intercardinal directions 2025-07-28 15:28:26 +02:00
8fd70cb18a feat: utility func to get cardinal direction from angle 2025-07-28 15:26:28 +02:00
dd82d902a5 feat: draw view cone (without DDA) 2025-07-28 15:26:28 +02:00
b6ac8867e5 feat: send single ray 2025-07-28 15:26:28 +02:00
c19b4087b9 feat: draw view cone (without DDA) 2025-07-28 15:17:04 +02:00
805ddbab0b feat: send single ray 2025-07-28 15:17:04 +02:00
Theo Champion
ff07c5cea1 feat(player init): Set the right angle depending on the letter on the map 2025-07-28 11:58:34 +02:00
Theo Champion
17768e24ae fix(README): fixed typo 2025-07-25 15:06:06 +02:00
Theo Champion
0ce0ea78ee fix: renamed ANGLE_SPEED to ROTATION_SPEED 2025-07-25 15:06:06 +02:00
Theo Champion
38feba022f fix: added angle.c to the compilation chain 2025-07-25 15:06:06 +02:00
Theo Champion
ca82add75f fix: created angle.c and moved part of the movement to comply with norme 2025-07-25 15:06:06 +02:00
Theo Champion
6f25b4e530 feat: added angle support 2025-07-25 15:06:06 +02:00
Theo Champion
300f5c2e19 chore: added libmath to compilation command 2025-07-25 15:06:06 +02:00
Theo Champion
bcb7f5dcd6 doc: added some documentation for angles 2025-07-25 15:06:06 +02:00
3c12c1594e fix: give error for trailing chars after map
https://www.notion.so/Pas-d-erreur-detect-pour-une-map-avec-des-characters-apres-la-map-239551de06f480bc8f07e3fbe844ecd7?v=233551de06f480718417000cf26e3225&source=copy_link
2025-07-25 15:06:06 +02:00
3543807548 fix: give error for trailing chars after map
https://www.notion.so/Pas-d-erreur-detect-pour-une-map-avec-des-characters-apres-la-map-239551de06f480bc8f07e3fbe844ecd7?v=233551de06f480718417000cf26e3225&source=copy_link
2025-07-24 12:42:06 +02:00
2d3d614ab3 tests: add a script to quickly run the program through all bad maps
https://www.notion.so/Tests-automatique-pour-les-bad-maps-239551de06f48087a5d3da952ddfc296?v=233551de06f480718417000cf26e3225&source=copy_link
2025-07-23 13:20:35 +02:00
Theo Champion
4b861f77ea fix: Used the right free function for the split
My bad I used free_map() but I should've used free_tab() I must've been
tired or something.
2025-07-23 12:27:49 +02:00
Theo Champion
279d155701 fix: removed useless NULL checks as demanded 2025-07-23 12:27:49 +02:00
Theo Champion
af8b63b0ca fix(texture setting): Fixed leak when map starts before all textures are set 2025-07-23 12:27:49 +02:00
Theo Champion
a67010b929 fix(setters): added a tiny bit of security when freeing data 2025-07-23 12:27:49 +02:00
7449450c52
style: use constants for window width and height 2025-07-22 12:51:07 +02:00
6aecc3ba6e
style: use a constant for error message length
relates to, but does not full resolve:

https://www.notion.so/Constante-Magique-dans-le-code-233551de06f480ef9687fa3d711db137?v=233551de06f480718417000cf26e3225&source=copy_link
2025-07-22 12:39:29 +02:00
Theo Champion
d7ca150c74 fix: Changed return type of set_color() and converted types for colors 2025-07-22 12:21:57 +02:00
Theo Champion
4b2f671107 norm: fixed all the norme issues in the perform_color_checks() function 2025-07-22 12:12:07 +02:00
Theo Champion
c495547a70 fix: redid all the checks for the color
- checks if it has less or more than 3 fields
- checks if it's only digits
- checks if it's between 0 and 255
2025-07-21 17:26:14 +02:00
Theo Champion
ea8d3e085a fix: fixed malformed test map file 2025-07-21 15:57:58 +02:00
8d3746dd53
feat(map parsing): show error if same texture directive is given twice
https://www.notion.so/Logic-error-leak-when-multiple-identical-texture-directives-are-given-233551de06f4806f8552ce4877a7757d?v=233551de06f480718417000cf26e3225&source=copy_link
2025-07-21 15:30:53 +02:00
3e28da1fcf
refactor: put all populate_map related code in that file 2025-07-21 15:30:53 +02:00
Theo Champion
b564311851 fix(Makefile): fixed rule to make the MinilibX compile 2025-07-21 13:47:43 +02:00
Theo Champion
141db7ab2d test: Added a bad map where a color is missing 2025-07-21 13:38:16 +02:00