ผลต่างระหว่างรุ่นของ "01219245/cocos2d/Platform1"
ไปยังการนำทาง
ไปยังการค้นหา
Jittat (คุย | มีส่วนร่วม) |
Jittat (คุย | มีส่วนร่วม) |
||
แถว 10: | แถว 10: | ||
== Collision detection: cc.Rect == | == Collision detection: cc.Rect == | ||
− | Previously, we have implemented our own collision detection routine. However, Cocos2d-html5 has provided us with a few nice collision detection tools. | + | Previously, we have implemented our own collision detection routine. However, Cocos2d-html5 has provided us with a few nice collision detection tools. See [http://www.cocos2d-x.org/reference/html5-js/V2.2.2/symbols/src/E__Projects_cocos2d-html5_cocos2d_core_cocoa_CCGeometry.js.html code here.] |
=== Bounding boxes and world co-ordinates === | === Bounding boxes and world co-ordinates === |
รุ่นแก้ไขเมื่อ 05:34, 26 กุมภาพันธ์ 2557
- This is part of 01219245.
This guide is very short. It only discuss various techniques in implementing platform games.
Here are a few useful links:
- The guide to implementing 2D platformers by Rodrigo Monteiro.
- Sonic Physics Guide
เนื้อหา
Collision detection: cc.Rect
Previously, we have implemented our own collision detection routine. However, Cocos2d-html5 has provided us with a few nice collision detection tools. See code here.
Bounding boxes and world co-ordinates
Intersection
Falling on top
Example code
This is a sample Cocos2d-html5 project that has a jumper over a set of blocks. It implements simple physical movement and rectangular collision detection. View its source code at Bitbucket.