Closed abixadamj closed 3 years ago
Sorry about that. I started working on an enhanced version where one could define their own transformation using code, so as to give more flexibility. I remember removing boxes at that time (which had hard-coded interactions) so that they could become more versatile, but never completed the work.
You can find some information about what I intended to do here: https://aroberge.gitbooks.io/reeborg-s-world-advanced-world-creation/content/extending/automatic-transformations.html ... however, the code there does not work.
Something like the following seems to work:
def redefine(fn):
def wrapper():
fn()
recording_state = recording(False)
x, y = position_in_front()
if ( RUR.is_pushable("box", x, y) and
RUR.is_obstacle("water", x, y) and
not RUR.is_bridge("bridge", x, y)
):
RUR.remove_obstacle("water", x, y)
RUR.remove_pushable("box", x, y)
RUR.add_decorative_object("water", x, y)
RUR.add_object("bridge", x, y)
recording(True)
RUR.record_frame()
return wrapper
move = redefine(move)
RUR.add_pushable("box", 2, 1) RUR.add_obstacle("water", 3, 1) move() move() move()
= = = For sokoban, simply using RUR.add_pushable("box", x, y) should work.
@aroberge - SUPER !!!!!
It WORKS
In documentation there is a Box - https://reeborg.ca/docs/en/reference/objects.html used in Sokoban excerise. But in obstacles there is no Box... @aroberge - do you know maybe something about it?