22 Commits

Author SHA1 Message Date
jonny_jr9
bc363a9f8b Add playSound(), Reduce debug output - sound on collide works
currently plays sound when snake crashes (leaderboard shown)

- shorten example audio file
- Add sound.c: abstract function to play .wav files
- config:
    - Add config option RENDER_GAME_TO_CONSOLE
    - disable debug output
2023-12-14 18:39:20 +01:00
jonny_jr9
aaf4eb398a Fix bug 'negative values' in GET_TIME_MS() 2023-12-12 17:14:11 +01:00
jonny_jr9
d8952223f4 Add macro GET_TIME_MS() (windows + linux support) 2023-12-12 16:51:30 +01:00
jonny_jr9
4159d4ff17 Update flowchart, Add global SDL variables
- flowchart:
    - update menu.c
    - add notes for menu

- game.c:
    - add SDL variables to game struct,
     so menu.c can also render things to window
2023-12-12 09:52:08 +01:00
jonny_l480
cc4f8f169f Add map rotate and speed change via keys (1, 2 , m) 2023-12-11 12:47:46 +01:00
jonny_jr9
f5a7a90168 Add defaultMap config option 2023-12-10 20:58:18 +01:00
jonny_jr9
72ca020f27 Fix 'redefinition error' on win. - compiles, runs 2023-12-10 18:14:24 +01:00
jonny_jr9
ac5873c9e7 Fix bug SDL-window freezing on windows
apparently SDL window freezes on windows,
when the input events are not repeatedly handled.
2023-12-10 18:03:02 +01:00
jonny_jr9
a56c78e1ee Merge branch 'testing' into dev 2023-12-10 17:05:29 +01:00
Julia09055x
e66567d232 Snake bewegt sich, Fenster wird mit Portal und Food erstellt 2023-12-10 16:52:20 +01:00
jonny_jr9
859b4c99b2 Add default config values, Update px size on map load 2023-12-09 18:28:39 +01:00
Julia09055x
668860a6a0 quadratisches SDL-Fenster öffnet sich 2023-12-09 15:45:06 +01:00
Hanse-14
ae7469f291 add function snakeUpdateHeadPos()
write content of snakeSetHeadPos() in snakeUpdateHeadPos()
snakeSetHeadPos() set head-position via transfer parameters
2023-12-07 15:52:41 +01:00
jonny_jr9
6b29f1360f Fix typos in snake.c - compiles now
- use global variable 'game' from game.h instead of declaring new one
- fix typo wrong variables
- correct move out of map boundary
2023-12-03 21:58:21 +01:00
Hanse-14
dd918c9dec Add functions in snake.c
snakeInit(), snakeGrow(), snakeMove(), snakeSetDir(), snakeIsAlive(),
snakeSetHeadPos()
2023-12-02 13:51:06 +01:00
Julia09055x
b4150a839d Render window 2023-11-23 16:55:16 +01:00
jonny_jr9
d94eed0136 Implement input.c
- Implement input handling in input.c
  - test successful
- Add missing function showPauseScreen to menu.h/c
2023-11-11 14:32:47 +01:00
jonny_jr9
061b4431c7 Implement game.c, food.c and map.c
- Implemented the functions in the above files
 - game and map are partially tested
 - food is extensively tested using the created test-function
- Also added DELAY(ms) macro to common.c
2023-11-11 11:14:38 +01:00
jonny_jr9
71c054f092 Add common.h with LOG macro, Add '#pragma once'
- add conditional logging macro in common.h
- add '#pragma once' to every header file
- fix typo in food.h
2023-11-10 14:38:14 +01:00
jonny_jr9
3e40be47cf Update module structure: Add map.c
=> global config and game struct changed
=> some functions were dropped/moved
- Outsourced data types and functions to map.c / map.h
- Update function and module diagram
- Adjust custom data types in source code
2023-11-10 12:46:00 +01:00
Julia09055x
d92175317d Update all header files 2023-11-09 15:13:10 +01:00
jonny_jr9
7309707a97 Change folder structure (Add folders: src, include)
Add src folder for all .c and include folder .h files
=> clearer structure, no documents mixed into code files
2023-11-08 20:41:21 +01:00