Commit graph

147 commits

Author SHA1 Message Date
Corentin Jabot
d166f552f4 Simplify board code 2021-07-05 13:54:54 +02:00
Patricia Aas
7faadda5c0 Remove unused function 2021-07-05 12:18:08 +02:00
Corentin Jabot
727a2c5e76 Create an include 2021-07-05 12:02:36 +02:00
Corentin Jabot
e4991ab1dd Rename PositionInt 2021-07-05 11:47:03 +02:00
Corentin Jabot
ba515eaca5 Replace floats by doubles 2021-07-05 11:40:10 +02:00
Corentin Jabot
b5b9d9c168 Rename ghosts 2021-07-05 11:33:02 +02:00
Patricia Aas
7081a33e35 Remove unused includes and reformat 2021-07-02 14:47:33 +02:00
Patricia Aas
a62d668ead Simplify Ghost::currentSprite 2021-07-01 14:53:52 +02:00
Patricia Aas
0e72ff8be5 Make board a static double std::array 2021-07-01 14:33:59 +02:00
Patricia Aas
fc31086ab9 Initialize timeSinceDeath 2021-07-01 10:19:46 +02:00
Corentin Jabot
b6d0bad21c Fix mac build (again) 2021-07-01 10:19:46 +02:00
Corentin Jabot
a01f93cc90 Fix mac build 2021-07-01 10:19:46 +02:00
Corentin Jabot
5b0e561afc Pacman and ghosts can eat each others 2021-07-01 10:19:46 +02:00
Corentin Jabot
ced6cd829c Put the ghosts in a tuple to reduce duplication 2021-07-01 10:19:46 +02:00
Corentin Jabot
3e84746cee Simplify ghost movement code 2021-07-01 10:19:46 +02:00
Corentin Jabot
c2cfb8c734 Implement ghost movement and scatter behavior
Each ghost is trying to reach a point beyond the
corner of the board, which make them run in circle
2021-07-01 10:19:46 +02:00
Corentin Jabot
93186dc8b9 Add ghosts
No movement for now!
2021-06-24 18:33:08 +02:00
Corentin Jabot
79506d218e Make a ghost pen 2021-06-24 18:33:08 +02:00
Corentin Jabot
a0780c7a8c Display the number of remaining lives 2021-06-24 18:33:08 +02:00
Corentin Jabot
fedbc153ae Implement score 2021-06-24 18:33:08 +02:00
Corentin Jabot
42ee04203f Make pacman mouth wide open while he doesn't move 2021-06-24 18:33:08 +02:00
Corentin Jabot
ecf2ab8b6c Try to make animation less dependant on framerate 2021-06-24 18:33:08 +02:00
Corentin Jabot
a69e66d114 Pacman should not be animated when hitting a wall 2021-06-24 18:33:08 +02:00
Patricia Aas
f51b7d65e0 Reformat and add a gitignore 2021-06-22 13:17:12 +02:00
Patricia Aas
5f0c03c1fa Clang Tidy fixes 2021-06-22 13:17:12 +02:00
Patricia Aas
d4d2e2d00d Fix animation 2021-06-22 13:17:12 +02:00
Patricia Aas
9ca1f6f12d Initialize Event object 2021-06-22 13:17:12 +02:00
Patricia Aas
1fb5f23885 Check optional before it's used 2021-06-22 13:17:12 +02:00
Patricia Aas
4e753a6024 Remove declarations of functions that no longer exist 2021-06-22 13:17:12 +02:00
Patricia Aas
493923036a Make it work on Linux again 2021-06-22 13:17:12 +02:00
Patricia Aas
32886717de Make it work on windows 2021-06-22 13:17:12 +02:00
Patricia Aas
c6191b1f5d Reformat CMakeLists.txt 2021-06-22 13:17:12 +02:00
Corentin Jabot
c7ef086d3d Migrate from SDL to SFML
This simplifies the rendering code and remove all(!) pointers.

There is a number of unresolved issues

* Windows build ?
* position delta computation: migrating to SFML seems to have modified
the frame rate.
2021-06-22 13:17:12 +02:00
Corentin Jabot
f83bf46171 Fix Debug build on ubuntu 2021-06-16 15:59:52 +02:00
Corentin Jabot
98d728fb52 Fix missing header 2021-06-16 15:31:42 +02:00
Corentin Jabot
75fd208299 Basic Text rendering
Using SDL2_ttf and fmt
2021-06-16 15:18:47 +02:00
Corentin Jabot
f911f6e2a8 Eat pellets 2021-06-16 13:59:16 +02:00
Corentin Jabot
2398bf9c36 Fix animation 2021-06-16 13:18:05 +02:00
Corentin Jabot
e16d44cd23 Run clang format 2021-06-16 13:14:47 +02:00
Patricia Aas
68f63f3f66
Canvas rewrite (#6)
* Beginning rewrite

* Move all constants to canvas, wire sprite handling code

* Make Sprite a struct and reformat

* Fix warning

Co-authored-by: Corentin Jabot <corentinjabot@gmail.com>
2021-06-16 12:52:04 +02:00
Corentin Jabot
dad36d7362 Remove comments and unused headers 2021-06-16 09:58:19 +02:00
Corentin Jabot
f6efcbbf79 Support teleporting at the edges of the map 2021-06-16 01:39:37 +02:00
Corentin Jabot
bbf3731cf4 Change window geometry for scoring.
* Add margins all around the board for better aestetics.
* Add room for scoring
* Because the texture atlas is a 32x32 grid, we can manipulate
textures as positions on that grid and only create a rectangle
for that texture in the rendering code.
* Avoid hardcoded values in the rendering code.
2021-06-15 23:55:55 +02:00
Patricia Aas
27b8d47dec Move to pragma once 2021-06-10 14:42:51 +02:00
Patricia Aas
9644229061 Give function a shorter name to fit on a slide :) 2021-06-10 14:26:03 +02:00
Corentin Jabot
335a698226 Replace float_t by float 2021-05-10 15:14:38 +02:00
Corentin Jabot
164db664ef Use VCPKG and reorganization
* Remove non-pacman exercises.
* Use vcpkg instead of conan ( make vcpkg a submodule)
* Merge the readmem these will need to be improve later
2021-05-10 14:58:00 +02:00