HTML5 Canvas 2D框架专注于碰撞检测和物理 [英] HTML5 Canvas 2D Frameworks focusing on collision detection and physics

查看:444
本文介绍了HTML5 Canvas 2D框架专注于碰撞检测和物理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在画布上下文中管理对象的最佳方法。对于我的第一个项目,我希望做以下事情:

I am looking for the best way to manage objects within the canvas context. For my first project I am looking to do the following:


  1. 拉开基础。

  2. Drop通过碰撞检测和弹性将一个圆圈放在地面上。

  3. 让圆圈爆炸减去它下方的地面(爆炸改变了地面,形成了一个像火山口一样的外观)。

所以基本上什么是跟踪对象然后被其他对象改变的最佳方式。我猜你可以跟踪数组中对象的所有更改,但我很好奇是否有类似这样的好框架。谢谢!

So basically what is the best way to track objects that then get altered by other objects. I'm guessing you could track all of the changes to an object in an array, but I was curious if there are any good frameworks for something like this. Thanks!

推荐答案

你需要的是Javascript 2D游戏引擎
,可以在这里找到
< a href =http://www.lukewallin.co.uk/?go=engine =nofollow> http://www.lukewallin.co.uk/?go=engine
这是一个演示:
http:// www。 lukewallin.co.uk/singleplayer_games/sandbox4/sandbox.php?id=21
甚至爆炸:)

what you need is the Javascript 2D Game Engine which can be found here http://www.lukewallin.co.uk/?go=engine Here's a demo: http://www.lukewallin.co.uk/singleplayer_games/sandbox4/sandbox.php?id=21 It even has explosions :)

这篇关于HTML5 Canvas 2D框架专注于碰撞检测和物理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆