Commit graph

256 commits

Author SHA1 Message Date
Theo Champion
8ecc7d3849 dev: changed the base point value of the player for debugging 2025-08-20 17:10:13 +02:00
Theo Champion
761d126ba2 feat(points): Finished point counter on the right of the screen
Some things are temporary, like the load single image function that
still has comments. I'll make a function like this to restore the
original code (almost). I'll also pass the pathes as constants for the
sake of maintainabilty and try to avoid some of the magic values in the
code for the same purpose.
2025-08-20 17:09:56 +02:00
Theo Champion
242cbe3c7c dev: Added a matrix image set function
- Amended for adding support of transparency, works the same as sprites
2025-08-20 16:54:14 +02:00
Theo Champion
70f6a36aad dev: Added width and height texture information 2025-08-20 16:39:39 +02:00
Theo Champion
33f0c4e896 fix: removed trailing BONUS definition 2025-08-20 16:09:21 +02:00
Theo Champion
792d8fc37a feat: Added point counter at the right of the screen (basic) 2025-08-20 15:49:31 +02:00
Theo Champion
4a2b4eb287 fix: Changed the fps counter, switched from a DMA to a static memory allocation 2025-08-20 15:32:57 +02:00
Theo Champion
9ec4a33fc8 dev: Added a ft_itoa_static function to avoid malloc'ing and free'ing every frame 2025-08-20 15:29:33 +02:00
Theo Champion
e8fac75779 dev: Created figures textures 2025-08-20 13:57:47 +02:00
fb4680e4bd
feat: close window and exit on window close event 2025-08-20 13:53:18 +02:00
Theo Champion
0771881690 feat: New texture for the double tap perk machine 2025-08-20 13:43:40 +02:00
Theo Champion
a6c6420398 fix: Used blocking check function instead of rewriting test 2025-08-20 12:49:33 +02:00
Theo Champion
c643d9f22a fix: Fixed inversion of x and y for blocking checks functions 2025-08-20 12:48:48 +02:00
Theo Champion
b138fe8100 fix(sprite caster): Fixed crash when sprites overlap
Actually I'm not that sure it's the sprite overlap but it happened when
the sprites overlapped too close to the player, but basically the
program tried to render pixels out of bounds from the images, tex_x or
tex_y were able to go < 0. I forcefully set them to 0 if it was the
case, and I didn't see really much of visual glitches or something.
Anyways I'll stop rambling in this commit, just to say I stopped a real
weird crash because when I tried using valgrind or sanitizers, the
program would behave well and not crash. Might be tied to how fast the
program renders frames ?
2025-08-19 19:45:00 +02:00
Theo Champion
0ac7c27445 norme: Fixed norme error 2025-08-19 19:13:58 +02:00
Theo Champion
38487527f9 feat: Improved movements for the sprite 2025-08-19 18:58:55 +02:00
Theo Champion
b680e49ef9 feat: Added some credits 2025-08-18 20:05:50 +02:00
Theo Champion
14f178759e feat: finished zombie movements code 2025-08-18 19:52:14 +02:00
Theo Champion
c9fd8ea384 fix: Fixed norme issue 2025-08-18 19:20:33 +02:00
5242679d95
feat: load zombie sprites from map 2025-08-18 13:58:24 +02:00
8445f240a2
feat: basic zombie movement (very bad) 2025-08-18 13:42:47 +02:00
Theo Champion
2fc8cf21a1 fix: fixed segfault when compiling for mandatory part. Fixed bad check 2025-08-18 13:40:01 +02:00
92770f44f8 fix: segfault & leak with missing sprite image 2025-08-18 13:18:12 +02:00
Theo Champion
4568124d3f fix: git merge conflict again 2025-08-18 13:13:42 +02:00
Theo Champion
5c7cc77419 dev: improved how sprites are detected in maps 2025-08-18 13:07:08 +02:00
Theo Champion
ef7a6c27a4 fix: Removed git conflict marker 2025-08-18 13:04:13 +02:00
Theo Champion
541bc9ccf8 dev: Added sprite types and gave 'base' sprites their types 2025-08-14 21:47:21 +02:00
Theo Champion
0ac6ee9394 norme: Fixed little oopsie 2025-08-14 21:47:00 +02:00
Theo Champion
3511b6aaf8 norme: Fixed little oopsie 2025-08-14 21:45:39 +02:00
Theo Champion
01f0ac21df feat: Made a little sprite interaction for perk type sprites
It's more for the sake of the demo but it shows we can make interactions
with sprites. Although it's badly integrated.
2025-08-14 21:41:35 +02:00
Theo Champion
ee329812fd dev: Added sprite types and gave 'base' sprites their types 2025-08-14 21:41:33 +02:00
Theo Champion
0d6cc4063a dev: changed the c var in place_base_sprites to a counter in data struct 2025-08-14 21:38:49 +02:00
Theo Champion
4a70e44697 fix: Added a check for the sprites, to avoid segfaults and/or invalid writes 2025-08-14 21:27:53 +02:00
Theo Champion
94075506f6 fix: Transferred sprite pathes to constants 2025-08-14 21:25:03 +02:00
Theo Champion
412dc89336 fix: Transferred trailing magic error messages as consts 2025-08-14 19:52:34 +02:00
Theo Champion
db66decbf8 fix: removed trailing BONUS definition 2025-08-12 16:18:34 +02:00
Theo Champion
dafe94804e norme: normed everything 2025-08-12 16:15:02 +02:00
Theo Champion
00e8a73d14 dev: improved sprites by creating a create_sprite function 2025-08-12 15:57:27 +02:00
Theo Champion
09ff569a31 feat: made sprites be placed in map file 2025-08-12 15:41:42 +02:00
Theo Champion
04705fe9e5 feat: added temp perk textures and placed perks in testmap_2 2025-08-12 15:40:29 +02:00
Theo Champion
41437ec215 dev: Changed magic values for error messages to constants 2025-08-12 14:49:44 +02:00
Theo Champion
2eb1d635d4 norme: Fixed little norm error 2025-08-12 14:49:11 +02:00
Theo Champion
9988b09e91 dev: Changed allowed characters to comply more about the current state of the game 2025-08-12 14:49:11 +02:00
Theo Champion
f1697a6c73 dev: Improved memory management of sprites 2025-08-12 14:49:11 +02:00
Theo Champion
3230a60c9f fix: Fixed memory leak 2025-08-12 14:49:09 +02:00
Theo Champion
aae5e42b13 fix(main): Bumped calloc for sprites from 3 to MAX_SPRITES and moved it 2025-08-12 14:48:41 +02:00
Theo Champion
b7d56363ab removal(main): Removed sprites initialization in main function 2025-08-12 14:48:15 +02:00
fcb08f6447
fix: various rendering issues
- Correct rendering on whole window if window is not square
- Multiple crashes eliminated
- Sprites no longer lag behind player movement/rotation
2025-08-12 14:34:49 +02:00
98e0119c91
fix: prevent moving through walls in extreme lag situations 2025-08-12 12:16:57 +02:00
Theo Champion
b9b164e32d norm: Fixed norm errors except for comments in main function 2025-08-11 11:03:51 +02:00