- 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.
- SQL Server 從入門到項目實踐(超值版)
- JavaScript前端開發模塊化教程
- MySQL 8從入門到精通(視頻教學版)
- PHP程序設計(慕課版)
- Android Application Development Cookbook(Second Edition)
- SAP BusinessObjects Dashboards 4.1 Cookbook
- Python編程:從入門到實踐
- 持續輕量級Java EE開發:編寫可測試的代碼
- 軟件項目管理實用教程
- Qlik Sense? Cookbook
- 零基礎學C語言(第4版)
- Advanced Python Programming
- Mastering Android Studio 3
- Access數據庫應用教程(2010版)
- 和孩子一起學編程:用Scratch玩Minecraft我的世界