Clu Clu Land

Clu Clu Land (World).nes

Secrets

9 Lives

At the 1 Player/2Players menu, hold on controller 2, Right, A & B and press either A or B on controller 1 to start with 9 lives on 1 or 2 players mode.

Recreation

python3

https://github.com/chadfraser/CluGame

A recreation of Clu Clu Land for the NES, made in pygame

Custom a level

HORSE = BoardOneLevel([], [],
                      [(4, 1), (7, 1), (3, 2), (5, 2), (6, 2), (8, 2), (5, 3), (6, 3), (4, 5), (7, 5), (3, 6), (5, 6),
                      (6, 6), (8, 6), (4, 7), (5, 7), (6, 7), (7, 7)],
                      [(4, 1), (5, 1), (7, 1), (8, 1), (3, 2), (9, 2), (3, 3), (9, 3), (3, 4), (5, 4), (7, 4), (9, 4),
                      (3, 5), (6, 5), (9, 5), (4, 6), (8, 6)])
SMELL = BoardOneLevel([], [],
                      [(5, 3), (3, 5), (3, 6), (6, 6), (3, 7)],
                      [(3, 2), (4, 2), (5, 2), (6, 2), (3, 3), (4, 3), (6, 3), (3, 5), (5, 5), (6, 5), (7, 5), (4, 6),
                      (5, 6), (7, 6)])

java
https://github.com/chadfraser/CluGame-Java
A Java port of chadfraser’s pygame recreation of Clu Clu Land for the NES

pygame controller part (WIP)

PyGame 如何让USB控制器/手柄与Python一起工作

检测已连接手柄数量

import pygame

pygame.joystick.init()
joystick_count = pygame.joystick.get_count()

print("Detected {} USB controllers/gamepads".format(joystick_count))

获取手柄输入并打印按钮状态

import pygame

pygame.init()
pygame.joystick.init()
joystick = pygame.joystick.Joystick(0)
joystick.init()

axes = joystick.get_numaxes()
buttons = joystick.get_numbuttons()

while True:
    for event in pygame.event.get():
        if event.type == pygame.JOYAXISMOTION:
            for i in range(axes):
                axis = joystick.get_axis(i)
                print("Axis {} value: {:.2f}".format(i, axis))
        elif event.type == pygame.JOYBUTTONDOWN:
            for i in range(buttons):
                button = joystick.get_button(i)
                print("Button {} value: {}".format(i, button))
/* 测试按键 */
B → 0
A → 1
Select → 8
Start → 9
left/right → axis 0
up/down → axis 1

手柄控制角色移动

Program Arcade Games With Python And Pygame | Chapter 10: 控制器和图形