Commit graph

30 commits

Author SHA1 Message Date
Corentin Jabot
f385036bee Disable clang-tidy clechs which create false positive in gtest 2021-09-11 09:42:53 +02:00
Corentin Jabot
bc83fa77c3 Fix conversions warnings 2021-09-10 15:04:43 +02:00
Ólafur Waage
55fbb53591 Refactoring Game and GameState. Moving game state update logic into that class. Game is now only event loop. 2021-09-07 16:00:19 +02:00
Patricia Aas
eaf61585ea Fix Clang-Tidy warnings 2021-08-02 16:43:18 +02:00
Patricia Aas
d3cc1d90c7 Fix warnings 2021-08-02 15:28:07 +02:00
Corentin Jabot
d6a046ff47 Use the correct ghost names 2021-07-16 09:35:32 +02:00
Corentin Jabot
691aac978e Get rid of tuple 2021-07-15 09:14:25 +02:00
Patricia Aas
e5e46a0e65 Create GameState 2021-07-08 16:57:18 +02:00
Corentin Jabot
3966987e2a Put the scaling function in a lib 2021-07-08 10:18:36 +02:00
Corentin Jabot
cbd19df739 Implement scaling.
We render pack man at twice the size that we want on screen,
which is the native resolution of the asset file.
The maze is upscaled.
We then project everything onto a view which is applies
the scale factor.

This patches also dectect the appropriate scale on OSX.
This required a bit of objective C (scaling.mm),
but students should not look at this file and there
is a comment in that direction.
Scalling.cpp provides the default implementation
for other platforms.
2021-07-07 21:32:22 +02:00
Patricia Aas
705ea717e1 Introduce a scale function and clean up 2021-07-07 11:25:13 +02:00
Patricia Aas
ce7dd70332 Very rough stab at scaling 2021-07-07 11:25:13 +02:00
Patricia Aas
5c982228c8 More font name fixes 2021-07-06 20:48:29 +02:00
Patricia Aas
30f69464dd Move over to size_t 2021-07-06 12:35:23 +02:00
Corentin Jabot
60095363f4 Put the code in a namespace 2021-07-05 14:10:01 +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
Patricia Aas
7081a33e35 Remove unused includes and reformat 2021-07-02 14:47:33 +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
93186dc8b9 Add ghosts
No movement for now!
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
ecf2ab8b6c Try to make animation less dependant on framerate 2021-06-24 18:33:08 +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
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
75fd208299 Basic Text rendering
Using SDL2_ttf and fmt
2021-06-16 15:18: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