Javascript ball collision

落爺英雄遲暮 提交于 2019-12-19 11:57:30

问题


I am trying to create a simple javascript game with simple physics. I can determine when 2 balls are colliding but I have having problems with handling the collision.

Does anyone know of any useful tutorials on this? I've been searching the internet for a couple days but can't seem to find anything.


回答1:


In the UK, this would be A-level maths, so not too advanced. I think the phrase you need is "elastic collision". That page has some of the formulae you need.




回答2:


Physics for JavaScript Games, Animation, and Simulations with HTML5 Canvas
is a Book all about modeling Physics simulations in JavaScript.

Though this book starts off by introducing the reader to some simple concepts in Physics and how it can be modeled in JavaScript, this books will assume you have some basic knowledge in Physics and know how to program in JavaScript.



来源:https://stackoverflow.com/questions/4149925/javascript-ball-collision

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!