未登录,请登录后再发表信息
最新评论 (0)
播放视频

MIT解释:电子游戏是怎样做出来的?

MIT Explains: How To Make a Video Game

[电子游戏声效]
[VIDEO GAME SOUNDS]
卡梅罗:是我 卡梅罗
CARMELO: It’s me, Carmelo.
电子游戏很有趣
Video games are fun to play but have you
但是你有没有想过自己做一个游戏?
ever wanted to make one yourself?
我怎样才能让一个人物仅仅通过几个按键
How can I make a character run and jump on the screen,
就能奔跑 跳跃呢
just by pressing some keys?
正如那些网站和你手机里的应用
Just like websites or the apps on your phone,
电子游戏也不过是电脑程序
video games are just computer programs.
我们通过给予电脑或者电子游戏机指令
We make them by giving instructions to a computer
来制作游戏
or to a video game console.
这些指令会被存储在
And these instructions can be stored
你的电脑硬盘甚至只读光盘里
in your laptop hard drive or even in a CD-rom.
然后像让一个人物出现在屏幕上
And there are things like make a character appear
这种事便得以实现
in the middle of a screen.
或者当玩家按下↑键时
Or when the player hits the up arrow key,
这个人物会跳起来
make the character jump.
当我们给另一个人下达指令时
When we want to give instructions to another person,
我们会用人类的语言(比方说英语 意大利语等)
we use a human language like English or Italian.
但不幸的是 我们没法这样和电脑沟通
But unfortunately, we cannot speak to a computer the same
因为现在电脑只能理解
way because for now, computers can only understand simple
简单的指令
instructions.
而且他们过分讲究我们表达事物的方式
And they’re very picky about the way we word things.
为了给一台电脑下达指令
In order to give instructions to a computer,
我们需要编程语言
we need a programming language.
和人类的语言类似
Just like human languages, programming languages
编程语言之间区别也会很大
can be very different from each other.
很多编程语言依赖于文本
Many rely on text so programmers can
因此程序员通过文字给电脑下达指令
write words that give instructions to a computer.
比方说 我想制作一个角色在屏幕上移动的
Let’s say I wanted to create a very simple video
简单的电子游戏
game where a character moves around the screen.
首先我要做的就是告诉我的电脑
One of the first things I need to tell the computer
当我按下某个按键时 这只猫向上移动
is that when I hit a certain key, the cat goes up.
如果我想用python编程语言
If I want to use the Python programming language,
我可以这样写指令
I could write the instructions like this.
这种语言可能看起来陌生
This language looks foreign but actually,
但它其实并不复杂
it’s not that complicated.
比如这里 我想说的是
For example, here is where I say that whenever
每当电脑侦测到有按键被按下时 如果那个按键是↑
the computer detects any key press, if the key is the up
那么就移动我们的猫咪
arrow key, it is to move the player, our cat, 0
横坐标不变 纵坐标向上5个像素
pixels horizontally, and five pixels up.
为了让电脑理解这个说明 我用了python语言
To understand the directions I just gave it in Python,
电脑会将他们翻译成
the computer translates them into many more simpler
更简单的指令
instructions.
最终
Eventually, these instructions get
这些语言被翻译成机器语言
translated into machine language, whose alphabet
所有指令都变成了0和1的组合
is made of zeros and ones.
电脑的“大脑” 中央处理器
The processor, which is the computer brain,
能够理解并执行机器语言
can understand and execute machine language
反馈给屏幕正确的图像
sending back the right graphics to the screen.
即便是移动5个像素这样简单的命令
Even a simple instruction like move up five pixels,
也会被翻译为包括了成千上万的
gets translated into hundreds or thousands
简单指令的机器语言
of simpler instructions in machine language
这样电脑才能理解并回复指令
before the computer can understand and respond.
所有的一切不到一秒就能完成
And all these happen in fractions of a second.
其他的编程语言
Other programming languages, like Scratch
比方说由麻省理工大学媒体实验室开发的Scratch
which is developed here at the MIT Media Lab,
都是可视化编程语言
are visual programming languages.
Scratch不用文字
Instead of using words, in Scratch
而是可以通过拖拉这些方块
you can drag and drop blocks together
来在屏幕上实现一些操作
in order to make something happen on the screen.
比方说 我希望让一只猫四处移动
For example, if I want to move a cat around,
我可以这么做
I would do something like this.
如果我想要我的猫咪向上移动5个像素
So if I wanted my cat to go up five pixels in Scratch,
通过Scratch语言 我可以把两个方块像这样拖在一起
I would snap together two blocks like this.
用← → ↓ 箭头也可以实现同样的效果
And I can do the same with the left, down, and right arrow keys.
同样地 我可以运行这些指令
Also, I can play with instructions
比如 当我点击这只猫时
and I can say that when I click on the cat,
他的颜色会改变
I can change its color.
同样地 我可以让他
And also, I can make him–
喵喵叫
[MEOW]
太空入侵者这类游戏看起来简单 但实则未然
A game like Space Invaders looks simple, but it’s not.
他包含着类似于我们刚刚编写的程序 从而回应玩家的动作
It includes player movement, like what we programmed before.
但也存在自主行动的角色 音乐 音效
But also characters moving by themselves, music and sounds,
射击 碰撞 保持记录
shooting, collisions, keeping score, and that’s
而这些正是编程的有趣之处
where programming gets interesting.
让某个事物移动5个像素
Making something move up five pixels
可能听上去不那么有意思
may not sound very exciting, but basic instructions
但诸如此类的指令是
like this one are the building blocks
你制作电子游戏的奠基石
you can use to create your own video games.
当你要制作
What kinds of instructions would you
像是俄罗斯方块 愤怒的小鸟 我的世界 这样的记忆游戏时
use to create something like a memory game, Tetris, Angry
你需要使用怎样的指令?
Birds, Minecraft?
专业的电子游戏也许会包含数以万计的指令
A professional video game might have millions of instructions
这些指令由很多人一起编写
written by lots of people all working together
从而让游戏诞生
to bring the game to life.
人类语言是有语法和基本词汇的
Human languages have grammar and basic words
我们可以通过将语法和词汇结合
you can combine together to create things
来创作故事 小说 诗歌等
like stories, novels, poems.
同样地
In the same way, programming languages
编程语言也有自身的语法和基本指令
have grammar and basic instructions
你可以通过两者的结合
you can combine together to create
来制作电子游戏 甚至动画 模拟软件
not only video games but also, animation, simulations,
交互式小说等等
and interactive stories.
诸如Scratch的编程语言
And video programming languages like Scratch,
为任何一个想要学习编程的人提供了便利
make it easier for anyone to learn how to program.
因此 你现在可以自己制作电子游戏 而不仅仅是玩电子游戏
So instead of just playing video games, now you can make them.
所以去做一个吧
So go make one.

发表评论

译制信息
视频概述

介绍如何制作电子游戏,风格有趣,简单易懂。

听录译者

收集自网络

翻译译者

lLlLl

审核员

Ah~Qiu

视频来源

https://www.youtube.com/watch?v=Ex1ktxOxVgI

相关推荐
日食