zoukankan      html  css  js  c++  java
  • 图形化编程娱乐于教,Kittenblock实例,角色猫解读大叔的舞蹈

    图形化编程娱乐于教,Kittenblock实例,大叔的舞蹈

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

    程序解读:角色舞蹈,角色解读

    知识点:音乐效果。

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

    程序效果图!

    图1:角色猫

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

    import _env, time, random

    from kblock import *

    角色猫 = Sprite("角色猫")

    大叔跳舞 = Sprite("大叔跳舞")

    x = 0

    while True:

      角色猫.looks_nextcostume()

      角色猫.looks_sayforsecs("这是真正的舞蹈!", 0.5)

      角色猫.looks_changeeffectby(1)

      time.sleep(0.1)

    图2:大叔

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

    import _env, time, random

    from kblock import *

    角色猫 = Sprite("角色猫")

    大叔跳舞 = Sprite("大叔跳舞")

    x = 0

    while True:

      大叔跳舞.looks_nextcostume()

      time.sleep(0.1)

      大叔跳舞.looks_changeeffectby(1)

    图三:舞台

    程序代码解读:

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

    import _env, time, random

    from kblock import *

    角色猫 = Sprite("角色猫")

    大叔跳舞 = Sprite("大叔跳舞")

    x = 0

    while True:

      Stage.looks_changeeffectby(1)

      Stage.music_playDrumForBeats(11, 0.25)

      Stage.music_playDrumForBeats(10, 0.25)

      Stage.music_playDrumForBeats(13, 0.25)

      Stage.music_playDrumForBeats(1, 0.25)

      Stage.music_playDrumForBeats(3, 0.25)

      Stage.music_playDrumForBeats(9, 0.25)

    开发计算机创智课程的实践研究
  • 相关阅读:
    poj2392 Space Elevator(多重背包问题)
    poj1703 Find them, Catch them(并查集的应用)
    HDU 1867 A + B for you again(KMP算法的应用)
    HDU 1358 Period(kmp简单解决)
    nyoj 460 项链 (区间dp)
    Python内置函数(9)——callable--转载
    Python的hasattr() getattr() setattr() 函数使用方法详解--转载
    python assert 断言详细用法格式
    sam文件格式
    Linux中重定向--转载
  • 原文地址:https://www.cnblogs.com/ztg1/p/12340478.html
Copyright © 2011-2022 走看看