Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bruno Freitas Tissei
boulder-dash-ASCII
Commits
108e1d6c
Commit
108e1d6c
authored
9 years ago
by
Bruno Freitas Tissei
Browse files
Options
Download
Email Patches
Plain Diff
Empurrar pedras
parent
82c4690c
master
Issue#2
Issue#3
1 merge request
!1
Cuidado do caso de explosao nas bordas do jogo e adicionado movimento de empurrao de pedras
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/maps.c
+2
-2
src/maps.c
src/rockford.c
+8
-0
src/rockford.c
with
10 additions
and
2 deletions
+10
-2
src/maps.c
+
2
-
2
View file @
108e1d6c
...
...
@@ -214,7 +214,7 @@ void renderMap(map *m, int time) {
renderChar
(
ext
,
i
,
j
,
offx
,
offy
,
5
);
break
;
case
(
'5'
):
if
(
player
.
dir
==
4
&&
m
->
grid
[
i
-
1
][
j
]
==
'6'
&&
m
->
grid
[
i
-
2
][
j
]
==
'0'
){
/*
if (player.dir == 4 && m->grid[i-1][j] == '6' && m->grid[i-2][j] == '0'){
m->grid[--player.y][player.x] = '5';
m->grid[i-2][j] = '6';
m->grid[i][j] = '0';
...
...
@@ -223,7 +223,7 @@ void renderMap(map *m, int time) {
m->grid[++player.y][player.x] = '5';
m->grid[i+2][j] = '6';
m->grid[i][j] = '0';
}
}
*/
attron
(
COLOR_PAIR
(
6
));
for
(
k
=
0
;
k
<
3
;
k
++
)
for
(
l
=
0
;
l
<
6
;
l
++
)
...
...
This diff is collapsed.
Click to expand it.
src/rockford.c
+
8
-
0
View file @
108e1d6c
...
...
@@ -22,6 +22,10 @@ void updateRockford(rockford *player, map *m, int action) {
m
->
grid
[
player
->
y
][
player
->
x
]
=
'5'
;
player
->
diamonds
++
;
player
->
score
+=
m
->
score
;
}
else
if
(
right
==
'6'
&&
m
->
grid
[
player
->
y
+
2
][
player
->
x
]
==
'0'
)
{
m
->
grid
[
player
->
y
++
][
player
->
x
]
=
'0'
;
m
->
grid
[
player
->
y
][
player
->
x
]
=
'5'
;
m
->
grid
[
player
->
y
+
1
][
player
->
x
]
=
'6'
;
}
}
else
if
(
action
==
4
)
{
char
left
=
m
->
grid
[
player
->
y
-
1
][
player
->
x
];
...
...
@@ -33,6 +37,10 @@ void updateRockford(rockford *player, map *m, int action) {
m
->
grid
[
player
->
y
][
player
->
x
]
=
'5'
;
player
->
diamonds
++
;
player
->
score
+=
m
->
score
;
}
else
if
(
left
==
'6'
&&
m
->
grid
[
player
->
y
-
2
][
player
->
x
]
==
'0'
)
{
m
->
grid
[
player
->
y
--
][
player
->
x
]
=
'0'
;
m
->
grid
[
player
->
y
][
player
->
x
]
=
'5'
;
m
->
grid
[
player
->
y
-
1
][
player
->
x
]
=
'6'
;
}
}
else
if
(
action
==
2
)
{
char
down
=
m
->
grid
[
player
->
y
][
player
->
x
+
1
];
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help