Skip to content

Commit

Permalink
Some movement problems with pacman fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
HenJi committed Oct 19, 2011
1 parent d682679 commit c7f9b97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/opacman.opa
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ default_game = {
// d
| ({left}, {some=100}) ->
{p with next_dir={right}
base={p.base with dir={left}
base={p.base with dir={right}
cur_step=-p.base.cur_step}}
| (_, {some=100}) -> {p with next_dir={right}}

Expand Down
5 changes: 3 additions & 2 deletions src/pacman.opa
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
if Wall.at(x,y) then on_err
else on_ok
(dir, dx, dy) =
if cur_step != 0 || ignore_incr then (p.base.dir, 0, 0)
if cur_step != 0 then (p.base.dir, 0, 0)
else
do print_infos(g)
(dx, dy) = Base.Dir.deltas(p.base.dir)
Expand All @@ -73,7 +73,8 @@
(dx, dy, dir) =
test_wall((dx,dy,dir), (0,0,{still}),
p.base.pos.x+dx, p.base.pos.y+dy)
(dir, dx, dy)
if ignore_incr then (dir, 0, 0)
else (dir, dx, dy)
pos = {
x = p.base.pos.x + dx
y = p.base.pos.y + dy
Expand Down

0 comments on commit c7f9b97

Please sign in to comment.