第十一课 可移动的风车 课件(18张PPT)

文档属性

名称 第十一课 可移动的风车 课件(18张PPT)
格式 zip
文件大小 579.5KB
资源类型 教案
版本资源 新世纪版
科目 信息技术(信息科技)
更新时间 2017-12-26 11:14:21

图片预览

文档简介

课件18张PPT。第十一课 可移动的风车 shapes [?e?p]形状——添加移动和旋转GraphicsWindow中的形状
leaf[li:f]叶子/ 叶状的结构—变量
rotate旋转[r???te?t ]
program[?pr??gr?m]程序
delay [d??le?]延迟
add[?d]增加
base[be?s]基础
Program.Delay(milliSeconds)
程序延迟多少毫秒
了解单词的意思leaf=Shapes.AddRectangle(200,10) 在图形窗口添加一个 200, 10的 , 为leaf 把图形leaf (200,200)处高实心矩形图形取名Shapes.Move(leaf,200,200)移到宽 画一个不断旋转的风车叶一、Shapes对象注意:若用GraphicsWindow.FillRectangle(200,10),只是画图,但不能旋转对象名操作名p10leaf=Shapes.AddRectangle(200,10)
Shapes.Move(leaf,200,200)
i=1
While "true"
Shapes.Rotate (leaf,i)
i=i+1
EndWhile P50-51表格中程序设条件为真时,无限循环将图形leaf 到i度的位置旋转 增加1度旋转的角度控制风车旋转的速度二、Program对象Program.Delay(milliSeconds)
程序延迟多少毫秒leaf=Shapes.AddRectangle(200,10)
Shapes.Move(leaf,200,200)
i=1
While "true"
Shapes.Rotate (leaf,i)
Program.Delay(5)
i=i+1
EndWhile P51-52找出此程序与P50-51
程序的异同Program.Delay(5)Delay/di’lei/为延迟把程序延迟5毫秒执行 叶片坐标(200,200) 基底坐标(290,200)90100P52画风车leaf=Shapes.AddRectangle(200,10)
GraphicsWindow.BrushColor="green"
base=shapes.AddRectangle(20,130)
Shapes.Move(leaf,200,200)
Shapes.Move(base,290,200)
GraphicsWindow.MouseDown=onKD
While "true"
Shapes.Rotate (leaf,i)
Program.Delay(5)
i=i+1
EndWhile base(底座)添加一个实心矩形取名为leaf(叶片)按下鼠标则执行onKD子程序叶片旋转i度延迟5毫秒后,转1度设置叶片与底座的起始坐标Sub onKD
x=GraphicsWindow.MouseX
Y=GraphicsWindow.MouseY
Shapes.Move(leaf,x-100,y)
Shapes.Move(base,x-10,y)
EndSubleaf=Shapes.AddRectangle(200,10)
GraphicsWindow.BrushColor="green"
base=shapes.AddRectangle(20,130)
Shapes.Move(leaf,200,200)
Shapes.Move(base,290,200)
GraphicsWindow.MouseDown=onKD
While "true"
Shapes.Rotate (leaf,i)
Program.Delay(5)
i=i+1
EndWhile
Sub onKD
x=GraphicsWindow.MouseX
Y=GraphicsWindow.MouseY
Shapes.Move(leaf,x-100,y)
Shapes.Move(base,x-10,y)
EndSub 点击鼠标,风车的中心将移到鼠标点击的位置P53试一试 1.将完整的风车程序输入电脑运行,点击鼠标移动风车。
2.修改程序中Program.Delay的参数,控制风车旋转的速度。
3.修改程序,改变风车的背景的颜色。leaf=Shapes.AddRectangle(200,10)
GraphicsWindow.BrushColor="red"
base=shapes.AddRectangle(20,130)
Shapes.Move(leaf,200,200)
Shapes.Move(base,290,200)
GraphicsWindow.MouseDown=onKD
GraphicsWindow.BackgroundColor="pink"
While "true"
Shapes.Rotate (leaf,i)
Program.Delay(1)
i=i+1
EndWhile
Sub onKD
x=GraphicsWindow.MouseX
Y=GraphicsWindow.MouseY
Shapes.Move(leaf,x-100,y)
Shapes.Move(base,x-10,y)
EndSub改颜色与速度P53试一试 修改风车大小,点击鼠标,随机地改变风车的背景色。leaf=Shapes.AddRectangle(200,10)
GraphicsWindow.BrushColor=GraphicsWindow.GetRandomColor( )
base=shapes.AddRectangle(20,130)
Shapes.Move(leaf,200,200)
Shapes.Move(base,290,200)
GraphicsWindow.MouseDown=onKD
GraphicsWindow.BackgroundColor=GraphicsWindow.GetRandomColor( )
While "true"
Shapes.Rotate (leaf,i)
Program.Delay(1)
i=i+1
EndWhile
Sub onKD
x=GraphicsWindow.MouseX
Y=GraphicsWindow.MouseY
Shapes.Move(leaf,x-100,y)
Shapes.Move(base,x-10,y)
EndSub 修改风车、基底大小(宽、高各增加20),点击鼠标,随机地改变风车、基底及背景色。leaf=Shapes.AddRectangle(220,30)
GraphicsWindow.BrushColor=GraphicsWindow.GetRandomColor( )
base=shapes.AddRectangle(40,150)
Shapes.Move(leaf,200,200)
Shapes.Move(base,290,200)
GraphicsWindow.MouseDown=onKD
GraphicsWindow.BackgroundColor=GraphicsWindow.GetRandomColor( )
While "true"
Shapes.Rotate (leaf,i)
Program.Delay(0.5)
i=i+1
EndWhile
Sub onKD
x=GraphicsWindow.MouseX
Y=GraphicsWindow.MouseY
Shapes.Move(leaf,x-100,y)
Shapes.Move(base,x-10,y)
EndSubGraphicsWindow.BrushColor=GraphicsWindow.GetRandomColor( )
leaf=Shapes.AddRectangle(220,30)
GraphicsWindow.BrushColor=GraphicsWindow.GetRandomColor( )
base=shapes.AddRectangle(40,150)
Shapes.Move(leaf,200,200)
Shapes.Move(base,290,200)
GraphicsWindow.MouseDown=onKD
GraphicsWindow.BackgroundColor=GraphicsWindow.GetRandomColor( )
While "true"
Shapes.Rotate (leaf,i)
Program.Delay(0.5)
i=i+1
EndWhile
Sub onKD
x=GraphicsWindow.MouseX
Y=GraphicsWindow.MouseY
Shapes.Move(leaf,x-100,y)
Shapes.Move(base,x-10,y)
EndSub