Graphical programming and entertainment in teaching, Kittenblock instance, trampoline and music

Graphical programming and entertainment in teaching, Kittenblock instance, trampoline and music

Like many students talked to a lot of students are not hard, but could not find the feeling. One thing is undeniable, the same class in a classroom, a teacher is also teaching, learning different. The key question is, bring a sense of advice I can give is to bite the bullet, hold on, no knowledge will not. We will continue to share experiences of graphical programming, hoping to make a topic. If you find useful, give a point like it. Software covered include scratch3.0 (.sb3), Python, Kittenblock.

Program Interpretation: add special effects on a trampoline, adding music.

Knowledge Point: conditional, ultra-wide-angle lens effects, music effects, loop control.

Software involved: scratch3.0 (.sb3), Python, Kittenblock.

Program renderings!

code:

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

import _env, time, random # Import

from kblock import *

Trampoline = Sprite ( "trampoline") # create a role

x = 0

while True: # Loop Effects

  if trampoline .sensing_touchingobject ( "_ mouse _"): # judgment, if the mouse met

    Trampoline .music_playDrumForBeats (1, 0.25) # ringing snare drum

Trampoline .looks_changeeffectby (-25) # fish-eye effects

time.sleep (0.5) # delay

    Trampoline .looks_changeeffectby (25)

    time.sleep(0.5)

Guess you like

Origin www.cnblogs.com/ztg1/p/12329683.html
Recommended