Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Web Programming - Lesson 4
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ryan Chung
April 10, 2020
Technology
700
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Web Programming - Lesson 4
Ryan Chung
April 10, 2020
More Decks by Ryan Chung
See All by Ryan Chung
MovieBot Development
ryan403
0
350
Design Voice-First Games for Alexa
ryan403
0
99
AI Teaching Talk
ryan403
0
160
Cognitive Service
ryan403
0
130
jQuery & API Practices
ryan403
0
180
CSS Practices
ryan403
1
190
JavaScript Practices
ryan403
0
120
Web Programming - Lesson 6
ryan403
1
700
Web Programming - Lesson 7
ryan403
1
700
Other Decks in Technology
See All in Technology
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
130
バイブコーディングの特徴と「コケて直す」ループ
happysamurai294
0
140
バックオフィスに染み出すTypeScript ── clasp で安全に仕組みを作る
nealle
1
140
AWS Continuum for Penetration Testing に Deep Dive してみる
asanoharuki
2
1.5k
Agent 活用環境の構築・運用のための AWS サービスのご紹介/agentcore-for-building-and-operating-agents
ren8k
1
300
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
210
生き様としてのSRE
hokkai7go
1
140
Technical Project Manager の役割とやりがい、少しだけ AI
yoshiiryo1
0
490
Agent Loopを組み込んだ アンビエントなAI機能を実現する / Ambient AI fetures with Agent Loop
nekorush14
0
120
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
480
AX時代の自治体支援リソース再配分と役割分担の再構成:戦略とロードマップ(概要)
sishi2026
0
150
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
120
Featured
See All Featured
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
450
A Soul's Torment
seathinner
8
3.9k
So, you think you're a good person
axbom
PRO
2
2.2k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
660
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
The Pragmatic Product Professional
lauravandoore
37
7.5k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
960
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Darren the Foodie - Storyboard
khoart
PRO
4
4.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.4k
Transcript
Web Programming –
[email protected]
行動開發學院 行動開發學院 JavaScript Lab RPG極簡雛形製作 Ryan
Chung 76
Web Programming –
[email protected]
行動開發學院 行動開發學院 需求 • 做一個九宮格可以移動的遊戲雛形 •
可以移動主角,但不會走出範圍 • 可以判斷遇到人、障礙物 • 可以判斷走到終點 • 主角的圖案跟方向一致 77
Web Programming –
[email protected]
行動開發學院 行動開發學院 檔案 • index.html:主要顯示頁面 •
main.js:主要程式運作 • style.css:網頁樣式檔 • images:存放圖片的資料夾 (https://ppt.cc/fN2Eox) 78
Web Programming –
[email protected]
行動開發學院 行動開發學院 index.html • 標題、canvas、div、p 79
Web Programming –
[email protected]
行動開發學院 行動開發學院 style.css 80
Web Programming –
[email protected]
行動開發學院 行動開發學院 main.js • 全域變數宣告、事件觸發 81
Web Programming –
[email protected]
行動開發學院 行動開發學院 main.js • 設定地形、擺上主角 82
Web Programming –
[email protected]
行動開發學院 行動開發學院 main.js • 擺上障礙物、敵人 83
Web Programming –
[email protected]
行動開發學院 行動開發學院 編號與座標的對應 0 1 2
3 4 5 6 7 8 (0,0) (200,0) (400,0) (0,200) (0,400) (200,200) (200,400) (400,200) (400,400) 84
Web Programming –
[email protected]
行動開發學院 行動開發學院 main.js 85 • 按鍵判斷
• 座標設定 • 排除其他狀況
Web Programming –
[email protected]
行動開發學院 行動開發學院 main.js • 判斷目標位置是否在邊界內 •
判斷目標位置是否有障礙物/敵人 86
Web Programming –
[email protected]
行動開發學院 行動開發學院 main.js • 依據目標位置內容,顯示提示訊息於下方 87
Web Programming –
[email protected]
行動開發學院 行動開發學院 總算完成!進行測試 • 主角是否會走出邊界? •
是否遇到障礙物、敵人會無法走,並出現訊息 • 是否有判斷抵達終點? • 是否有依方向轉頭? 88
Web Programming –
[email protected]
行動開發學院 行動開發學院 Recap • HTML –canvas、div、id
• JavaScript –image load、canvas draw image、cut image –for ... in、array、switch –keydown、preventDefault • 資料檔案 –圖片 89
Web Programming –
[email protected]
行動開發學院 行動開發學院 Lab • 可以16 x
16嗎? • 一個物品可以跨越多格嗎? • 如何寫出小精靈? • 如何寫出OOXX遊戲? • 加一顆按鈕攻擊敵人 90