Presented by Phillip Chang and Pennsylvania Wu Teaching Basic Game Programming Using JavaScript
Introduction Our target learners –Entry-level college students without strong background in programming Before learning game programming, they struggle for: –Complicated toolkits –Complex syntax and language –Debugging –Initial investment(s)
Need a language that is –easy-to-learning –loosely design structure –cross-platform –operating-system independent –high fault tolerance –require no installation –no complicated compilation –no initial investment (preferably open source) JavaScript is a good candidate
Pros & Cons of JavaScript Advantages –loosely-designed, cross-platform –open source & supported by all major browsers –fully comply with HTML, CSS, DHTML, and AJAX for greater flexibility –test games immediately on the Web Disadvantages –scripts, not self-executable programs –poor support on audio and visual efforts –poor support on 3D graphics programming ( ?) –programmers have less controls on outputs
A basic game programming course Covers –Animation –Handling user inputs –Sprite programming –Object movement (motion) –Collision detection and response –Artificial intelligence –Scorekeeping –Sound effects You can teach them using JavaScript-based browser games
JavaScript browser game Structure is –HTML – page layout –CSS – appearance of objects –JavaScript – application DHTML is frequently used to enhance the game functions
Sample codes Animation Handling user inputs Sprite programming Object movement (motion) Collision detection and response Artificial intelligence Scorekeeping Sound effects
Conclusion JavaScript is good for teaching basic game programming, because –Easy-to-learn and implement –Function sufficient –Reduce the complexity level of teaching –Motivate students by sharing their games online
Question? Thank you very much!