def play_maze(self): left, right = pro_controller_factory() pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) maze = Maze(375, 100, pwm, left, TURRET_3) maze.play_on()
import Adafruit_PCA9685 from games import MissileDefense from src import pro_controller_factory from src.TURRETS import TURRET_2, TURRET_3, TURRET_4 left_pro, _ = pro_controller_factory() pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) m = MissileDefense(375, 80, pwm, left_pro, TURRET_2, TURRET_3, TURRET_4) m.play_on()
import Adafruit_PCA9685 from games import Maze from src.TURRETS import TURRET_1 from src import pro_controller_factory left, right = pro_controller_factory() pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) maze = Maze(375, 100, pwm, left, TURRET_1) maze.play_on()
import Adafruit_PCA9685 from games import Pong from src.TURRETS import TURRET_1, TURRET_2, TURRET_3 from src import pro_controller_factory # nunchuk_1 = PlayerNunchuk(127, 127, 20, 200, 20, 200) c_1, c_2 = pro_controller_factory() pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) p = Pong(375, 100, pwm, c_1, c_2, TURRET_1, TURRET_3, TURRET_2) p.play_on()
def play_missile_defense(self): left_pro, _ = pro_controller_factory() pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) m = MissileDefense(375, 80, pwm, left_pro, TURRET_2, TURRET_3, TURRET_4) m.play_on()
def play_pong(self): c_1, c_2 = pro_controller_factory() pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) p = Pong(375, 100, pwm, c_1, c_2, TURRET_2, TURRET_4, TURRET_3) p.play_on()
from gpiozero import LED import Adafruit_PCA9685 from src.player import Player from src import PlayerNunchuk, pro_controller_factory from src.TURRETS import TURRET_1, TURRET_2, TURRET_3 # c = PlayerNunchuk(127, 127, 20, 200, 20, 200) c, _ = pro_controller_factory() pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) player_1 = Player(100, 100, pwm, TURRET_1, c, initial_x=375, initial_y=375, x_center=375, y_center=375) player_1.laser.on() while True: x, y = player_1.manual_servo()