summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-09-23Refactor 2: remove permutating functions from game_keys to game_loopOxore
2019-09-23Refactor game state machine 1Oxore
Bring most of transition calls up to the top level switch-case statement.
2019-09-22Add playground target, refactor Makefile's clean-ish rulesOxore
2019-08-13Add const qualifiers to some painter functionsOxore
2019-08-06Bring dependency on libf8 to painter module onlyOxore
2019-08-03Implement json parser for textsOxore
2019-08-03Destroy over_wait_tick sfClock at main cleanupOxore
2019-07-28Make game states exclusive trough one enum var onlyOxore
2019-07-28Refactor idlist, move all global vars to local scopeOxore
- Replace list_foreach with LIST_FOREACH macro. - Remove `game` global variable and make it local everywhere. - Move global vars `fld`, `nxt` and `texts` into `game` struct. - Add `static` qualifier to engine.c's specific global vars. - Move `sfRenderWindow window` global var to local scope
2019-01-03Move unicode module to separate library lib8Oxore
2018-12-07Add test for utf8to32_strcpyOxore
2018-12-07Fix lines longer than 80 chars, fix codestyle.plOxore
codestyle.pl: limit to `src` and `include` dirs only.
2018-12-06Implement "game over" state (scene)Oxore
Also rename arrKeys variable to keys.
2018-12-06Add simple documentation in comments, refactor.Oxore
Change all `unsigned int` and `unsigned long` types to `size_t`. Fix names alignment in headers. Add documentation and simple description: Painter - painter.h Main - tetris.c Unicode - unicode.h IDList - idlist.h Engine - engine.c Minor changes: tetris.c - fix indentation and code blocks separation with newlines, remove unused includes. idlist.h - fix structure field name alignment. field.h, engine.c - define aliases for ghost and active shapes indexes in the field. engine.c - rename menuTick to snake case, fix curly braces style of functions. Makefile - switch SFML deprecated warnings off.
2018-07-14Add utf8_strlen tests, refactor unicode moduleOxore
2018-07-12Introduce testing with munit, refactorOxore
Split unicode routines from text. Testing: add munit submodule, move translation units with main functions to separate folder, make corresponding changes in Makefile. Make simple test for unicode handling routine. Remove _vimrc_local. test.c: optimize includes. Add test run to .travis.yml.
2018-07-12Introduce pause mechanics, refactor a littleOxore
Introduce Pause mechanics and mention it in README.md. Makefile: replace unnecessary "-MMD -MP" with just "-MD" flag, so it allows to compile with tcc too. Refactor: Rename game.isStarted field to game.started field. Move arrKeys container to engine.c and remove it from main.c. Refactor char iterator in utf8to32_strcpy function.
2018-07-11Migrate displayable text to utf32Oxore
2018-07-11Fix start level after gameover, refactor a bitOxore
Set start level to 1 after gameover. Rename function for acquiring current level latency. Remove old font loading in main.c.
2018-07-09Fix scores gaining on hard dropOxore
2018-07-09Fix hard drop when out of field boundaryv0.2.0Oxore
2018-07-09Introduce wall kick, refactorOxore
Refactor controls a little: move key repeat clocks reset to the keys handler. Refactor field: rename rotation function (add "clockwise" postfix).
2018-07-09Introduce hard drop featureOxore
2018-07-09Introduce phantom shape, refactor fieldOxore
Introduce phantom shape feature, yay! Refactor field: rename attribute of invisible empty cells, remove "color" member from struct shape, introduce shape movement functions with embedded collision checking and success reporting,
2018-07-09Finish painter, refactor game logic & keys handlingOxore
Add dependencies in Makefile: now it tracks headers too! Introduce texts in painter. Delegate all the window painting to the painter. Refactor texts from yaml parsing. Remove overcomplicated keymaps and lists of keymaps of... Whatever! Just let em go! Simple idlist with foreach is more than enough. Make displayable values be separate text objects which consists only of a number value that rendered every tick and then displayed. Refactor game logic: make state machine look much obvious with transition functions. Refactor long if-else and switch-case statement chains: replace them with arrays of values (it actually takes more lines of code :P) Refactor keys handling: shorten and separate shape moving code to functions.
2018-07-03Refactor field, refactor next shape drawingOxore
Refactor field functions names. Transfer next shape drawing to painter. Introduce idlist struct with foreach function. Refactor config. Introduce color map array instead of "switch case" statement bloating while coloring rectangles. Decouple field and shape structs from SFML sfVector2 structs by introducing own vector2i and vector2ui structs. Also remove sfRectangleShape members form field an shape structs.
2018-07-02Introduce draw manager, refactor mainOxore
Move timers to struct game. Partially move field painting to draw manager.
2018-06-30Move all field&shape related funcs to field classOxore
2018-06-25Major refactoringOxore
Fix memleak in KeyMap, fix memleak caused by loading a yaml file in main.c. Change Copyright information. Rename functions.c and .h to engine.c and .h. Take field and shape related functions to separate file (still not all of them) and refactor them a lot. Refactor collision detection. Add more warnings. Add sanitizer option commented out.
2018-06-22Set frame rate limitOxore
2017-12-09Implement NES Tetris scoring systemOxore
2017-12-09Level up condition removed lines countOxore
2017-12-09Extend playfield to 22, change game over condition, shrink fld from 25 to 22Oxore
2017-12-09Little refactoringOxore
2017-12-03Change color scheme; add screenshotsOxore
2017-12-02Rearrange includes; replace uint8_t by charOxore
2017-12-02Rename yaml text resource fileOxore
2017-12-02Add PUT_LATENCY threshold and some fixesOxore
2017-12-02Make all text resources load from yaml fileOxore
2017-12-02Apply loading from yaml file for texts in menuOxore
2017-12-02Fix bug with over 15 levelsOxore
2017-12-02Yaml loader for text resources added, need to be involvedOxore
2017-12-01Implement levels! :star2: And refactoring a bitOxore
2017-12-01More structure wrapping, more refactoringOxore
2017-12-01Wrap global variables into structuresOxore
2017-11-30Move includes to root dirOxore
2017-11-30Redefine structures with typedef; A bit of code movementOxore
2017-11-29Change coding styleOxore
2017-11-29Extract some functions in mainOxore
2017-08-02Memleak found&pwnedOxore