- HTML5 Game Development by Example:Beginner's Guide(Second Edition)
- Makzan
- 138字
- 2021-07-16 14:09:59
Moving game objects with CSS3 transition
We had a glimpse of the CSS3 transition and transformation modules in Chapter 1, Introducing HTML5 Games, when we were overviewing the new CSS3 features. We often want to animate the game objects by easing the properties. Transition is the CSS property designed for this purpose. Suppose that we have a playing card on the web page and want to move it to another position in five seconds. We would have to use JavaScript to set up a timer and write our own function to change the position every few milliseconds. By using the transition
property, we just need to specify the start and end styles and the duration. The browser optimizes the output and does all the easing and in-between animations.
Let's take a look at some examples to understand this.
- Instant Node Package Manager
- Java多線程編程實戰指南:設計模式篇(第2版)
- PostgreSQL技術內幕:事務處理深度探索
- RTC程序設計:實時音視頻權威指南
- Wireshark Network Security
- The React Workshop
- C語言程序設計
- Scala謎題
- Hands-On Swift 5 Microservices Development
- Clojure High Performance Programming(Second Edition)
- Python機器學習與量化投資
- Tableau Dashboard Cookbook
- HTML5游戲開發實戰
- Java EE輕量級解決方案:S2SH
- HTML5程序設計基礎教程