cp2025 計算機程式

  • Home
    • SMap
    • reveal
    • blog
  • About
    • cs101
    • Computer
      • llama
      • nginx
    • AI
      • QandA
      • Teams
    • Homework
  • Topics
    • Git
      • Git_ex1
      • Git_ex2
    • Python
      • SE
      • CL
      • Loops
      • Recursion
      • SA
      • SST
      • Maze
      • Collect
      • GT
      • Python_ex1
    • Javascript
      • HTML and CSS
    • Project
      • Waitress
      • API
  • Brython
    • Brython_ex
    • Robot_ex
  • Ref
    • Reeborg
      • ex1
      • Otto_ninja
    • tkinter
    • Pyodide
    • Pyodide_ex
    • Pyodide2
      • robot.py
      • Example2
    • Pyodide3
      • png_files
      • Harvest
png_files << Previous

Harvest

Pyodide3 在頁面中導入 robot_w_world.py 後,可以透過 pyodide3_harvest_ex1.py 繼承 robot 物件,加入農作物採收功能。

但因為 robot_w_world.py 版本中的 trace 繪製圖層並未獨立,除了採收農作物之後的座標背景會從 pale_grass.png 置換為 grass.png 外,農作物採收後的座標畫面刷新會一併將之前的機器人行走路徑刪除,因此後續版本必須將所有不同屬性的圖像,以各自的獨立圖層進行繪製,才不會互相影響下,產生錯誤的機器人農作物採收模擬。

在 Pyodide3 執行 pyodide3_harvest_ex1.py,執行結果。


png_files << Previous

Copyright © All rights reserved | This template is made with by Colorlib