From c7f9b97d97d6b5811fed209452786f0e532fc89e Mon Sep 17 00:00:00 2001 From: Nicolas Glondu Date: Wed, 19 Oct 2011 03:11:17 +0200 Subject: [PATCH] Some movement problems with pacman fixed --- src/opacman.opa | 2 +- src/pacman.opa | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/opacman.opa b/src/opacman.opa index bdb8965..93527af 100644 --- a/src/opacman.opa +++ b/src/opacman.opa @@ -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}} diff --git a/src/pacman.opa b/src/pacman.opa index cbe604d..799822e 100644 --- a/src/pacman.opa +++ b/src/pacman.opa @@ -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) @@ -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