-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add basic tetris to dev #69
base: dev
Are you sure you want to change the base?
Conversation
modules/tetris/Makefile
Outdated
@@ -0,0 +1,7 @@ | |||
# Force format | |||
$(info $(shell astyle --style=allman tetris.c ptetris.h)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it adds a dependency to the ML build system for "astyle", since all modules are built for all cams. I don't really want to do that. If you're volunteering to convert all ML code to be compatible, and then add an astyle dep, that's different! But it also feels like a separate task.
Probably remove this dep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can comment it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Annoyingly, there's an "official" coding style in doc/CODING_STYLE - which even suggests using astyle! But it is very clear this is not followed consistently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if the entire repo was formatted consistently, but that would be too big of a diff and mess with history+branches
|
||
// Max array size | ||
#ifndef PT_MAX_WIDTH | ||
#define PT_MAX_WIDTH 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file uses tabs, the .c uses 4-spaces. 4-spaces is preferred, please convert this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copied directly from my ptetris project, which uses tabs. So I would have to convert the file to spaces every time I update the file. Not a big deal.
Test merge worked. Bugs found:
It's a cool mini-tetris :) |
Some of those issues seem familiar. I've got an updated ptetris.h that I never pushed, I'll add it later |
No idea what I did, unformatted, sorry
- Less screen tearing, but perfect, but playable - Fixed RNG - Fixed block colors - Increased size of play area
Fixed all of the things you mentioned. IMO it's very playable at this point. Could still use some minor improvement (better visuals, better controls) but for tetris on a DSLR it's not bad :) |
A few notes:
menu_redraw_blocked
is set to1
to prevent tetris rendering to flicker as menu is being drawn.task_create
is called to keep the ML menus in place after the game is quit.