找回密码
 中文实名注册
查看: 127|回复: 1

python作业高君儒 实小 603

[复制链接]

1

主题

9

帖子

490

积分

中级会员

Rank: 3Rank: 3

积分
490
发表于 2022-8-13 15:33:33 | 显示全部楼层 |阅读模式
第七单元  第一课  炮弹栈
回复

使用道具 举报

1

主题

9

帖子

490

积分

中级会员

Rank: 3Rank: 3

积分
490
 楼主| 发表于 2022-8-13 15:34:20 | 显示全部楼层
# 获取鼠标坐标
            mouse_position = pygame.mouse.get_pos()
            if storage_rect.collidepoint(mouse_position)and len(ball_list) < 4:
                ball_list.append(ball)
                ball = spaceship.new_ball()
            else:
                #把炮台中的能量球发射出去
                spaceship.fire_ball(ball,mouse_position)   
                #产生一颗新的能量球放到炮台里
                ball = spaceship.new_ball()
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 中文实名注册

本版积分规则

小黑屋|东台市机器人学会 ( 苏ICP备2021035350号-1;苏ICP备2021035350号-2;苏ICP备2021035350号-3 )

GMT+8, 2024-3-29 06:29 , Processed in 0.045987 second(s), 28 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表