Giter VIP home page Giter VIP logo

crashball's Introduction

CrashBall

简易台球游戏,实现控制、预测每个球的路径。

源自工作中的贪吃鱼游戏,产品增加需求要求金币相互可碰撞,同时每个金币的最终位置由服务器控制。

使用box2d这样的物理引擎可以实现逼真的碰撞,但是其位置不可控,不能用物理引擎。故自己重写碰撞过程,碰撞过程分析较复杂,在blog中有分析,地址 http://freestyle21.cn

游戏上线后,趁闲暇时间,整理碰撞的思路,用seajs重新写了一遍。

说明

  1. 使用的append添加的预测路径,如果同时撞击很多,则渲染会很慢。

  2. 在贪吃鱼中使用的是cocos2d的drawDot(), 在Layer 中画点的方式基本不占内存,流畅度不是问题。

  3. 如果用于无引擎的项目,建议使用canvas或者documentFragment.

style

img

crashball's People

Contributors

qubaomingg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.