编写一个游戏,第一行代码应该是?

python4-lesson04

Quiz
•
Computers
•
4th - 12th Grade
•
Medium

hang zheng
Used 11+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
pygame.init()
import pygame
import setting
import sprites
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
已知起点坐标是(0,0),终点坐标是(100,100),现在想在起点和终点之间画一条红色的线,下列代码正确的是?
pg.draw.line(self.screen,(255,0,0),(0,0),(100,100))
pg.draw.line(self.screen,(255,255,0),(0,0),(100,100))
pg.draw.line(self.screen,(255,0,0),(100,100),(100,100))
pg.draw.line(self.screen,(255,255,0),(100,0),(0,100))
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
keys=pg.key.get_pressed()
返回的是一个元组,如果这个元组中的元素全部都是0,则表示?
此时键盘上的每一个按键都被按下了
键盘失灵了
此时键盘上有些键被按下,有些键没被按下
此时键盘上所有的按键都没有被按下
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
keys=pygame.key.get_pressed()
当电脑玩家按下了w键,那么keys中的哪个元素会发生变化,变成多少?
keys[pygame.K_w] 变成0
keys[pygame.K_w] 变成1
keys[pygame.K_UP] 变成0
keys[pygame.K_UP] 变成1
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
今天学习的游戏编程中,setting.py这个文件的主要作用是?
进行游戏参数的设置(屏幕宽度高度,颜色),给主程序使用
编写主程序的地方
编写各个角色类的地方
嗯?我们今天有写过这个文件吗?
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
pygame中的游戏退出事件是?
pygame.exit()
pygame.KEYUP
pygame.QUIT()
pygame.QUIT
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
今天我们在Game类中编写了一个new()方法,用来创建各种角色类的实例,请问这个new方法在整个游戏程序中需要执行几次?
每一帧都要执行
每一秒都要执行
只执行1次
不需要执行
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
统考电脑上册(29/9)

Quiz
•
12th Grade
20 questions
六年级信息与通信技术

Quiz
•
6th Grade
10 questions
顺序结构复习

Quiz
•
10th Grade
11 questions
和平精英

Quiz
•
1st - 12th Grade
10 questions
11302_04_程式概念(01)

Quiz
•
7th Grade
20 questions
111學年度-資訊科技對我們的影響

Quiz
•
7th Grade
20 questions
以伪代码与流程图表示算法

Quiz
•
4th - 5th Grade
12 questions
J06 文书处理

Quiz
•
7th Grade
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade
Discover more resources for Computers
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
12 questions
Dividing Fractions

Quiz
•
6th Grade
9 questions
1. Types of Energy

Quiz
•
6th Grade