- 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.
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- ClickHouse性能之巔:從架構(gòu)設(shè)計(jì)解讀性能之謎
- 解構(gòu)產(chǎn)品經(jīng)理:互聯(lián)網(wǎng)產(chǎn)品策劃入門寶典
- Mastering ServiceStack
- Pandas Cookbook
- 深度學(xué)習(xí)經(jīng)典案例解析:基于MATLAB
- 算法基礎(chǔ):打開程序設(shè)計(jì)之門
- C/C++算法從菜鳥到達(dá)人
- 深入淺出PostgreSQL
- Unity 2D Game Development Cookbook
- Solr Cookbook(Third Edition)
- Kotlin開發(fā)教程(全2冊(cè))
- Web Developer's Reference Guide
- Python 3 Object:oriented Programming(Second Edition)
- 算法秘籍