zoukankan      html  css  js  c++  java
  • 图形化编程娱乐于教,Kittenblock实例,角色移动,面向方向

    跟很多学生聊过,很多学生不是不努力,只是找不到感觉。有一点不可否认,同样在一个教室上课,同样是一个老师讲授,学习效果迥然不同。关键的问题在于,带入感,我能给出的建议,就是咬咬牙,坚持住,没有学不会的知识。会陆续分享图形化编程的经验,希望能够做成一个专题。如果您觉得有用,就给点个赞吧。涉及的软件包括scratch3.0 (.sb3)、Python、Kittenblock。

    程序解读:角色移动,面向方向

    知识点:运动,控制,面向鼠标,画笔,循环控制

    涉及的软件:scratch3.0 (.sb3)、Python、Kittenblock。

     

    # -*- coding: utf-8 -*-

    import _env, time, random

    from kblock import *

    角色1 = Sprite("角色1")

     

    x = 0

     

     

    角色1.motion_gotoxy(-49, -120)

    角色1.pen_clear()

    while True:

      角色1.pen_penDown()

      角色1.motion_movesteps(10)

      角色1.motion_pointindirection(0)

      time.sleep(1)

      角色1.motion_movesteps(10)

      角色1.motion_pointindirection(90)

      time.sleep(1)

    过程图:

     

     

     

     

    开发计算机创智课程的实践研究
  • 相关阅读:
    web.xml
    web.xml hello1代码分析
    annotation
    injection
    container
    build tool
    version control
    url与uri的区别
    函数式语言
    http协议解析过程
  • 原文地址:https://www.cnblogs.com/ztg1/p/12521889.html
Copyright © 2011-2022 走看看