def keys(self): ctrl = osl.Controller() if ctrl.held_down: self.mickey.y += 2 if ctrl.held_up: self.mickey.y -= 2 if ctrl.held_left: self.mickey.x -= 2 if ctrl.held_right: self.mickey.x += 2 for i in xrange(24, 121, 16): if ctrl.analogX > i: self.mickey.stretchX += 1 if ctrl.analogY > i: self.mickey.stretchY += 1 if ctrl.analogX < -i: self.mickey.stretchX -= 1 if ctrl.analogY < -i: self.mickey.stretchY -= 1 if ctrl.held_square: self.mickey.stretchX += 1 self.mickey.stretchY += 1 if ctrl.held_circle: self.mickey.stretchX -= 1 self.mickey.stretchY -= 1 if ctrl.pressed_cross: osl.setBilinearFilter(1) if ctrl.pressed_triangle: osl.setBilinearFilter(0) if ctrl.held_R: self.mickey.angle -= 2 if ctrl.held_L: self.mickey.angle += 2 if ctrl.pressed_start: osl.doQuit()
def keys(self): ctrl = osl.Controller() if ctrl.pressed_down and self.layers > 0: self.layers -= 1 if ctrl.pressed_up and self.layers < 8: self.layers += 1 if ctrl.pressed_left: self.layers = 0 if ctrl.pressed_right: self.layers = 8 for i in xrange(32, 121, 48): if ctrl.analogX > i: for j in xrange(8): self.maps[j].scrollX += j + 1 if ctrl.analogX < -i: for j in xrange(8): self.maps[j].scrollX -= j + 1 if ctrl.pressed_square: self.music.play(-1) if ctrl.pressed_circle: self.key.play(1) if ctrl.pressed_cross: self.jump.play(2) if ctrl.pressed_triangle: self.music.stop() if ctrl.pressed_R: self.music.play(0) if ctrl.pressed_start: osl.doQuit()
def keys(self): ctrl = osl.Controller() if ctrl.pressed_down and self.layers > 0: self.layers -= 1 if ctrl.pressed_up and self.layers < 8: self.layers += 1 if ctrl.pressed_left: self.layers = 0 if ctrl.pressed_right: self.layers = 8 for i in xrange(32, 121, 48): if ctrl.analogX > i: for j in xrange(8): self.maps[j].scrollX += j + 1 if ctrl.analogX < -i: for j in xrange(8): self.maps[j].scrollX -= j + 1 if ctrl.pressed_square: self.music.play(-1) if ctrl.pressed_circle: self.key.play(1) if ctrl.pressed_cross: self.jump.play(2) if ctrl.pressed_triangle: self.music.stop() if ctrl.pressed_R: self.music.play(0) if ctrl.pressed_start: osl.doQuit()
def run(self): while not osl.mustQuit(): osl.startDrawing() osl.drawGradientRect( 0, 0, 480, 272, osl.RGB(0, 0, 128), osl.RGB(0, 0, 128), osl.RGB(0, 255, 255), osl.RGB(0, 255, 255) ) self.keys() for i in xrange(8): if self.layers > i: self.maps[i].drawSimple() self.text() osl.endDrawing() osl.syncFrame() osl.audioVSync() osl.endGfx() osl.doQuit()
def run(self): while not osl.mustQuit(): osl.startDrawing() osl.drawGradientRect(0, 0, 480, 272, osl.RGB(0, 0, 128), osl.RGB(0, 0, 128), osl.RGB(0, 255, 255), osl.RGB(0, 255, 255)) self.keys() for i in xrange(8): if self.layers > i: self.maps[i].drawSimple() self.text() osl.endDrawing() osl.syncFrame() osl.audioVSync() osl.endGfx() osl.doQuit()