So I've got a load of rooms as objects, and in said rooms are items (also objects) that I can store. Pretty straight forward so far..
Now I want to move the player around rooms, so I figured the easiest thing to do is to assign a current room variable, for example:
Code: Select all
$ current_room = bedroomCode: Select all
$ current_room.addItem(item)
$ current_room.removeItem(item)In trying to resolve this, I've tried moving the initial object creation code in and out of init blocks, as well as init_labels to create the objects during game start - none of which really behaves the way I expected it to when restarting / reloading the game
What I really want, is to have a variable that's able to just point at the relevant rooms, and allow me to manipulate said rooms through it. I've tried looking up variable call to references on google and they all seem to point to variable types int and string etc, not objects.
Could someone please explain what I'm doing wrong please?
Thank you in advance!
kivik
edit: found out that I'd created one of the variables in an init block, which messed up the aliasing!