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, oncorrect = self.oncorrect, room = room } install(self, room, x, y) end m.mousepressed = window.portal("keypad") return m