local window = require('window') local entity = require('entity') local keypad = require('room/keypad') local m = entity:from{ width = 50, height = 50, lines = {'fill', {0, 0, 0, 50, 50, 50, 50, 0}}, code = 45100, } local install = m.install function m:install(room, x, y) self.keypad = keypad:from{ code = self.code, room = room } install(self, room, x, y) end m.mousepressed = window.mousepressed(function (self) set_room_raw(self.keypad) end) return m