-
Notifications
You must be signed in to change notification settings - Fork 3
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
It is now possible to step on the goblin to kill it. #5
base: master
Are you sure you want to change the base?
Conversation
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 😄 A few details to tweak and it will be good to go.
@@ -58,7 +58,7 @@ cave_reduce_noise(struct level *l, struct level *tmp) { | |||
unsigned int nwall = 0; | |||
for (iy = -1; iy <= 1; ++iy) | |||
for (ix = -1; ix <= 1; ++ix) | |||
if (l->tile[y + iy][x + ix].type \ |
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.
Already removed on master branch.
return(-1); | ||
} | ||
if (c->x + col < 0 || c->x + col >= COLS) { | ||
if (nx < 0 || nx >= COLS) { |
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.
There was a bug in my code, I should have used MAXROWS
and MAXCOLS
which represent the size of the map instead of LINES
and COLS
which represents the size of the screen.
return(-1); | ||
} | ||
if (tile_is_wall(&(l->tile[c->y + row][c->x + col]))) { | ||
|
||
struct tile const* nt = &l->tile[ny][nx]; |
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.
Even if it's allowed now I would prefer to keep variable declarations at the top of each block.
No description provided.